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.

2
Contributors
1
Reply
3
Views
8 Years
Discussion Span
Last Post by MattEvans
0

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:

<desc>
<xs:comment>parser bug fix</xs:comment>
... other potential content...
</desc>

which will expand to the following on the occasion that desc is otherwise empty.

<desc>
<!--parser bux fix-->
</desc>

Your substandard parser does support comments, right?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.