This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: id function doesn't work in conjonction with a XML schema
- From: Trevor Nash <tcn at melvaig dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 25 Jan 2002 12:05:41 +0000
- Subject: Re: [xsl] id function doesn't work in conjonction with a XML schema
- Organization: Melvaig Software Engineering Limited
- References: <20020125111228.35769.qmail@web14907.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Giro,
>
>The id() function works only in conjonction with a
>DTD. Instead a DTD I have a XML schema. I tried with
>xalan and xt and the result is the same. It doesn't
>work. What's the problem?
>
You said it yourself: id() needs the information in the DTD to work
out which attributes to index on. In the absence of a DTD you can use
xsl:key and key() to do the same job.
If you do not like replicating information in the schema in a
hand-written xsl:key, then you could write a stylesheet which takes
the schema as input and produces a stylesheet containing just some
xsl:key definitions: import this into the main stylesheet. Maybe
someone has already done this?
Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email
Melvaig Software Engineering Limited
voice: +44 (0) 1445 771 271
email: tcn@melvaig.co.uk
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list