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

Re: Processing CDATA

Subject: Re: Processing CDATA
From: "Kent Fitch" <kent.fitch@xxxxxxxxxxxx>
Date: Sun, 24 Jan 1999 14:47:52 +1100
template match cdata
From: Lars-Arne Mattsson <larssa@xxxxxxxxxx>
Sent: Sunday, January 24, 1999 3:19 AM
Subject: Processing CDATA


>How do I process character data containing some stylistic elements
>separate from other elements?
>....

I think this is an interesting question, and Im not sure how best
to do it, at least with the IE5 beta XSL Im using.  "or" 
conditions dont seem to work in the "match"  However, I
think this xsl prodcues what you want (with IE5 at least), although
it seems klutzy:  (Assumes your xml is wrapped in a 'document'
element)

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template><xsl:value-of /></xsl:template>

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

<xsl:template match="document">
  <HTML>
    <HEAD>
           <TITLE>
        	test
        </TITLE>
    </HEAD>
      <BODY>
           <FORM>
            <TABLE>
        	 <xsl:apply-templates match="question" />
            </TABLE>
       </FORM>  
      </BODY>
 </HTML>
</xsl:template>

<xsl:template match="question">
  <TR>
       <TH>
               <xsl:for-each> 	
         	  <xsl:if match=".[nodeType()=3]">
        	    <xsl:apply-templates match="."/>	
        	  </xsl:if>	
        	  <xsl:if match=".[italic]">
                    <xsl:apply-templates match="."/>	
        	  </xsl:if>
        	  <xsl:if match=".[textNode()]">
        	    <xsl:apply-templates match="."/>	
        	  </xsl:if>	 
            </xsl:for-each>
       </TH>

       <xsl:apply-templates match="textanswer" />

  </TR>  
</xsl:template>

<xsl:template match="textanswer">
  <TR>
       <TD><TEXTAREA NAME="test">...</TEXTAREA></TD>
  </TR>
</xsl:template>

<xsl:template match="italic">
  <I>
       <xsl:apply-templates />
  </I>
</xsl:template>

</xsl:stylesheet>

Kent Fitch                           Ph: +61 2 6276 6711
ITS  CSIRO  Canberra  Australia      kent.fitch@xxxxxxxxxxxx





 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.