. xslt.
, , CDATA xml.
, xml :
<root>
<well-formed-content><![CDATA[ Some Text <p>more text and tags</p>]]>
</well-formed-content>
</root>
1. - xml
xml old_text:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no" version="1.0"
encoding="UTF-8" standalone="yes" />
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*|comment()|processing-instruction()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*|comment()|processing-instruction()">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="text()">
<xsl:element name="old_text">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
2.- xslt ( CDATA "old_text" )
xml, , ( , , ):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><root><old_text>
</old_text><well-formed-content><old_text> Some Text <p>more text and tags</p>
</old_text></well-formed-content><old_text>
</old_text></root>
3. - xml ( )
old_text , :
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no" version="1.0"
encoding="UTF-8" standalone="yes" />
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*|comment()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*|comment()">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="old_text">
<xsl:apply-templates select="*|text()" />
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." disable-output-escaping="no" />
</xsl:template>
</xsl:stylesheet>
4.- 2- xslt ( )
, , CDATA XML :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><root>
<well-formed-content> Some Text <p>more text and tags</p>
</well-formed-content>
</root>
. 5. xml
Caveat
CDATA html, xml ( ), xml. :
<root>
<well-formed-content>
<![CDATA[ Some Text <p>more text and tags</p>,
now with a non-breaking-space before the stop: .]]>
</well-formed-content>
</root>
. 6. xml . 1
xslt . 2 xml :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><root><old_text>
</old_text><well-formed-content><old_text>
Some Text <p>more text and tags</p>,
now with a non-breaking-space before the stop: .
</old_text></well-formed-content><old_text>
</old_text></root>
. 7. xml . 6 (!)
, , , XSLT-:
The entity "nbsp" was referenced, but not declared.
XML checking finished.
. 8. xml . 7
( match="/" ):
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no" version="1.0"
encoding="UTF-8" standalone="yes" />
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE root
[
<!ENTITY nbsp " ">
]>
]]>
</xsl:text>
<xsl:apply-templates select="*" />
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="*|text()|@*|comment()|processing-instruction()" />
</xsl:copy>
</xsl:template>
<xsl:template match="@*|comment()|processing-instruction()">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="text()">
<xsl:element name="old_text">
<xsl:value-of select="." disable-output-escaping="yes" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
9.- xslt
, xslt xml 6, xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE root
[
<!ENTITY nbsp " ">
]>
<root><old_text>
</old_text><well-formed-content><old_text>
Some Text <p>more text and tags</p>,
now with a non-breaking-space before the stop: .
</old_text></well-formed-content><old_text>
</old_text></root>
. 10. xml (xml . 3 )
xslt . 4, xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><root>
<well-formed-content>
Some Text <p>more text and tags</p>,
now with a non-breaking-space before the stop: .
</well-formed-content>
</root>
11. xml html entites, UTF-8
XSLT- NetBeans 7.1.2 (com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl - default JRE XSLT processor)
: XML. , ...