Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

element name and cdata

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I got the siblings I need but need a good method to produce the text node. Is there a standard method for this?

 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!