Efficient way for Continous Creation of XML Content?

Hi
I have a requirement of creating xml content from the data extraced from a udp packet.
As the packet arrives, i have to generate appropriate xml content from them and keep in the same single xml file.
Problem:
Since the xml file is not a flat file, i can't just append the new contents at the end. So if i have to write into xml file, Each and Every time i have to parse the content as a packet arrives and insert the new content under appropriate parent. I think this is not the most efficient way.
Every time parsing the file may affect cpu time and as the file grows in size, the memory will also be a constraint.
Other options i could think of
* Hold the XML Document Object in memory until a certain event like timeout for receiving packet and write into the xml file at oneshot.
* Serialize the objects containing the extracted packet content to a temp file and after some event, parse and create the xml file at oneshot
Which is the efficient way or is there any design pattern to handle this situation? I am worried about the memory footprint and performance on peak loads
I am planning to use JDOM / SAX Builder for xml creation.
Thank you...

Lot's of "maybe" and "I think" and "I'm worried about" in that question, and no "I have found" or "it is the case that". In short, you're worrying too much about problems you don't even know you have. XML is a verbose format anyway, efficiency isn't paramount when dealing with it. Even modestly powered machines can deal with quite a lot of disk I/O these days without noticeable impact. The most efficient thing you can do here is write something that works, and see if you can live with the performance

