[thelist] XSLT Attributes and Variable name

seb potter seb at members.evolt.org
Thu Jan 16 02:58:01 CST 2003


Hi Dave, thanks for answering.

Here's the XML that I've got. I have no control over this bit:

<document>
	<paragraph>here is a link to a website - <reference
refname="website">Some text</reference>, and there's some more text
here.</paragraph>
	<target id="website" name="website" refuri="http://www.somesite.com" />
	<paragraph>here is a link to another website - <reference
refname="anotherlink">Some different text</reference>, and some more
junk text here.</paragraph>
	<target id="anothersite" name="anothersite"
refuri="http://www.mysite.com" />
</document>

And here's what I want out of it:

<div>
	<p>here is a link to a website - <a href="http://www.somesite.com>Some
text</a>, and there's some more text here.</p>
	<p>here is a link to another website - <a
href="http://www.mysite.com>Some text</a>, and some more junk text
here.</p>
</div>


My problem is retrieving the refuri attribute of the target element
which has an id corresponding to the refname attribute of the reference
element. It should be pointed out that this is a snippet of a larger
DOM, and whilst the target element will always be a child of the
document element, the corresponding reference element can appear
absolutely anywhere.

I'm sure that this should be incredibly simple, but for the life of me I
can't find any information anywhere on how to achieve this.

Thanks in advance for any help you can give.

-seb

--
seb potter - seb at poked.org
http://poked.org - It's what you value.



More information about the thelist mailing list