• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Empty Tags in Java DOM API

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is there any method in Java DOM API to handle empty tags? E.g. consider the following XML file.
<?xml version="1.0"?>
<MESSAGE>
<RATES>
</RATES>
</MESSAGE>
here the output, using Java and DOM, is
parent tag is MESSAGE
root is MESSAGE
root is RATES
Value in root is null
Now, consider the following XML file:
<?xml version="1.0"?>
<MESSAGE>
<RATES></RATES>
</MESSAGE>
here the output, using Java and DOM, is
parent tag is MESSAGE
root is MESSAGE
root is RATES.
So, how do we know that there is an empty tag in the XML file?
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic