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

list of actual attributes?

Subject: list of actual attributes?
From: Per Jessen <per@xxxxxxxxxxxx>
Date: Fri, 08 Apr 2005 11:44:58 +0200
xsl list attributes
I'm trying to process some XML and essentially create a copy of my input-file, with
the exception of changing/replacing a few elements and a few attributes. 

I use separate templates for those elements and attributes I need to change and for
the rest I use the following:

<xsl:template match="*">
        <xsl:element name="{name()}">
        <xsl:for-each select="@*">
        <xsl:attribute name="{name()}">
        <xsl:apply-templates select="."/>
        </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
        </xsl:element>
</xsl:template>

I could have used <xsl:copy> instead of <xsl:element name="{name()}">, but I don't see what I'd
gain.  (perhaps someone can explain?) 
Also, AFAICT, using <xsl:copy-of> would not work when I need to apply separate templates to
individual children?

Anyway, the problem I'm experiencing is - the list of attributes that I get using '@*' seems to
also include the attributes with default values from the DTD.  How do I get the list of
actual attributes as used in the source document?

I'm using xalanc 1.8 if that's important.


/Per Jessen, Z|rich

-- 
http://www.spamchek.co.uk/freetrial - anti-spam and anti-virus services in 30 minutes.

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.