aspose file tools*
The moose likes XML and Related Technologies and the fly likes Query about jDOM. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Query about jDOM." Watch "Query about jDOM." New topic
Author

Query about jDOM.

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
I am using jDOM to generate XML file. I have <TEXT> element in XMl file. Now when I don�t have any value for <TEXT>, the generated element contains <TEXT />. But instead of that I required <TEXT></TEXT>. How to achieve this?


My blood is tested +ve for Java.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12681
    
    5
the generated element contains <TEXT />. But instead of that I required <TEXT></TEXT>.


Either form is good legal XML for an empty element and will be handled propertly by XML parsers.

Why are you so sure that you require the second form?

Bill


Java Resources at www.wbrogden.com
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
My problem is that the program that generate is using parser, but program that read xml does not use the parser - it's other party who is reading it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query about jDOM.
 
Similar Threads
Add elements to already created XML
XML traversing problem
xml:lang and XML Schema
Read data to the xml file from the database?
Trouble with Embedded HTML during XSLT Transformation using JDOM