Including "<" Characters in XML Input Text Nodes for XSLT Conversion

I am using XSLT to convert an XML document to text. The text nodes of the XML document have <characters in them, which, of course, bombes the transformation. In any case, for the XSLT transform to work with <character in text node? In this case, all such characters are followed by spaces.

+3
source share
6 answers

Use objects instead of a symbol

<myTextTag> 1 &lt; 2, and 4 &gt; 2. This is how numbers work</myTextTag>

And your API should be able to convert them when converting / outputting

+1
source

XML < & lt; > & gt; API XML < > .

0

XML, & lt; . , xml-. :

XML , , . , XML , , .

XSLT, , , XML, .

0

, , IIRC, - <xsl:text disable-ouput-escaping="yes">...</xsl:text> - , "", ... , &lt; ?

0

, . , < > , .

, . , , , , CDATA. , , .

I don’t think you can get XSLT to work with poorly formed XML.

0
source

If your XML file has a literal <character in the current text, then you do not have an XML file. You have something that is almost an XML file. Either fix the process that creates the file, or pre-process it to fix it.

0
source

Source: https://habr.com/ru/post/1709801/


All Articles