whitespace isssue in XML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • banagani
    New Member
    • Oct 2007
    • 7

    whitespace isssue in XML

    Hi,

    I am facing one problem in XML. I am loading the XML file and apply 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. I have no idea why is it working in .net 1.1 and not in .net 2.0?

    If I use the entity (&#160) then it works well for both .net 1.1 and .net 2.0. So the issue is that the XML parser is not recognizing the space character (&#32) in .net 2.0. So is there any way i can resolve this issue? If anyone knows how to handle the space character in XML, please guide me on this.

    Regards,
    Vinod
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    Originally posted by banagani
    So the issue is that the XML parser is not recognizing the space character (&#32) in .net 2.0. So is there any way i can resolve this issue? If anyone knows how to handle the space character in XML, please guide me on this.
    This looks more like a problem the parser has. I'm not sure you can solve this by xml.

    are those whitespaces important? if so, you might try (the already mentioned) &#160 or CDATA output (cdata-section-elements (attribute of xsl:stylesheet) ) maybe even surrounding whitespace by <xsl:text> might help.

    regards

    Comment

    • banagani
      New Member
      • Oct 2007
      • 7

      #3
      Thanks Dormilich for your inputs..

      I have used <CDATA[&#32;]> to get the space character.

      Regards
      Vinod

      Comment

      Working...