[Home] [By Thread] [By Date] [Recent Entries]
Michael Kay wrote:
Of course, it can be valid content, in which case the XML documents should be opened as XML 1.1 documents. Aha, I forgot about that... This explains why the file *can* be read with unparsed-text *and* the 1.1 option set, and *cannot* be read as XML input document. This also means that, if you have no control on the input and these characters are not escaped as num char ref, then one could write a filter app in XSLT like this: <xsl:output method="text" use-character-maps="char-to-ent" /> <xsl:character-map name="char-to-ent"> <xsl:output-character character="" string="&#x16;"/> <xsl:output-character character="" string="&#x17;"/> <xsl:output-character character="" string="&#x18;"/> <xsl:output-character character="" string="&#x19;"/> </xsl:character-map> <xsl:template match="/" name="main">
<xsl:value-of select="unparsed-text('make-control-chars.xml')" />
</xsl:template>But, of course, like Andrew pointed out, this is not the best way to go (though it is not uncommon in large systems to have data filtered before it reaches your application, and XLST can do quite a good job there). -- Abel
|

Cart



