xsl-list
[Top] [All Lists]

Re: list of actual attributes?

2005-04-08 03:10:29
David Carlisle wrote:

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?)

you get a potentially different result.

[thanks for the explanation, snipped]

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?

You don't. The attributes are added by the DTD by the XML parser before
XSLT starts and XSLT has no record of the difference. The whole point of
attribute defaults are to _save_ later applications having to special
case code for attributes being there or not being there, by normalising
things so they are always there. If the non-appearence of an attribute
has a significance then the DTD should mark it as #IMPLIED rather than
supplying a default, to allow an application such as XSLt to "imply"
some default behaviour.

OK, that makes sense.

I dont't know xalanc but in many systems it is possible to supply an
entity resolver or catalogue to customise how dtds and other files are
fetched, if that is possible here you could arrange things so an empty
dtd was supplied when the transform was made so teh dtd defaults did not
happen.

Yes, xalanc has the same feature - in fact I am already using a custom-written 
resolver, so I'll
try this out right away. 



/Per Jessen, Zürich

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>