|
Subject: Re: [xsl] Tags in text content From: "rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 11 Apr 2024 00:21:00 -0000 |
Input:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<p><em>Business day</em> means a calendar day.</p>
<p>No children.</p>
</root>
Stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
exclude-result-prefixes="xs math"
version="3.0" expand-text="yes">
<xsl:template match="/">
<root>
<xsl:apply-templates/>
</root>
</xsl:template>
<xsl:template match="p">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:sequence select="parse-xml-fragment(.)"/>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<p><em>Business day</em> means a calendar day.</p>
<p>No children.</p>
</root>
Thank you Martin.
From: Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, April 10, 2024 7:03 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Aw: [xsl] Tags in text content
Use the function parse-xml-fragment
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Tags in text content, rick@xxxxxxxxxxxxxx | Thread | Re: [xsl] Tags in text content, Norm Tovey-Walsh ndw |
| Re: [xsl] Tags in text content, rick@xxxxxxxxxxxxxx | Date | Re: [xsl] Tags in text content, Norm Tovey-Walsh ndw |
| Month |