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.
instead of
<email></email> or <email/>

the .net objects seems to ignore  <xsl:strip-space elements="*" />.

Who is Participating?
In your XSLT, try to write the code that transforms for <email> in one line. That is for example:

<email><xsl:value-of select="."></email>

Have fun.
Apart from the fact that it is ignoring your strip-space directive you could possibly run a replace on "> </" with "></" it is definately a work around but the best I could think of short term.

kpejrAuthor Commented:
I tried the replace before, the problem is you would have to parse before you replaced or it replaces the cr after and end tag for a block as well as the ones you want to replace.

I just tried <email><xsl:value-of select="."></email> and it still adds the cr.

kpejrAuthor Commented:
Figured it out. You have to inherit the xmltextwriter and override WriteFullEndElement with this:

    Public Overrides Sub WriteFullEndElement()
    End Sub
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.