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

RE: xsl:attributes as parameter to a template

Subject: RE: xsl:attributes as parameter to a template
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 3 May 2005 10:47:43 +0100
xsl attributes
An xsl:with-param element with content defines a document node, the root of
a result tree fragment. It's a recoverable error to create an attribute node
as a child of a document root node; the processor can either report the
error, or ignore the attribute. It seems that your processor has chosen the
latter.

Even if it were possible to create a free-standing attribute node in XSLT
1.0 (it's allowed in 2.0), xsl:value-of would copy the string-value of the
attribute as a new text node; it you wanted to copy the attribute to the new
element, you would need to use xsl:copy-of.

Michael Kay
http://www.saxonica.com/ 


> -----Original Message-----
> From: Jan Tietjens [mailto:jan.tietjens@xxxxxxxxxxxxxx] 
> Sent: 03 May 2005 10:37
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl:attributes as parameter to a template
> 
> Hello,
> I am not understanding why the following xslt snipped 
> produces an empty 
> 'someElement' element (XSLT 1.0):
> 
>     <xsl:template match="/">
>         <xsl:call-template name="printSomeAttributes">
>             <xsl:with-param name="attributes">
>                 <xsl:attribute name="juhu">Hello 
> World!</xsl:attribute>
>             </xsl:with-param>
>         </xsl:call-template>
>     </xsl:template>
>    
>     <xsl:template name="printSomeAttributes">
>         <xsl:param name="attributes"/>
>         <xsl:element name="someElement">
>             <xsl:value-of select="$attributes"/>
>         </xsl:element>
>     </xsl:template>
> 
> Thank you for your answer(s).
> 
> Best regards,
> 
> -- 
> Jan Tietjens
> 
> Gentleware AG
> www.gentleware.com
> 
> Free evaluation of UML tools
> 
> Looking for a convenient entry into the unified modeling language?
> Check out what the modeling tool Poseidon for UML can do for you
> by evaluating the edition of your choice.
> http://www.gentleware.com?redirect=evaluate

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.