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

use of ID and IDREF pb

Subject: use of ID and IDREF pb
From: Philippe Delrieu <phdelrie@xxxxxxxxx>
Date: Mon, 24 Jan 2000 17:30:55 +0100
michael delrieu
I use Java Xalan XSL parser.

I divide my XML document in two sections :
	- resource declaration
	- document description that use IDREF to reference resource.

In my output HTML page I want to replace the ResourceRef element with
the content of the Resource element. I use the id(@refid) function to
apply the Resource template, but it didn't work correctly. The Resource
template is not call.

Exemple of code.

My XML :
    <ListResources>
      <Resource mimetype="image/gif" type="image" id="R1">
        <URL type="relatif">img/TOTO.jpg</URL>
      </Resource>
    </ListResources>
  <Document>
    <Section name="alone">
      <ResourceRef name="TOTO" idref="R1"/>
    </Section>
  </Document>

My XSL :
<xsl:template match="Resource">
	<xsl:value-of select="URL"/>
</xsl:template>
<xsl:template match="ResourceRef" name="alone">
	<td nowrap="" width="9%" align="left">
			<img width="60" height="45">
			<xsl:attribute name="src">
				<xsl:apply-templates select="id(@idref)"/>
			</xsl:attribute>
		</img>
	</td>
</xsl:template>

The OUTPUT :
<img height="45" width="60" src="image">

My Question :
Why is it the type attribute that is replaced in the output and not the
execution of the Resource template ?
Could somebody help me ?

Thanks

Philippe Delrieu


 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.