[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re:   Tags in text content

Subject: Re:   Tags in text content
From: "rick@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 Apr 2024 00:21:00 -0000
Re:   Tags  in text content
Input:



<?xml version="1.0" encoding="UTF-8"?>

<root>

    <p>&lt;em&gt;Business day&lt;/em&gt; 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:  Tags in text content



Use the function parse-xml-fragment

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.