This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL attribute?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] XSL attribute?
- From: Peter Flynn <peter at silmaril dot ie>
- Date: Fri, 02 Nov 2001 20:35:37 +0000
- CC: GF109112 at aol dot com
- Organization: Silmaril Consultants
- References: <a1.1d890f53.2912e806@aol.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
GF109112@aol.com wrote:
> I need help pulling a file name from an element name through an
attribute. My media is listed under a media items section and then
referenced in the text by an attribute. Is there any way of referencing
an element from an attribute?
>
> My XML example
>
>
> Media Section:
> <media_item identifier="medad59010005" category_type_code="3"
file_type_code="gif">
> <media_name>Figure 2-1. </media_name>
> <access_name>ad59010005.gif</access_name>
> </media_item>
>
> Text section
>
> <instruction_content>
> <media_ref media_alias="medad59010005"/>
> </instruction_content>
>
> I need the <access_name> in place of the <media_ref> tag
Assuming the DTD declares identifier as type ID and media_alias as
type IDREF, then try
<xsl:template match="instruction_content">
<xsl:value-of select="ID(@media_alias)/access_name">
</xsl:template>
///Peter
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list