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

Re: Processing CDATA

Subject: Re: Processing CDATA
From: James Clark <jjc@xxxxxxxxxx>
Date: Sun, 24 Jan 1999 08:35:53 +0700
xsl process cdata
Probably the easiest way is to use a mode:

<xsl:template match="question">
  <tr><xsl:apply-templates/></tr>
  <tr><xsl:apply-templates select="textanswer" mode="answer"/></tr>
</xsl:template>

<xsl:template mode="answer" match="textanswer">
 <td><textarea name="test" ...></textarea></td>
</xsl:template>

<xsl:template match="textanswer"/><!-- ignore except in answer mode -->

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

Lars-Arne Mattsson wrote:
> 
> Hello!
> 
> How do I process character data containing some stylistic elements
> separate from other elements?
> 
> I want to do the following:
> XML:
> <question>
>    Tell me what you <italic>think</italic> of this program?
>    <textanswer/>
> </question>
> 
> HTML:
> <form ...>
> <table>
> ...
>   <tr>
>     <th>Tell me what you <i>think</i> of this program?</th>
>   </tr>
>   <tr>
>     <td><textarea name="test" ...></textarea>
>   </tr>
> ...
> </table>
> </form>
> 
> The problem is how I should extract the question text together with
> the the <italic> element and still be able to handle <textanswer>
> separately. <xsl:process-children/> won't work and I haven't succeded
> to create a <xsl:process select=""> that works.
> 
> I would really appreciate some help!
> 
> Greetings,
> /Larssa
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 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.