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

RE: Extracting an attribute value only

Subject: RE: Extracting an attribute value only
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 16 Jan 2006 13:19:21 -0000
xsl extracting attribute values
<xsl:template match="content">
  <page name="{@page}">
    <xsl:apply-templates/>
  </page>
</xsl:template>

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

> -----Original Message-----
> From: Sebastian Tennant [mailto:sebyte@xxxxxxxxxxxxxxx] 
> Sent: 16 January 2006 13:12
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Extracting an attribute value only
> 
> Hi all,
> 
> I have an XML doc that begins:
> 
>   <?xml version="1.0">
>   <?xml-stylesheet href="ss.xsl" type="text/xsl" ?>
>   <content page="welcome">
>   [...]
>   </content>
> 
> I'd like to create a new XML doc using XSLT that takes the value of
> the page attribute and assigns it to a new attribute in the document
> element of the result tree, like this:
> 
>   <?xml-version="1.0">
>   <page name="welcome">
>   [...]
>   </page>
> 
> I'm going round in circles!
> 
> TIA
> 
> sdt

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.