Hi, I want to get the blank spaces in my XSl's and i have declared it by using entitiy as below: <?xml version='1.0'?> <!DOCTYPE xsl:stylesheet [<!ENTITY nbsp " ">]> After declaring i have used it in my code like for example as <tr><td > </td></tr> So in the output iam getting the blank spaces but the problem is iam also getting some junk character as "�" this.Can anyone tell what is wrong and where am i suppposed to correct and would be very thankful is you would let me know the answer as soon as possible. Thanks, Rajitha.
Instead of hard-coding a whitespace character, I recommend that you use one of the xml/xsl vocabularies that deal with whitespace. Here are some options -
Use <xsl:text> in the stylesheet. The content of <xsl:text> elements is copied directly to the result tree; whitespace is preserved by default. <xsl:text>Literal result text that can have embeded spaces</xsl:text>
In the XML document, use <xml:space> attribute has the value preserve, it is preserved.
Control the default stripping rules with <xsl :preserve-space> and <xsl:strip-space> - ie., - [1] If a text node contains non-whitespace characters, it is preserved [2] If a text node occurs inside an element listed in <xsl :preserve-space>, it is preserved [3] If the nearest ancestor xml:space attribute has the value preserve, it is preserved [4] Otherwise it is stripped (discarded from the tree before any transformation begins)
Hope that helps! ------------------ Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform. IBM Certified Developer - XML and Related Technologies, V1. [This message has been edited by Ajith Kallambella (edited February 12, 2001).]
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
try using <xsl utput method="xml" indent="yes" encoding="UTF-8"/xsl...> this will indent u'r o/p and the encoding may be the problem of the junk characters. [This message has been edited by Ajith Kallambella (edited February 12, 2001).]