[xsl] Name authority and ID/IDREF

Subject: [xsl] Name authority and ID/IDREF
From: Eric <kiteeatingtree@xxxxxxxxxxxxx>
Date: Mon, 28 Sep 2009 22:02:16 -0600
Dear All,

I am trying to use ID/IDREF to create what amounts to a name authority file within my XML. The goal is to allow one section of the XML to contain commonly used data (such as names of people), and allow the other sections to access that information, and the information contained within, via the ID ref. I'm including an example of what I'm trying to do after my signature.

I'm using XSLT 1.0, though a 2.0 solution would be welcome as well. Apologies: I am definitely a novice, so this may be really simple. I spent a fair amount of time attempting to find discussion of this on the archives of the list, but never really knew what terms would make a good search string, and so could easily have missed the discussion, if it exists. Thanks in advance for any help!

Cheers,
Eric

****

Sample XML:

    <foo ID="ack">
        <testa>blah</testa>
        <testb>blah2</testb>
    </foo>
    <foo ID="grr">
        <testa>argh</testa>
        <testb>argh2</testb>
    </foo>

    <bar zok="ack" name=>
        <testc>blah3</testc>
        <testd>blah4</testd>
    </bar>


The DTD


<!ELEMENT test (foo*, bar*) >
<!ELEMENT foo (testa, testb) >
<!ATTLIST foo
    ID    ID    #REQUIRED>

<!ELEMENT bar (testc, testd) >
<!ATTLIST bar
    zok    IDREFS         #REQUIRED>


Desired output from <xsl:template match="bar">:


blah
blah2
blah3
blah4

Current Thread