File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes What is this XML information and how to get it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "What is this XML information and how to get it?" Watch "What is this XML information and how to get it?" New topic
Author

What is this XML information and how to get it?

steve garrison
Greenhorn

Joined: Sep 25, 2009
Posts: 1
I'm parsing an XML file with Java but there's something in the XML I can't figure out. Not sure if it's an "attribute" or data or an "element", etc. How would a person fetch the 16 digit id values that are listed - starts with "09"? This XML file is well-formed and valid and created by EMC Documentum system. Using DOM parser.

I can parse and display all other data except for the Attachment ones. I get a NULL value for Attachment, even though there is obviously data there. No errors are thrown. See code displayed below

XML file continued above...

<DropdownList1><![CDATA[value1]]></DropdownList1>
<DropdownList11><![CDATA[value1]]></DropdownList11>
<Attachment1 id_type="object_id"><![CDATA[0984598e800302d6]></Attachment1>
<Attachment1 id_type="object_id"><![CDATA[0984598e800302d9]]></Attachment1>
<Attachment1 id_type="object_id"><![CDATA[0984598e800302dc]]></Attachment1>
</CombinedForm2>


....snippet of Java class:
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
Isn't that Element child Node an instance of CDATASection?

seems to me that this test will always fail:


As an obvious XML question this should have been posted in the XML forum.

Bill

Java Resources at www.wbrogden.com
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

Yeah, it's just CDATA. I don't really want to read all that DOM-bashing code but if you realize that this:
<Attachment1 id_type="object_id"><![CDATA[0984598e800302dc]]></Attachment1>

is exactly the same as this:
<Attachment1 id_type="object_id">0984598e800302dc</Attachment1>

you should be okay. As long as you understand the DOM, that is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is this XML information and how to get it?
 
Similar Threads
Overwriting a specific XML section
Can anyone help?I still can't append records in xml...
Suppress text nodes in output when empty
Efficient XML Parsing
Where i'm wrong ?