> When I create a XmlText node containing the new line hex character "
> " it is
[quoted text clipped - 4 lines]
>
> Fabian


///Peter

Signature
XML FAQ: http://xml.silmaril.ie/
Fabian - 21 Feb 2008 07:43 GMT
Hi Peter,
"
" results in "
". So this can't be the solution. Do you
perhaps have a different idea?
Thx,
Fabian
> When I create a XmlText node containing the new line hex character "
> " it is
> masked to "
" when I save the document object to a file. I guess this is
> due to the fact that the "&" character is reserved. How can I write a "
"?
Sorry, it is not clear what the problem is.
You say the new line character is masked as "
", then you ask 'how
can I write a "
"'.
If you already have "
", why do you ask how to write it?
It might be that you have typed something different into the web
interface but the above is what we see here in the newsgroup.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Fabian - 22 Feb 2008 07:48 GMT
Hi Martin,
>It might be that you have typed something different into the web
> interface but the above is what we see here in the newsgroup.
You're right, the web interface also masks the ampersand. So basically the
problem is that I want to put write a \t and a \r\n into a
<xsl:text></xsl:text> node. The XmlDocument class' write method just inserts
a tab or line feed into the xml (resp. xsl) file which in the end produces
the right result in the xsl transform but doesn't make the xsl file look as I
want it to look like. This also happens if I insert the hex character "\xa"
instead of the \n. So I would like to have the newline written explicitely as
it's masked equivalent instead of having a newline in the xls file's text.
Thanks,
Fabian
Martin Honnen - 22 Feb 2008 15:13 GMT
> You're right, the web interface also masks the ampersand. So basically the
> problem is that I want to put write a \t and a \r\n into a
[quoted text clipped - 4 lines]
> instead of the \n. So I would like to have the newline written explicitely as
> it's masked equivalent instead of having a newline in the xls file's text.
With .NET 2.0 and XmlWriterSettings with NewLineHandling =
NewLineHandling.Entitize you can have \r entitized as &#D; (& # D; for
the web interface) but it does not do the same for \n or \t. If you want
to achieve that for those characters too then I think you have to
implement your own XmlWriter that does the encoding as needed. You can
then pass such an XmlWriter to the Save method of your XmlDocument instance.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/