kpejr
asked on
Get a carriage return in empty elements .net xmltransform
Is there any way around this short of telling the xmlwriter not to indent?
I have a process that send an xml doc to a cust who changes some data and
returns it. It gets rejected on the resubmit because of the problem below.
I have an xslt trans. I am transforming it with the .net transformation
object when it hits an empty element it reurns something like this.
<email>
</email>
instead of
<email></email> or <email/>
the .net objects seems to ignore <xsl:strip-space elements="*" />.
I have a process that send an xml doc to a cust who changes some data and
returns it. It gets rejected on the resubmit because of the problem below.
I have an xslt trans. I am transforming it with the .net transformation
object when it hits an empty element it reurns something like this.
<email>
</email>
instead of
<email></email> or <email/>
the .net objects seems to ignore <xsl:strip-space elements="*" />.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it out. You have to inherit the xmltextwriter and override WriteFullEndElement with this:
Public Overrides Sub WriteFullEndElement()
MyBase.WriteEndElement()
End Sub
Public Overrides Sub WriteFullEndElement()
MyBase.WriteEndElement()
End Sub
ASKER
I just tried <email><xsl:value-of select="."></email> and it still adds the cr.