| | |
avoid self closing tag in the xml file
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2008
Posts: 1
Reputation:
Solved Threads: 0
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.
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.
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:
which will expand to the following on the occasion that desc is otherwise empty.
Your substandard parser does support comments, right?
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)
<desc> <xs:comment>parser bug fix</xs:comment> ... other potential content... </desc>
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<desc> <!--parser bux fix--> </desc>
Plato forgot the nullahedron..
![]() |
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Copy Display name of a drop down box
- Next Thread: XPath, can't get element info
| Thread Tools | Search this Thread |
api blogger blogging code delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt






