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

Re: XSL Limitation? Is this possible?

Subject: Re: XSL Limitation? Is this possible?
From: Rick Geimer <rick.geimer@xxxxxxx>
Date: Fri, 14 May 1999 10:54:51 -0700
xsl template match limitations
I believe the following would work for you in IE5, though the latest XSL
standard specifies some changes.

<xsl:template xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns:qxsl="quote:http://www.w3.org/TR/WD-xsl">
 <HTML>
  <BODY>
   <xsl:apply-templates select="/*"/>
  </BODY>
 </HTML>

 <xsl:define-template-set>

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

  <xsl:template match="SENTENCE">
   <xsl:apply-templates select="node()">
    <xsl:template match="text()"><xsl:value-of/></xsl:template>
   </xsl:apply-templates>
  </xsl:template>

  <xsl:template match="SUBJECT">
   <B>
   <xsl:apply-templates select="node()">
    <xsl:template match="text()"><xsl:value-of/></xsl:template>
   </xsl:apply-templates>
   </B>
  </xsl:template>

  <xsl:template match="VERB">
   <B>
   <xsl:apply-templates select="node()">
    <xsl:template match="text()"><xsl:value-of/></xsl:template>
   </xsl:apply-templates>
   </B>
  </xsl:template>

 </xsl:define-template-set>

</xsl:template>


Hope this helps.

Rick Geimer
National Semiconductor
rick.geimer@xxxxxxx

Nicolas Pottier wrote:

> Hello everybody..
>
> I'm currently learning XSL, mostly using IE5 as my current platform, and
> have run into the following problem, which I have yet to figure out.
>
> Let's take this data.
>
> <PARAGRAPH>
> <SENTENCE>Grumpy <SUBJECT>Jack</SUBJECT> <VERB>went</VERB> up the
> hill.</SENTENCE>
> </PARAGRAPH>
>
> Is it possible to use XSL to convert that data into the following?
>
> <HTML>
> <BODY>
> Grumpy <B>Jack</B> <B>went</B> up the hill.
> </BODY>
> </HTML>
>
> As far as I've figured out, it doesn't seem possible, the main problem
> being that text is being mixed with other elements, and I'm unable to
> separate them out when parsing it.
>
> We've been racking our brain on this one for a little while and can't
> seem to figure it out.
>
> Anybody have any ideas?  This is something that is so simple in CSS, but
> seems impossible in XSL.
>
> Thanks,
>
> -Nic
>
> PS. I apologize if this has been covered before, I tried looking through
> the archives but couldn't find anything relevant. (though I did find
> some useful examples out there)
>
>  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.