Xerces: Creating large XML docs

Hi
I am using the Xerces DOM parser to create large XML files. However, I need to flush the output every now and then to a file since I don't want the memory to keep growing. I tried doing the following:
_domWriter->writeNode(fileFormatTarget, domDocument);
fileFormatTarget->flush();
But if I do a flush many times, the whole XML file is written again to the file.
Is there a way to keeping flushing the memory to the file and releasing the memory after flushing ?
I tried:
_domWriter->release()
But I can't use the DOMWriter any longer.
Thanks
Bijal

Bijal,
"Bijal Vora" <[email protected]> wrote in message news:19360326.1100183759055.JavaMail.root@jserv5...
I am using the Xerces DOM parser to create large XML files. However, I need to flush the output every now and then to a file sinceI don't want the memory to keep growing. I tried doing the following:
>
_domWriter->writeNode(fileFormatTarget, domDocument);
fileFormatTarget->flush();
But if I do a flush many times, the whole XML file is written again to the file.
Is there a way to keeping flushing the memory to the file and releasing the memory after flushing ?
I tried:
_domWriter->release()
But I can't use the DOMWriter any longer.XML in general and DOM in particular is not suitable for processing
large amounts of data. For your case the only feasible option could
be using custom SAX handler, IMHO.
Regards,
Slava Imeshev

Similar Messages

  • Problem Loading Large XML Doc

    I'm running 10.2.0.3 on a Linux box and I'm having problems loading a large XML document (about 100 MB). In the past, I would simply load the XML file into a XMLType column like this:
    INSERT INTO foo VALUES (XMLType(bfilename('XMLDIR', 'test.xml'). nls_charset_id('AL32UTF8')));
    But when I try this with a large file, it runs for 10 minutes and then returns an ORA-03113. I'm assuming the file is just too large for this technique. I spoke to Mark Drake when I was at OpenWorld and he suggested I use Oracle XML DB, so I created and registered a schema and tried using sqlldr to load the doc, but it ran for 2 1/2 hours before returning:
    Parse Error on row 1 in table FOO
    OCI-31038: Invalid integer value: "129"
    I tried simplifying both the XML file and schema to just the following:
    <schedules>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="19672"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="15387"/>
    <s s="2009-09-21T04:00:00" d="25200" p="335975" c="5256"/>
    <s s="2009-09-21T04:00:00" d="86400" p="335975" c="26198">
    <k id="5" v="2009-09-21 09:00:00.000"/>
    <k id="6" v="2009-09-22 03:59:59.000"/>
    <k id="26" v="0.00"/><k id="27" v="US"/>
    </s>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="11678"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="26697"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="25343"/>
    <s s="2009-09-21T04:00:00" d="21600" p="335975" c="25269"/>
    <s s="2009-09-21T04:00:00" d="86400" p="335975" c="26200">
    <k id="5" v="2009-09-21 09:00:00.000"/>
    <k id="6" v="2009-09-22 03:59:59.000"/>
    <k id="26" v="0.00"/><k id="27" v="US"/>
    </s>
    </schedules>
    <?xml version="1.0" encoding="UTF-8"?>
    <!--W3C Schema generated by XMLSpy v2008 sp1 (http://www.altova.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xdb="http://xmlns.oracle.com/xdb"
        version="1.0"
        xdb:storeVarrayAsTable="true">
         <xs:element name="schedules" xdb:defaultTable="SCHEDULES">
              <xs:complexType xdb:SQLType="SCHEDULES_T">
                   <xs:sequence>
                        <xs:element ref="s" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="s">
              <xs:complexType>
                   <xs:choice minOccurs="0">
                        <xs:element ref="f" maxOccurs="unbounded"/>
                        <xs:element ref="k" maxOccurs="unbounded"/>
                   </xs:choice>
                   <xs:attribute name="s" use="required" type="xs:dateTime"/>
                   <xs:attribute name="p" use="required" type="xs:int"/>
                   <xs:attribute name="d" use="required" type="xs:int"/>
                   <xs:attribute name="c" use="required" type="xs:short"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="k">
              <xs:complexType>
                   <xs:attribute name="v" use="required" type="xs:string"/>
                   <xs:attribute name="id" use="required" type="xs:byte"/>
              </xs:complexType>
         </xs:element>
         <xs:element name="f">
              <xs:complexType>
                   <xs:attribute name="id" use="required" type="xs:byte"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    Keep in mind both the actual XML file and corresponding XSD is much more complex, but this particular section is about 70 MB so I wanted to see if I could just load that.  I used the following sqlldr script:
    LOAD DATA
    INFILE *
    INTO TABLE schedules_tmp TRUNCATE
    XMLType(xml_doc)(
         lobfn FILLER CHAR TERMINATED by ',',
         xml_doc LOBFILE(lobfn) TERMINATED BY EOF
    BEGINDATA
    /tmp/schedules.xmlThis worked fine on a small doc - loaded correctly and I could query it fine - but when I tried using the 70 MB file it ran for a couple of hours before dying with a memory problem.
    So what am I doing wrong? Is there a better way to load a large file?
    Thanks for the help.
    Pete
    Edited by: mdrake on Nov 9, 2009 8:46 PM

    Mark:
    Answers to your questions:
    Do you use direct load ? -> Yes. I tried again using UNRECOVERABLE LOAD DATA to try to speed up performance, but it still ran for a couple of hours before dying.
    Which DB Release are you working with ? -> 10.2.0.3
    Can you see if you can upload via FTP ? -> I added noNamespaceSchemaLocation to my XML file and ftp'd it to my XML directory, but it wasn't recognized. Is there something else I have to do?
    The change for unsignedInt should have code rid of the issue with the value 129. Did it ? -> I didn't try it again on the whole XML file (I'm just working with the schedules section), so I haven't verified this.
    I'm still stumped as to why sqlldr takes so long. I could write something to parse the XML file into a flat file and then use sqlldr to load it into a relational table, and the load would only take a few minutes. But then I wouldn't be using XML DB which I thought would be faster. What am I doing wrong?
    Pete

  • Error in Creating a XML Doc

    i am having a error in the fellowing program.
    When i create a xml file.Entire XML file is printed in a single line.
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    class CreateDomXml
    public static void main(String[] args)
    try{
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = factory.newDocumentBuilder();
    Document doc = docBuilder.newDocument();
    Element root = doc.createElement("root");
    doc.appendChild(root);
    Comment comment = doc.createComment("This is comment");
    root.appendChild(comment);
    Element childElement = doc.createElement("Child");
    childElement.setAttribute("attribute1","The value of Attribute 1");
    root.appendChild(childElement);
    TransformerFactory tranFactory = TransformerFactory.newInstance();
    Transformer aTransformer = tranFactory.newTransformer();
    Source src = new DOMSource(doc);
    Result dest = new StreamResult(System.out);
    Result dest = new StreamResult(new File("hello.xml"));
    aTransformer.transform(src, dest);
    }catch(Exception e){
    System.out.println(e.getMessage());
    OUTput
    *<?xml version="1.0" encoding="UTF-8" standalone="no"?><root><!--This is comment--><Child attribute1="The value of Attribute 1"/></root>*
    Edited by: psathishcs on May 29, 2008 6:24 PM

    what do you expect it to print?
    your output is set to System.out, not a file.

  • Build large XML Docs within PLSQL

    Hi..
    I wondered what will be the fastest way to make a XML Document from a selection resultset and put it in a CLOB.
    I think XSU isn't suitable to retrieve large XML (?)
    Maybe I should build the XML within PLSQL manually by adding all Tag- and Element-Strings to one CLOB.
    Can you please give me some recommendations.
    Al

    If you are using 9iR2 you might want to look at the new SQL/XML operators that provide an industry standard mechanism for generating XML from a SQL Query. Using these operators allows significant optimizations to take place in the database kernel as the optimzier is aware that the result set will be presented as an XML Document. The typical output of these operators is an XMLType which can be stored as a column in the database. There is not need to use a CLOB as such, as for not Schema based XMLType, the underlying storage mechanism is CLOB

  • Creating large XML files

    I have been working with DOM parser for creating XML files but as the size of the XML file increases, the memory allocated to the JVM gets consumed at a high rate. So i needed to find another parser that can make my life much easier. SAX parser is not a solution for me as it gives problems with doc manipulation and a lot of complex coding will be involved in callback functions.
    Thank you in advance

    vivek_kumar_kohli wrote:
    I have been working with DOM parser for creating XML files Eh? The parser is for reading xml files, not creating them. You can create them using from a DOM using the Transformer mechanism, but that's not about the parser.
    but as the size of the XML file increases, the memory allocated to the JVM gets consumed at a high rate. So i needed to find another parser that can make my life much easier. SAX parser is not a solution for me as it gives problems with doc manipulation and a lot of complex coding will be involved in callback functions.
    It's the nature of the beast, either you build the whole document tree in memory, in which case you need the whole thing stored and lots of RAM, or you process it looking at a small part at a time, which is going to be more complicated.
    Using SAX isn't that complicated, basically I just use a different ContentHandler for each significant element type. You work with a stack of content handlers, pushing a new one on the stack when a tag opens, and popping it off when the element closes.
    This kind of code replaces code which walks the DOM tree, and it's really not all that different in overall structure.
    Outputting XML isn't that hard to do with simple println calls.

  • Best method for encrypting/decrypting large XML files ( 100MB)

    I am in need of encrypting XML for large part files that can get upwards of 100Mb+.
    I found some articles and code, but the only example I was successful in getting to work used XMLCipher, which takes a Document, parses it, and then encrypts it.
    Obviously, 100Mb files do not cooperate well with DOM, so I want to find a better method for encryption/decryption of these files.
    I found some articles using a CipherInputStream and CipherOutputStreams, but am not clear if this is the way to go and if this will avoid memory errors.
    import java.io.*;
    import java.security.spec.AlgorithmParameterSpec;
    import javax.crypto.*;
    import javax.crypto.spec.IvParameterSpec;
    public class DesEncrypter {
        Cipher ecipher;
        Cipher dcipher;
        public DesEncrypter(SecretKey key) {
            // Create an 8-byte initialization vector
            byte[] iv = new byte[]{
                (byte)0x8E, 0x12, 0x39, (byte)0x9C,
                0x07, 0x72, 0x6F, 0x5A
            AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
            try {
                ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
                dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
                // CBC requires an initialization vector
                ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
                dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
            } catch (java.security.InvalidAlgorithmParameterException e) {
            } catch (javax.crypto.NoSuchPaddingException e) {
            } catch (java.security.NoSuchAlgorithmException e) {
            } catch (java.security.InvalidKeyException e) {
        // Buffer used to transport the bytes from one stream to another
        byte[] buf = new byte[1024];
        public void encrypt(InputStream in, OutputStream out) {
            try {
                // Bytes written to out will be encrypted
                out = new CipherOutputStream(out, ecipher);
                // Read in the cleartext bytes and write to out to encrypt
                int numRead = 0;
                while ((numRead = in.read(buf)) >= 0) {
                    out.write(buf, 0, numRead);
                out.close();
            } catch (java.io.IOException e) {
        public void decrypt(InputStream in, OutputStream out) {
            try {
                // Bytes read from in will be decrypted
                in = new CipherInputStream(in, dcipher);
                // Read in the decrypted bytes and write the cleartext to out
                int numRead = 0;
                while ((numRead = in.read(buf)) >= 0) {
                    out.write(buf, 0, numRead);
                out.close();
            } catch (java.io.IOException e) {
    }This looks like it might fit, but there is one more twist, I am using a persistence manager and xml encoding to accomplish that, so I am not sure how (where) to implement this method without affecting persistence.
    Any guidance on what would work best in this situation would be appreciated.
    Regards,
    vbplayr2000

    I can give some general guidelines that might help, having done much similar work:
    You have 2 different issues, at least from my reading of your problem:
    1) How to deal with large XML docs that most parsers will not handle without memory issues
    2) Where to hide or "black box" the encrypt/decrypt routines
    #1: Check into XPP3/XMLPull. Yes, it's different that the other XML parsers you are used to using, and more work is involved, but it is blazing fast and can be used to parse a stream as it is being read. You can populate beans and process as needed since there is really not much "inversion of control" involved compared to parsers that go on to finish the entire document or load it all into memory.
    #2: Extend Serializable and write your own readObject/writeObject methods. Place the encrypt/decrypt in there as appropriate. That will "hide" the implementation and should be what any persistence manager can deal with.
    Regards,
    antarti

  • Processing large XML messages ( 100Mb) in PI 7.1

    Hi All
    I have PI 7.1 & need to process & create Large XML messages with not so extensive mapping & direction is from SAP to FTP server.
    I created the test scenario using Consumer Proxy in order to check how large message our PI server can handle, so till 100Mb it went fine but anything above 100Mb got stuck in R3 server Integration engine only. When I checked the message in MONI of R3 server, initially it gives "Automatic Restart" status & after the retry limit was over it gave me "System Error-after automatic restart" with the error status as -->
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Integration Server
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">CLIENT_RECEIVE_FAILED</SAP:Code>
      <SAP:P1>110</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error while receiving by HTTP (error code: 110, error text: )</SAP:Stack>
      <SAP:Retry>A</SAP:Retry>
      </SAP:Error>
    Can you let me know how can we further tune our SAP R3 server to process the large files as the message is getting stuck in R3 server (at HTTP_SEND) only it is not even reaching PI server, also breaking message into small messages cannot be implemented as we need to send the file in ONE go only.
    Regards
    Lalit
    Edited by: Lalit Chaudhary on May 5, 2009 6:05 PM
    Edited by: Lalit Chaudhary on May 6, 2009 2:49 AM

    so till 100Mb it went fine but anything above 100Mb got stuck in R3 server Integration engine only
    all the systems are configured with a default timeout parameter....it determines till what time a system should try processing a file...if this is exceeded then you may get the mentioned error....
    So what you can do is try increasing the timeout of your system....so that you give the system some more time for processing the file
    Please note that increasing the timeout would mean decreasing performance
    To check how much is the impact see the performance before increasing the timeout and after increasing..
    If you need some help in file processing in XI:
    /people/sravya.talanki2/blog/2005/11/29/night-mare-processing-huge-files-in-sap-xi
    Hope it helps.
    regards,
    Abhishek.

  • Problem inserting XML doc (character set)

    Hi all,
    I'm having trouble trying to insert XML either "posting" it (xsql) or "putting" it
    (OracleXML putXML).
    The error that I get: "not supported
    oracle-character-set-174".
    The environment is:
    Oracle 8i 8.1.5
    (NLS_CHARACTERSET EL8MSWIN1253 for greek)
    JDK 1.2.2
    Apache Web Server 1.3.11
    Apache JServ 1.1
    XSQL v 0.9.9.1 and
    XMLSQL, XML parser v2 that comes with it.
    I had dropped all java classes and reloaded
    them using oraclexmlsqlload batch file.
    But still getting the same error.
    The thing that is that I am
    able to insert XML doc that was generated
    with an authoring tool called W4F that extracts data from HTML pages and map them to
    XML document, even with greek characters
    in it. But when XML is generated using
    an editor or the servlet like the following:
    newschedule.xsql like
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="latestschedules.xsl"?>
    <page connection="dtv" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request date-format="DD'/'MM'/'YYYY" table="schedule_details_view"
    transform="request-to-newschedule.xsl"/>
    <xsql:query table="schedule"
    tag-case="lower" max-rows="5" rowset-element="latestschedules"
    row-element="schedule">
    select *
    from schedules
    order by schedule_id desc
    </xsql:query>
    </page>
    request-to-newschedule.xsl like
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="request/parameters">
    <ROW>
    <SCHEDULE_ID><xsl:value-of select="Schedule_id_field"/></SCHEDULE_ID>
    <DESCRIPTION><xsl:value-of select="Description_field"/></DESCRIPTION>
    <DETAILS>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_1"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_1"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_2"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_2"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_3"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_3"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_4"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_4"/></DURATION>
    </DETAILS_ITEM>
    <DETAILS_ITEM>
    <STARTING_TIME><xsl:value-of select="Starting_Time_field_5"/></STARTING_TIME>
    <DURATION><xsl:value-of select="Duration_field_5"/></DURATION>
    </DETAILS_ITEM>
    </DETAILS>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    Hope that someone could help me on this ...
    Any advice is highly appreciated.
    Thanks in advance
    Nicos Gabrielides
    email: [email protected]

    Hi,
    How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
    Hope that helps.
    OTN team@IDC

  • Error when saving large XML Forms - XFBuilder

    When creating large XML Forms (many entry fields, many links when metadata properties), the xfbuilder aborts the operation with an error message stating a networkcommunication failure / server response time-out. When some fields are deleted, the saving takes some time, but will prevail...
    Does anybody have experienced these problems as well and is there a solution so that larger xmlforms can be created?? Currently the xmlforms producing errors have over 100 entry fields.
    Rgds Caspar

    OK, I found it: when editing the Project Options, the server time out can be set. In NW04 edition this is set default to 120; in EP60 SP2 this value is empty. Increasing the value (e.g. 180) does the trick!

  • Problem inserting xml doc into tables

    I'm trying to load and xml doc into a table/columns using putXML. I clearly have elements in my xml doc that I do not want to load into the table. I am receiving the following error: The XML element tag 'VERB' does not match the name of any of the columns/attributes of the target database. I'm having difficulty figuring out how to exclude of ignore these elements.
    Any help would be greatly appreciated.
    Thanks,
    John

    Hi,
    How about applying an XSL on the existing XML doc to create another XML doc to filter out the table column not found in the target db table, so that all the columns are matched and then use putXML to load?
    Hope that helps.
    OTN team@IDC

  • How to set SAXParser at command-line interface to create a large XML file

    Hi,
    I am trying to create a large XML file (more than 50 MB) by selecting from Oracle database but failed because of "out of memory" error. According to "Oracle XML Developer Guide", we should use SAXParser to parsing a large XML file. But there is no example to show how to set SAXParser at command-line
    Following is what I use to get xml files. It works only when the file is small.
    java OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    When I set SAXParser at the way below,
    java oracle.xml.parser.v2.SAXParser OracleXML getXML -DateFormat -withDTD -rowsetTag PO_HDR -conn
    "jdbc:oracle:oci8:@server_name" -user "ID/password" "select * from table_name"
    it failed with the error message: "In class oracle.xml.parser.v2.SAXParser: void main(String argv[]) is not defined"
    Does anyone know how to solve the problem? I'll be appreciated very much for your help.
    Yi

    here are my ideas.
    register the xml schema.
    using xmldom, generate the desired xml output and return as xmltype.
    then you can use something like this to check.
    declare
    xmldoc xmltype ;
    begin
       -- populate xmldoc from you xmldom function
       -- validate against XML schema
       xmldoc.isSchemaValid(schema_url, root_element);
       if xmldoc.isSchemaValid = 1 then
            --valid schema
       else
            --invalid
       end if;
    end

  • Create a large XML extract from relational tables - 10g

    The Oracle 10g documentation recommends using the various SQL functions such as XMLAGG,XMLELEMENT or DBMS_XMLGEN under chapter "16 Generating XML Data from the Database" for generating a XML extract file. The DBMS_XMLDOM seems like a useful structured package to create a XML formatted extract. Any idea why Oracle does not recommend the use of XMLDOM API ? Are there performance issues or likely de-support ?
    Whats the best way to produce a large XML extract?
    Thanks.

    mdrake wrote:
    No reason not to use it. It just tends to require a lot more coding than the other methods. Underneath the covers they all map into the same code-line. In general, to generate a given XML document you wlll write far fewer lines of code using the SQL/XML operators. Less Code written = less code to maintan = faster time to market.Less code to parse...?

  • Has anybody tried creating and validating a XML doc with XML Schema?

    Hi,
    Has anybody tried creating and validating a XML doc with XML Schema?

    With XMLBeans, an XML document may be created from and validated with an XML schema.

  • Creating XML Doc using JDOM... HELP!!!!!

    I've got a constructor which creates an Annotation object ... each object has 4 fields;
    Annotation Owner
    Date/time submitted
    ID
    Annotation Text
    When each Annotation object is constructed it is placed on a Vector array.
    I now want to create an XML Document for the Annotation object on the Vector Array...
    I am using JDOM and have managed to create a simple constructor:
    // Class XMLDocument...
    // This class is a subclass of MooNotes 2 that is designed to construct a XMLDocument containing a particular
    // Annotations details...
    class XMLDocument {
         long docID;
         org.jdom.Document xmldoc;
         * <p>
         * Build a simple XML document in memory
         * </p>
         // Constructor for the XMLDocument class...
         // This constructor will construct an
    // XMLDocument and populate the data fields with the particular
         // Annotation contents.
         // The constructor is passed a DOCUMENT ID and a JDOM document when invoked and it uses this data to construct
         // the XML Document.
         public XMLDocument(long docID, org.jdom.Document xmldoc) {
         this.docID = docID;
         this.xmldoc = xmldoc;
         xmldoc.setDocType(new org.jdom.DocType("html", "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"));
         org.jdom.DocType docType = xmldoc.getDocType();
         messagearea.append("XMLDocument Element: " + docType.getElementName() + " \n");
         messagearea.append("XMLDocument Public ID: " + docType.getPublicID() + " \n");
         messagearea.append("XMLDocument SystemID: " + docType.getSystemID() + " \n");
         messagearea.append("Document successfully built " + " \n");
    How do I construct a Document to accept and hold the contents of an Annotation Object?
    P.S.
    AnnotationSubmitter is a String
    So is Date/time
    ID is a long number
    Annotation Text is also a String

    Since your constructor receives a org.jdom.Document already, it's difficult to figure out what you're trying to do. I'm also not sure what you mean by a Vector array, but I'm gonna give it a shot. To construct a simple org.jdom.Document (without namespace) I would do the following:
    Element root=new Element("ALL_ANNOTATIONS");
    Document=new Document(root);
    doc.setDocType(new DocType(  ...[your stuff]... ));
    and loop through your annotations objects
    for(int i=0;i<n;++i)
        root.addChild(new Element("ANNOTATION")
                      .addChild(new Element("ANNOTATION_OWNER")
                            .setText(annotObjects.getAnnotationOwner()))
    .addChild(new Element("ANNOTATION_TIME")
    .setText(......getTime()))
    .addChild(new Element("ANNOTATION_ID")
    .setText(""+annotObjects[i].getID()))
    .addChild(new Element("ANNOTATION_TEXT")
    .setText(......getText()));
    In the end this should give you the equivalent of:
    <ALL_ANNOTATIONS>
    <ANNOTATION>
    <ANNOTATION_OWNER>
    Text of First Annotation Owner
    </ANNOTATION_OWNER>
    <ANNOTATION_TIME>
    Time/Date of annotation
    </ANNOTATION_TIME>
    <ANNOTATION_ID>
    1234567
    </ANNOTATION_ID>
    <ANNOTATION_TEXT>
    Some Annotation Text
    </ANNOTATION_TEXT>
    </ANNOTATION>
    <ANNOTATION>
    etc. N-1 Times.
    </ANNOTATION>
    </ALL_ANNOTATIONS>
    Hope that helps.

  • Is it possible to create indexes & use them on xml docs with namespaces?

    I have put an XML doc in a BDBXML container which looks like this:
    *<ns1:note xmlns:ns1="http://www.testsch.org/ns">*
    *<ns1:to>Eric</ns1:to>*
    *<ns1:from>Brendan</ns1:from>*
    *<ns1:msg>How r u?</ns1:msg>*
    *</ns1:note>*
    Now, I am creating an index on the element "to", as:
    addIndex "ns1" "to" node-element-equality-string
    Though the index has been shown as getting created using the listIndexes command, if I lookup that index with the following command:
    lookupIndex node-element-equality-string "ns1" "to"
    the output is:
    *0 objects returned for eager index lookup 'node-element-equality-string'*
    Whereas, if I do the whole procedure without the namespaces in the document & the commands, the result is fine:
    *1 object returned for eager index lookup 'node-element-equality-string'*
    Can someone please tell me whether using namespaces, the indexes can be created or not? If yes, how?
    Thanks,
    Dev
    Edited by: user11871332 on Sep 7, 2009 3:53 PM

    Hi Dev,
    When using XML, the prefix for the namespace is really just syntactic sugar. The actual namespace in your example is "http://www.testsch.org/ns", and that's the value that you need to use when creating your index:
    addIndex "http://www.testsch.org/ns" "to" node-element-equality-stringJohn

Maybe you are looking for

  • Performance problems with iTunes 7.4.3.1 + Vista

    I've got a really annoying problem since "upgrading" my PC to Vista Ultimate (actually it was a clean install). Vista all working and performing fine. Download and install iTunes + import lib. When I went to use iTunes as soon as I open it it's alrea

  • 1.2.0 firmware

    ummm yea when will the new firmware come out would that be today being that the 3g iphone (which will have 1.2.0 right?) is out today (yay im getting one!)yea so ummm just wondering thanks

  • App updates that fail & won't go away

    Does anyone else have this problem? I have four app updates on iTunes (for Billy Frontier, da Blob, Jules Verne's Return to Mysterious Island, and Space Monkey) that fail each time they try to download, with an error message. But they stay in my down

  • How does Organizer differ from Bridge

    I used to use PSE6 until it got lost in a HD crash.  I just downloads PSE9 trial and see that it has something called Organizer rather than Bridge.  I've tried importing all of my photos into Organizer, but am unsure about what this is supposed to ac

  • MARS and Check Point Firewall Logging

    Hi, I have added my Check Point CMA object to MARS, but am not getting seeing any log information.  My CLM is a separate server (child enforcement module), which is discovered OK when the intial CMA discovery takes place in MARS.  I have configured t