[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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

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
Keywords