Subject: Re: [xsl] Question about keys and cross-referencing (was predicate) From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Mon, 05 May 2003 16:28:00 -0400 |
So I've got an input structure like this:
<e eid="e0001"><hg><hw>keyword</hw></hg><se1>...</se1></e>
...
<e eid="e1234"><hg><hw>different_keyword</hw></hg><se1>... <xg>See also <xr>keyword</xr></xg>...</se1></e>
where the <xr> element "keyword" needs to link to the <e> element where the <hw> is "keyword".
I'm thinking that I can set up a key like
<xsl:key name="headwords" match="hw" use="ancestor::e/@eid" />
and then reference it in my xr template like
<xsl:attribute name="href"><xsl:text>#</xsl:text><xsl:apply-templates select="key('headwords',ancestor::e/@eid)" /></xsl:attribute>
Does that sound right?
Sometimes I've got several headwords that are identical except for the homograph numbers, like so:
<e eid="e0003"><hg><hw>keyword</hw><hom>1</hom></hg><se1>...</se1></e> <e eid="e0004"><hg><hw>keyword</hw><hom>2</hom></hg><se1>...</se1></e> <e eid="e0005"><hg><hw>keyword</hw><hom>3</hom></hg><se1>...</se1></e>
and these are referenced like so:
<e eid="e2345"><hg><hw>different_keyword</hw></hg>... <xg>See also <xr>keyword</xr><hom>1</hom></xg>...</e>
Is there a way to include those homograph numbers in the key and in the cross-reference so that I get the
correct (I hope unique) link?
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Question about keys and c, Chris Loschen | Thread | Re: [xsl] Question about keys and c, Chris Loschen |
Re: [xsl] Question about keys and c, Chris Loschen | Date | RE: [xsl] MSDN's XSL->XSLT is no lo, Dustin, Dave |
Month |