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

RE: Copying ALL attributes using Xalan C++

Subject: RE: Copying ALL attributes using Xalan C++
From: zuzmi@xxxxxxxxxxx (Z. Uzmi)
Date: Tue, 30 May 2000 15:54:03 -0700
copy all attributes in xslt
Ok. So here is one solution that I found after "some" iterations :-)

	<xsl:template match="img">
	<xsl:copy>
	<xsl:for-each select="@*">
	<xsl:attribute name="{name()}"><xsl:value-of select="."></xsl:attribute>
	<!--xsl:attribute name="{.}" ALSO WORKS-->
	</xsl:for-each>
	</xsl:copy>
	</xsl:template>

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Z. Uzmi
> Sent: Tuesday, May 30, 2000 2:27 PM
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: RE: Copying ALL attributes using Xalan C++
>
>
> It works, but it copies ALL the subnodes of the matched tag including
> attributes. This is "okay" for the img tag but for my purposes it is NOT
> desirable for several other tags. A way of copying only the attributes and
> nothing else down the tree would be very nice. Any suggestions?
>
> Thanks,
> Zartash
>
> > > Input XML has: <img src="someSource" alt="someAlt"/>
> > > Desired output should be exactly the same...
> >
> > Did you try the following? I don't have Xalan to test with but
> it works in
> > XT:
> >
> > <xsl:template match="img">
> > <xsl:copy-of select="."/>
> > </xsl:template>
> >
> > Linda van den Brink
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.