I am using XLST files to transform XML to XML.
What are valid representation of space?
<xsl:text> </xsl:text>
<xsl:text> </xsl:text>
<xsl:text> </xsl:text>
I am using XLST files to transform XML to XML.
What are valid representation of space?
<xsl:text> </xsl:text>
<xsl:text> </xsl:text>
<xsl:text> </xsl:text>
XML does not have any named entities besides <
, >
, "
, '
and &
.
All other characters can be represented verbatim, given that you declared the right encoding in the XML declaration (e.g. <?xml version="1.0" encoding="..." ?>
). Declaring UTF-8 is optional, as this is the default anyway.
In other words: There is no need to specially escape any character anywhere unless leaving it unescaped would break XML syntax rules (like <
or &
would).
You are of course free to escape any character you want.
These representations are equivalent as far as the resulting document is concerned:
<foo>Test Test</foo>
<foo>Test Test</foo>
<foo>Test Test</foo>
<foo>Test Test</foo><!-- given that the " " really is char code 160 -->
Note that you can declare custom named entities (like nbsp
) using a DOCTYPE.
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
But given the fact that XML accepts any character that's hardly ever necessary. Especially not when you create the document using a proper tool, like a DOM API.
As it relates to the question, add all the entities that are causing parse errors to the DOCTYPE of your *.xls style sheet.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Now you can use
as you would normally.