[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] use of ID and IDREF pb
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|