Re: use of ID and IDREF pb

Subject: Re: use of ID and IDREF pb
From: Jeremy Quinn <jeremy@xxxxxxxxxxxxxxxxx>
Date: Tue, 25 Jan 2000 10:50:21 +0000
On 24/1/00 at 8:06 pm, owner-xsl-list-digest@xxxxxxxxxxxxxxxx (The XSL-List
Digest) wrote:

>Date: Mon, 24 Jan 2000 17:30:55 +0100
>From: Philippe Delrieu <phdelrie@xxxxxxxxx>
>Subject: use of ID and IDREF pb
>I use Java Xalan XSL parser.
>I divide my XML document in two sections :
>   - resource declaration
>   - document description that use IDREF to reference resource.
>In my output HTML page I want to replace the ResourceRef element with
>the content of the Resource element. I use the id(@refid) function to
>apply the Resource template, but it didn't work correctly. The Resource
>template is not call.

I believe that in order to get id() working, you have to declare your attributes
as being of type "ID" in the XML file's DTD.

Try putting something like this in your XML file: (this is from my DTD, it won't
work with yours, until you edit it ...)

 noise [ 
  <!ATTLIST noise id ID  #IMPLIED>
  <!ATTLIST text idref IDREF #IMPLIED>

This states that in the document whose root node is called "noise", the "noise"
element has an attribute called "id" which is of type "ID" and has it's value
implied. Also that there is an attribute of the element "text" called "idref"
whose type is "IDREF".

This worked for me.

regards Jeremy


   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@xxxxxxx>     		 <>
    <phone:+44.[0].207.737.6831>        <pager:jermq@xxxxxxxxxxxxxxx>

 XSL-List info and archive:

Current Thread