Connecting Tech Pros Worldwide Forums | Help | Site Map

Space problem with .NET 2.0

Gaurav
Guest
 
Posts: n/a
#1: Oct 21 '08
I am loading an XML file and applying the XSLT using .net 2003 (C#). XSLT
will add Space character in the xml. I am using the entity value for space
character &#32. it works fine in .net 1.1 whereas in .net 2.0 the space
character is not showing up in the xml at all. Any idea why this works in
..NET 1.1 and not the .NET 2.0 parser?

However, if I use the entity (&#160) then it works well for both .net 1.1
and .net 2.0. Is this a known issue? Any suggestions on why the space is not
showing up with .NET 2.0 would be appreciated.



Martin Honnen
Guest
 
Posts: n/a
#2: Oct 22 '08

re: Space problem with .NET 2.0


Gaurav wrote:
Quote:
I am loading an XML file and applying the XSLT using .net 2003 (C#). XSLT
will add Space character in the xml. I am using the entity value for space
character &#32. it works fine in .net 1.1 whereas in .net 2.0 the space
character is not showing up in the xml at all. Any idea why this works in
.NET 1.1 and not the .NET 2.0 parser?
>
However, if I use the entity (&#160) then it works well for both .net 1.1
and .net 2.0. Is this a known issue? Any suggestions on why the space is not
showing up with .NET 2.0 would be appreciated.
Can you show us the code i.e. a minimal but complete XML document, XSLT
stylesheet and the C# code that runs the transformation? Otherwise it is
very hard to tell what goes wrong.
As a first suggestion you might want to use
<xsl:text</xsl:text>
to output your space. That is the recommended way to avoid white space
isssues when outputting text with XSLT.



--

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