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

Re: How to I keep attributes names and values in a sor

Subject: Re: How to I keep attributes names and values in a sort?
From: "Mark Wilson" <mark@xxxxxxxxxxxx>
Date: Sun, 20 Jul 2008 09:17:31 -0700
Re:  How to I keep attributes names and values in a sor
Thank you. Sorry I repeated the post, but I did not receive Martin's earlier reply. Appreciate your comments.
REgards,
mark


--------------------------------------------------
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Sent: Sunday, July 20, 2008 9:13 AM
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re:  How to I keep attributes names and values in a sort?

On 7/20/08, Mark Wilson <mark@xxxxxxxxxxxx> wrote:
When I use
the styles sheet in listing 1, I get the concatenated value of the
attributes within the start tag, but not the attribute names as in  <Cat
135> instead of <Cat pofis="1" pofis-number="35">.

It's hard to believe that you can get an output like, <Cat 135> from the stylesheet. This is not a well-formed XML.

This syntax,

<xsl:template match="*">
  <xsl:copy>
     <!-- something here -->
  </xsl:copy>
</xsl:template>

would make a shallow copy of the contextual element (i.e., you don't
get the attributes copied, and the child contents).

To copy attributes as well, you need to do,

<xsl:template match="*">
  <xsl:copy>
     <xsl:apply-templates select="@*"/>
     <!-- something here -->
  </xsl:copy>
</xsl:template>

as Martin wrote in an earlier reply.


-- Regards, Mukul Gandhi

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.