[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: XSL Limitation? Is this possible?


Subject: RE: XSL Limitation? Is this possible?
From: Pete Beazley <pete@xxxxxxxxxxxxxxxxx>
Date: Fri, 14 May 1999 13:54:20 -0400

Perhaps this does what you are looking for? I've tested this in IE 5 but not elsewhere.

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

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

  <xsl:template match="SENTENCE">
    <html>
      <head>
        <title>Grumpy Jack</title>
      </head>
      <body>
        <xsl:apply-templates />
      </body>
    </html>
  </xsl:template>

  <xsl:template match="text()">
    <xsl:value-of />
  </xsl:template>

  <xsl:template match="SUBJECT">
    <b><xsl:value-of /></b>
  </xsl:template>

  <xsl:template match="VERB">
    <b><xsl:value-of /></b>
  </xsl:template>

</xsl:stylesheet>

--------
Pete Beazley - mailto:pete@xxxxxxxxxxxxxxxxx
ClearlyOnline, Inc. - XML & Web services - http://www.clearlyonline.com
1-724-942-1912    1-724-941-3698 fax


On Friday, May 14, 1999 12:02 PM, Nicolas Pottier [SMTP:nic@xxxxxxxxxx] 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
Keywords