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

RE: Newbie Needs Help

Subject: RE: Newbie Needs Help
From: Jonathan Marsh <jmarsh@xxxxxxxxxxxxx>
Date: Thu, 17 Dec 1998 16:50:05 -0800
questioner templates
I believe that <xsl:apply-templates/> is implemented correctly.  By default
it selects all children, elements, text, even pis and comments.  A feature
that is not implemented in the beta 2 release is the built-in templates.
You must add these templates to the start of the stylesheet if you wish to
have this behavior.  The templates shown here are slightly different than
those described in the previous XSL WD, but accomplish similar
functionality.

Also note that the namespace URL in Guy's example previously was missing a
":", which is corrected below.  Otherwise this example only builds on his by
providing a more generic solution to built-in templates.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
     <!-- default templates -->
     <xsl:template><xsl:apply-templates/></xsl:template>
     <xsl:template match="textnode()"><xsl:value-of/></xsl:template>

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

     <xsl:template match= "greeting">
          <div style="color:red; font-size: 16pt">
               <xsl:apply-templates />
          </div>
     </xsl:template>
</xsl:stylesheet>

> -----Original Message-----
> From: Chris Maden [mailto:crism@xxxxxxxxxxx]
> Sent: Thursday, December 17, 1998 3:38 PM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: Re: Newbie Needs Help
> 
> 
> <xsl:apply-templates/> is not implemented correctly in MSIE 5b2.  It
> only applies templates to *element* children of the current node; it
> does not apply the default template to *character* children.  As a
> result, mixed content can not be processed.
> 
> In the original questioner's case, he should use <xsl:value-of
> select="."/>, which will return the character data of the current
> element.
> 
> Note that by this method you can get *either* the text *or* the
> element children, not both, making it impossible to do real documents
> with the current implementation.  I sincerely hope that MS will fix
> this severe bug in the next beta.
> 


 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.