*
The moose likes XML and Related Technologies and the fly likes element name and cdata Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "element name and cdata" Watch "element name and cdata" New topic
Author

element name and cdata

James Howerton
Ranch Hand

Joined: Mar 14, 2009
Posts: 82
Could someone tell me what has to be changed to get the element name and text of my targetElement?

I just get

internal frame openFrameCount= 1
start obj() type= guide
cmaj
name: null value: null
name: null value: null
name: null value: null
cmaj
name: null value: null
name: null value: null
name: null value: null

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Since you dont show the actual XML I can only guess that the Element has multiple Text nodes created by formatting.

Careful study of the marvelous table in the org.w3c.dom.Node JavaDocs is recommended.

Bill
Also please use code formatting as much as possible.
James Howerton
Ranch Hand

Joined: Mar 14, 2009
Posts: 82
Well I got the siblings I need but need a good method to produce the text node. Is there a standard method for this?

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Well, again, we don't see any XML to base an answer on. And your code is not particularly readable -- it would help if you posted it inside the Code tags, so it came out formatted.

But I'm going to assume that this "text node" you're referring to is probably the child node of the element you found. If indeed you did find an element.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: element name and cdata
 
Similar Threads
java.lang.string
attributes
list children of element (jdom)
xml tags writing
Print out values of xml tags