given the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<report>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?><whatever><title>GREETING</title><greeting>Hi</greeting><name>Dave</name></whatever>]]>
</report>
</root>
How can I use XSL-T to take into account this "embedded" XML?
An example output I would want to get after XSL-Transformations is like this:
<?xml version="1.0" encoding="UTF-8"?>
<TransformedRoot>
<data><html><head><title>GREETING</title></head><body><p>Hi, Dave!</p></body></html>
</TransformedRoot>
Assuming this is the standard XSL-T I am using:
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="/root">
<TransformedRoot>
<data><!-- How do I get the elements here? --></data>
</TransformedRoot>
</xsl:template>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…