avoid self closing tag in the xml file

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 1
Reputation: vinodcprm is an unknown quantity at this point 
Solved Threads: 0
vinodcprm vinodcprm is offline Offline
Newbie Poster

avoid self closing tag in the xml file

 
0
  #1
Jul 29th, 2008
Hi good morning!

I have developed XSLT for transforming xml into xml.

Ex :
input xml

<item>
<name>sample1<name>
<desc></desc>
</item>

output xml

<item>
<name>sample1<name>
<desc/>
</item>

In the transformed xml file I am getting self closing tag for the empty data element.

But for us our parser does not support self closing tag. I want the trans formed file
output with out self closing tag.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: avoid self closing tag in the xml file

 
0
  #2
Aug 14th, 2008
Thats a severe problem with the parser, so ideally, fix the parser. Is it an inhouse solution? If so, use a base framework like SAX2/DOM rather than manually writing the parser component. Will save on alot of potential headaches.

If you absolutely must use this parser without fixing it, do the following in elements that may be empty:
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <desc>
  2. <xs:comment>parser bug fix</xs:comment>
  3. ... other potential content...
  4. </desc>
which will expand to the following on the occasion that desc is otherwise empty.
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <desc>
  2. <!--parser bux fix-->
  3. </desc>
Your substandard parser does support comments, right?
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC