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
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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: 12271
    
    1
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Query about jDOM.
 
Similar Threads
XML traversing problem
xml:lang and XML Schema
Add elements to already created XML
Read data to the xml file from the database?
Trouble with Embedded HTML during XSLT Transformation using JDOM