[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|