Similar Messages

  • In a future version of ibook author would be very useful to provide for the creation of shared content online. Teachers can collaborate on the creation of a text. Very useful for teachers to collaborate in the network. sharing sharing sharing

    in a future version of ibook author would be very useful to provide for the creation of shared content online.
    Teachers can collaborate on the creation of a text. Very useful for teachers to collaborate in the network. sharing sharing sharing

    As always, feel free to use the 'Provide iBooks Author Feedback' menu item for features you'd like added in the future, etc. 
    http://www.apple.com/feedback/ibooks-author.html

  • Help on an Efficient Way for Implementing Production Tables Modifications?

    Hey Y'all SQL Gurus,
    We have two tables (I would call Tab1 and Tab2 here). Tab1 contains social security number(SS#) and Emp_ID information while Tab2 has only SS#. Tab2 is a large table containing about 600k rows, and there is no primary key. Table1 has EMP_ID as Primary Key and SS# with 'Not Null' attribute.
    Currently, my task is to eliminate all SS# information from our dB. So, I want to add EMP_ID and eliminate SS# in Tab2, and then set all SS# column of Tab1 to NULL. To date, I have developed the following 2 options to implement this task in Production, and I need your input to choose one of these options and/or any other option(s) or thoughts if any:
    Option #A:
    A.1. Run the following sql to replace SS# of Tab2 with EMP_ID found from Tab1:
    Update Tab2 set SS# = (select Tab1.emp_id from Tab1 where Tab1.SS# = Tab2.SS#);A.2. Alter Tab1 to change attribute for SS# as Null instead of Not Null;
    A.3. Set SSN# of Tab1 to Null.
    Option #B:
    B.1 Add a new column called ‘EMP_ID’ to Tab2;
    B.2 Run the following sql to set ‘EMP_ID’ of Tab2 with EMP_ID found from Tab1:
    Update Tab2 set EMP_ID = (select Tab1.emp_id from Tab1 where Tab1.SS# = Tab2.SS#);B.3 Delete the SS# column and data from Tab2;
    B.4 Alter Tab1 to change attribute for SS# to Null instead of Not Null;
    B.5. Set SSN# of Tab1 to Null.
    I, of course, will test both options in my test area before implementing the changes in Production. But, I just want to make sure that I have not overlooked anything and if there is any other thoughts, concerns and/or suggestions you might have.
    Thanks a lot for any/all the help you could provide on this.

    Thanks for your questions, thoughts and suggestion:
    You wrote:
    I would never go for Option A as you end up with having the EMPID in the SS# field of tab2 right?Why not? The SS# field and column name of Tab2 will be replaced with EMP_ID and 'EMPID' column name. Essentially, Tab2 will include the EMP_ID along with all the leave information associated with the employee.
    You wrote:
    In Option B the UPDATE might fail if you have duplicates on the SS#. I hope not because Emp_id is a primary key of Tab1 and theoretically should only mapped to one ss#. Sure, there could be some data entry error with duplicate SS# used for more than one emp id. I am not sure if I would receive an error message when that situation occurs. Good thinking.
    You wrote:
    B.4 Alter Tab1 to change attribute for SS# to Null instead of Not Null;
    B.5. Set SSN# of Tab1 to Null.
    Why not just DROPing that field?Good suggestion, but our user would like to keep the field for the future use, just in case.
    Thanks again.

  • Efficient way of searching multiple xml files for multiple entries

    As I�m quite new to using xml in java I can't figure out how to solve my problem.
    I've got about 20 xml files, each about 500-1000kB big. each files contains about 500 questions, each with a unique ID.
    A user had to be capable of entering any number of ',' separated id's, and the program needs to show the user the questions.
    Using a SQL server this would be easy, but in this situation I can't. As this had to be a small program I can't add a 10MB jar file either, nor can I ask the users to install an additional program.
    Creating a brute search will be easy, but searching 20MB of xml files multiple times will be hard even for a modern PC.
    So my question is: What will be the most efficient way of searching these files?
    Hope that someone will be kind enough to respond :)
    Rick

    I'd still go with a database. There are databases that are significantly more light-weight than MS SQL Server.
    More concretely there are databases that run completely in memory. HSQLDB is one, Java DB (formerly Derby) is another one.
    I'd parse the XML files once, add them to the database and query from there later on.
    If even that is to complicated for you, then you could simply parse the XML files once and put the Questions into a HashMap with the ID as the key.

  • Most efficient way to load XML file data into tables

    I have a complex XML file running into MBs. I want to load it's data into 7-8 tables.
    Which way will be better:
    1) Use SQL Loader to actually load directly into the 7-8 tables directly by modifying the control card.
    Is this really possible and feasible? I am not even sure about it
    2) Load data as XML Type in a table and register it. Then extract from there to load into various tables.
    Please help. I have to find the most efficient way of doing it.
    Regards,
    Sudhir

    Yes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
    So where does that leave you?
    Some options
    {thread:id=410714} (see page 2)
    {thread:id=1090681}
    {thread:id=1070213}
    Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
    Hope all that helps as a starter.
    Edited by: A_Non on Jul 8, 2010 4:31 PM
    A great example, see the answers by mdrake in {thread:id=1096784}

  • Is there a way for preventing the placeholder from appearing if there is not content for it?

    I am creating a structure with tags and place holders.  However, not all my entries have all the same information. For example, my first entry has a 3 line address (123 West Street, Suit 23, Lincoln NE 68521) but my second entry only has 2 line address (456 North Street, Lincoln NE 68521).  When imported into my structure, the second address reads 456 North Street, <address2>, Lincoln NE 68521. My question for you is, is there a way for preventing the placeholder from appearing if there is not content for it?

    IJWAA,
    A work-around if you don't already use XSLT (to avoid having to) is to not have placeholder text, just use empty tags in your text layout that correspond to your incoming XML structure (any unused by the incoming structure IN ORDER, will be skipped). So long as you don't mind the blank line (rather than left over placeholder copy).
    If you had placeholder copy in your text box (<address2> for example) look at it using the story editor window (edit > edit in story editor, or command-y/control-y) so you can see the surrounding tags... style the surrounding tags by selecting them with the cursor and applying character or paragraph styles (with text in between the tags at the time) and then delete only the placeholder text from the middle of the sandwich, leaving the tags in tact. Trying to do this without being in the story editor will not work.
    Also, when importing the XML, I believe you'll still need to use "merge content" and "don't import empty white space" as you have been in order to replace placeholder text in any areas you had it.
    For situations when you have a mixture of dynamic and static text in the same text block and you are merging data (more so when the placeholder text has been deleted as I've suggested above but the dynamic tags for the possible incoming text are still there), you can use a tag you've created (I call mine "staticText") in your layout to wrap ANY bits of text you don't want to accidentally delete when the surrounding tags get populated or not, using the merge option upon importing your XML. Just be sure never to use "staticText" as an actual tag in your structure or surrounding incoming data. The text contained within staticText tags in your layout will be ignored by incoming data, and won't accidentally get deleted when it's sandwiched between two sets of tags that are dynamically populated when merge content is the import option.
    In my example below I'm using brackets/carats with the tag name instead of the color coded tag icon you see in the story editor, also I've used LB here to indicate a regular line break in Indesign and SP a regular space character in indesign:
    [staticText>Name:<staticText][firstName>Abc<firstName][staticText>SP<staticText][lastName>Xyz<firstName][staticText>LB<staticText]
    [staticText>Address:<staticText][address1><address1][staticText>LB<staticText]
    [address2><address2][staticText>LB<staticText]
    all other tags on following lines...
    This should just leave a blank line for address2 when no data comes in for it. I'm assuming you have line breaks, if not, all the better.

  • Component for XML content visualization providing content format

    Hi,
    I have a XML content which is just coming to my WD application as string - no tabs, no empty spaces - it is just one long string token.
    Is there any WD component which can provide the format of this xml content string (similar for example to the built in viewer within Web Dynpro explorer), or I have to parse it on my own and visualize it within a text view for example?

    Hi Maksim,
    I tried in this way, but I am working with NY version of WD and there is no IFrame UI component, what component to use to visualize this URL content?
    I tried FormattedTextEdit, which bind to the url string and got an exception
    java.lang.ClassCastException: java.lang.String
        at com.sap.tc.webdynpro.clientserver.uielib.standard.impl.FormattedTextEdit.getValue(FormattedTextEdit.java:764)
        at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.FormattedTextEditAdapter.getHtmlText(FormattedTextEditAdapter.java:286)
        at com.sap.tc.ur.renderer.ie6.RichTextEditRenderer.render(RichTextEditRenderer.java:38)
        at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:323)
        at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.RenderManager.render(RenderManager.java:153)
    Regards, Tihomir

  • Efficient way to read through big explain plan and genterate html explain plan for sql id's executed in past

    Hi,
    I have a sql which is recently having a performance problems in Production. I have generated a explain plan for it trying to find out what it is doing but plan itself is close to 1000 lines. I want to check if there is any efficient way to go through big plan like this one and quickly find the damaging areas..
    2) I also wanted to know if there is way to generate explain plans in HTML format which executed in past and have entry in dba_hist_sqltext.
    3) I also have two sql_monitor reports which I want to compare. is there any efficient way to do it as well?
    Please share your thoughts!
    Thanks in advance!
    Regards,
    Suman-

    Hi,
    I suggest you can try running sql advisor on the query maybe something fruitful comes up
    http://www.oracle-base.com/articles/11g/sql-access-advisor-11gr1.php
    I am not sure about the explain plan being printed in html format but
    You may also want to try the sqlhistory.sql query from below page
    http://evdbt.com/scripts/
    I have used it many times to check on executions and explain plans which may have changed over the period
    I have faced it many times , the query picks up a bad explain plan and performs poorly

  • HT4759 I just got a new IPAD and transferred everything through the cloud from my old IPAD2. The new one says "this IPAD is currently being restored. It has been that way for about 2 hours. Also, I books will open and then close right away with no content

    I just got a new IPAD and transferred everything through the cloud from my old IPAD 2. The new one says "this IPAD is currently being restored. It has been that way for over two hours. Also, I Books opens and then closes right away with no content. Does it take this long, or is there an issue?

    I also tried manually underlining a few things on the new iPad and when highlighting a paragraph, it would skip a few lines and the line would go through a few as well. Looks like a major iBooks glitch needs to be addressed here.

  • Efficient or Better Ways for Data Declaration

    Hi Guys,
    Basically I've always programmed much the same way for a pretty long time now. Lately I've been asking myself the question - "how can i start improving on my tried and trusted ways".(oftern a linear programming approach). As part of this I'm examining ways to declare data better within in programs and to adopt a neat way to do so.
    This may seem pretty trivial but the first question I want to ask is how to declare data better
    e.g. I need to declare constants - each constant corresponds to a rule number; 1, 2,3,4,5,6 - 23 etc.
    Instead of declaring the following line 23 times - is there a better way to declare in such a way.
    Constants: c_rule_1 type c value '1' ,
                    c_rule_2  type c value '2',
                    etc etc etc
    Your thoughts are greatly appreciated.
    Thanks.
    DK
    Edited by: Damien Kesle on Nov 26, 2008 10:00 AM

    Hi,
    With my knowledge, data declarations for all constants with DATA comamnd itself is good practise in point of performance. Alternative is dynamic creation of variables. But it consumes more time and is not good to practise. Instead of crating individual parameters for each constant, you could create a structure and add all constants as fields as follows:
    constants: begin of con,
                       1 type c value '1',
                       2 type c value '2',
                    end of con.
    Regards,
    Prasanth

  • Moving content from iMovie to iMovie - what's the most efficient way?

    If I edit and create movies in iMovie08 on one iMac and I want to transfer the content to iMovie08 another iMac 200 miles away , what's the most efficient way? I prefer not to burn DVDs, because I want to do further work on the movies on the second iMac's iMovie (so I can share them with iTunes and sync them with Apple TV).

    >PDPageAddCosContents(destPage, PDPageGetCosContents(srcPage));
    Does this method (PDPageGetCosContent) exist? It would be easy enough
    to create, but I don't see it in the document.
    More seriously, I have a vague memory that it is a Really Bad Thing to
    share the same Contents objects between multiple pages. Maybe
    something to do with page deletion, can't remember.
    >PDPageAddCosResource(destPage, PDPageGetCosResources(srcPage));
    These two methods are not symmetric, and PDPageAddCosResource doesn't
    work that way, sadly...
    Aandi Inston

  • Seek easy and safe way for average users to manage the contents of Portal.

    Dear all,
    My boss today requested me to provide a easy, safe way for average users in my company to manage the contents of Portal themselves.
    My boss request users can upload files, documents, images and text into Portal.
    I know that Oracle Portal provides security control for editing Portal. But it also provides a quite complex operations for manage the contents of Portal.
    I am afraid average users cannot manage it easily.
    Can anyone have experience on the issues and can you give me suggestion?
    Thanks a lot
    George (HK)

    Hi Vijay.B,
    We can give privileges to manage the contents of the portal page.
    Create a group and add the users into that group and for the page level privilege >>add this group as manage.
    The members of the group can manage the page.I know the above is the standard strategy for users to manage the portal contents.
    But, as an average user, I think it is still to complicated to manage.
    For my case, I need to provide a means for average users to add news to the portal, so my priliminary idea is that I will create a portlet for news entries such as news heading, hyperlinks, text and save the entries in DB. Then, on the homepage of Portal, I will create another portlet for displaying the news headlines with hyperlink pointing to the actual URL.
    thanks
    George
    Regards,
    Vijay.B

  • Most efficient way to pack U16 -- U32 Array for Data DMA Transfer?

    I have an RT controller that wants to send down data to an FPGA using DMA.  In LabVIEW 8.2, I have no choice but to pass down U32 blocks of data however my my input data is a U16 array.  This leaves me two choices:  1) Wire the U16 Array directly to the DMA node which will coarse it to U32 but I'm wasting 16bit*#of elements 2) Pack the U16 array into a U32 Array prior to sending it down.    I would like to do #2 and I have a method that works (and seems to be pretty efficient) but I have a feeling I am doing it the hard way (or roundabout way).   Is  their a simpler (but just as efficient) way to do this procedure?  Thanks
    Solved!
    Go to Solution.
    Attachments:
    ni1.gif ‏8 KB
    ni2.gif ‏10 KB

    SiegeX wrote:
    ... unfortunately I forgot to mention that byte order does matter and odd # of inputs are allowed.
    See, that something that does not make full sense here, because you end up with a mixed byte order, because the 16bit halves are still big endian. What's at the "other" end, exactly?
    Anyway, here's a slight simplification of the previous code. (The typecast is better if we can do it all big endian and omit the "decomate/interleave" dance.)
    (You could also flatten to a string and back. This has the advantage that byte order is a direct option. I don't know how that is, performance wise.))
    Message Edited by altenbach on 11-12-2008 04:31 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    typecasting3.PNG ‏4 KB

  • Import of XML file failed in portal using XML Content and Action

    Hi Friends,
    I am trying to import the simple XML file which is just creating the folder in the PORTAL_CONTENT using XML CONTENT AND ACTIONS  which is one way of creating the portal content. GO TO SYSTEM ADMINISTRATION > TRANSPORT > XML CONTENT AND ACTIONS > IMPORT.
    The reason for using this import tool is to upload the backend Business roles, which is not not working on our corporate portal. To test the import functionality I used the following xml file (I got this XML file by exporting the test folder in the portal using the same tool)
    <GenericCreator author="XML Creator" version="XML Automatic Creation" mode="clean,execute" report.level="success" createMode="1" default.locale="en" ignore="false">
    <Context name="portal_content" objectClass="com.sap.portal.pcd.gl.GlContext"></Context>     <Property name="parent1" value="pcd:portal_content"/>
         <Context name="com.dri.fldr.im" objectClass="com.sap.portal.pcd.gl.GlContext" create_as="0" parent="$">
              <Attributes>
                   <Attribute name="com.sap.portal.pcm.Description" type="text">
                        <AttributeValue value="" locale=""/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
                   <Attribute name="com.sap.portal.pcm.Title" type="text">
                        <AttributeValue value="test" locale=""/>
                        <AttributeValue value="test" locale="en"/>
                        <Attribute name="administration" type="string">
                             <AttributeValue value=""/>
                        </Attribute>
                        <Attribute name="mandatory" type="string">
                             <AttributeValue value="true"/>
                        </Attribute>
                        <Attribute name="Inheritance" type="string">
                             <AttributeValue value="NONFINAL"/>
                        </Attribute>
                   </Attribute>
              </Attributes>
         </Context>
    </GenericCreator>
    SDN BLOCKED THE XML The above XML file works fine in other portal in the landscape but not in corporate portal ( which is freshly build recently).Following error message is display when i am trying to upload the file
    Status Name Action Type Comment
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Failed to extract root node
    General Extracting root node E:\usr\sap\EPD\JC00\j2ee\cluster\server0\%USERPROFILE%\AppData\Local\Temp\tmp_masscontent4135391959047431276.xml Parsing failed .
    Dont know is there a service/ configurations needs to be done to enable this feature?.
    Thanks
    Edited by: hammad on Sep 4, 2009 5:48 PM
    Edited by: hammad on Sep 4, 2009 5:49 PM

    The problem statement is not very clear.
    Try following this how to guide [https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/207a2141-c870-2910-e080-90c920b24f47&overridelayout=true|How-To]
    Best Regards,
    Prasanna K

  • Crosstab with multiple rowset xml content

    I have multiple rowsets (xml files) which I want to calculate subtotals from.  Each xml data set has identical columns.  If I union all the files together, the xml content contains multiple rowsets and the Crosstab function does not give me a summed value of each column, but instead it creates a column for each column in each rowset.
    The Normalize and the rowset combiner transform both combine rowsets by appending the second dataset into new columns, is there any way to append the data into new rows instead?
    Because my final file is going to have something over 30,000 rows (14Mb), I am reluctant to use a repeater on each row of each file to combine it into a new rowset.  Is there an efficient way to handle this calculation?

    Sue,
    I believe that we are off on the wrong foot here...all things aside...
    Join will work for your scenario when combined with other actions for your calculation and it will be easier to maintain than a stylesheet which will be beneficial to you in the end.  Please do not be too quick to judge the solution
    As for the error message that's one for support, what was the error in the logs?
    -Sam

Maybe you are looking for

  • Syntax error while creating a invoice

    Hi I am new to this forum hope u guys can help me out, I am ruuning following syntax for creating an invoice and for this error message is coming which is given below. Select aadrnr astdc1 b~name1 into table inv_head1 From kna1 as a inner join adrc a

  • Ejb 2.0 deployment code error with WAS 6.1

    Hi we have recently migrated to WAS 6.1 from 5.1. Since then we are facing the below problem.We use ant task to call ejbDeploy.sh to generate deployment code for one of our ejb module.All i did in the ant script was changing the path to ejbdeploy too

  • Problem with Briefing Books and iBots

    I have a question about the usage of Briefing Books and iBots: In my Briefing Book there are different analysis, some with tables and others with charts and graphs. The problem is, when I send this Briefing Book to my email by iBot, then the file att

  • Converting iPhoto slideshow to DVD/movie

    I made a slideshow in iPhoto with about 150 pictures. It had 2 songs attached to it to play while shpwing the pictures. I want to put it on a DVD to give to friends. When I go to share with iMovie and iDVD it transfers but the music is not attached..

  • What is a classpath and where can  i find it

    hi all... i am desperately loooking for the claspath as i have to include some directories in order for my program to run..plus i don't know the commands..thanks alot