[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML to HTML

Subject: Re: XML to HTML
From: Jörg Heinicke <Joerg.Heinicke@xxxxxx>
Date: Fri, 21 Sep 2001 21:57:29 +0200 (MEST)
Re:  XML to HTML
Hi Greg,

I hope you want to have something like the following:

<xsl:template match="instruction_content">
    <xsl:value-of
select="//media_item[@identifier=current()/media_ref/@media_alias]/access_name"/>
</xsl:template>

This gives back the string 'ad59010005.gif'. Change it to your requirements.

If you have a big file, this will take a lot of time. If all <media_item>s
are on the same level, you can change it to

<xsl:value-of select="/root/any_other_nodes/media_item[...]..."/>

Still better is using a DTD and set your identifier-attribute (or shorter
id) to ID:

<!ATTLIST media_item identifier ID #REQUIRED>

And using now the id()-function will speed up the transformation:

<xsl:value-of select="id(media_ref/@media_alias)/access_name"/>

Joerg

> I'm converting XML to HTML and 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
> Thanks
> Greg

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.