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

Re: Disable Output Escaping - really useful

Subject: Re: Disable Output Escaping - really useful
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 27 Mar 2000 16:44:49 GMT
disable output escaping w3c

   Which I naturally want to turn into something like this:

   <p>
   Some <font color="green">green</font> text.
   </p>




<para>
Some <?Pub _font FontColor="green"?>green<?Pub /_font?> text.
</para>


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"
                >

<xsl:template match="para">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>

<xsl:template 
  match="para/text()
    [count(following-sibling::processing-instruction()) mod 2 = 1]"/>

<xsl:template   match="text()" mode="yes">
 <xsl:value-of select="."/>
</xsl:template>


<xsl:template match="processing-instruction('Pub')">
   <xsl:variable name="x" select="count(following-sibling::processing-instruction())"/>
  <xsl:if test="$x mod 2 = 1">
  <font color="{substring-before(substring-after(.,'FontColor=&quot;'),'&quot;')}">
   <xsl:apply-templates select="following-sibling::node()[
           count(following-sibling::processing-instruction())=$x]" mode="yes"/>
  </font>
  </xsl:if>
</xsl:template>



</xsl:stylesheet>

xt norm1.xml norm1.xsl
<?xml version="1.0" encoding="utf-8"?>
<p>
Some <font color="green">green</font> text.
</p>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.