• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Suppress text nodes in output when empty

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello @all!
I try to output the nodes plus additional information of an xml-file.
Here is the code with wich I do it:

And that's part of the output I get:
infospace
NodeName: #text, NodeValue:
NodeName: subspace
NodeName: #text, NodeValue:
NodeName: EWGR
NodeName: #text, NodeValue:
NodeName: childNodes
NodeName: #text, NodeValue:
NodeName: childNode
NodeName: #text, NodeValue: C1
NodeName: #text, NodeValue:
NodeName: childNode
NodeName: #text, NodeValue: C2
NodeName: #text, NodeValue:
NodeName: childNode
NodeName: #text, NodeValue: C3
NodeName: #text, NodeValue:
NodeName: #text, NodeValue:
NodeName: #text, NodeValue:
NodeName: EWGR
NodeName: #text, NodeValue:
My question: How can I suppress the lines where the NodeName is #text and the NodeValue is empty?
First I tried this one:


Then I tried this one:

But nothing worked...
Can anybody help me with this problem, please?
Thanks a lot for your help in advance!
Ela
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about this:
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. It works like a charm
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic