[thelist] XSLT question

Eric Cestari eric at ohmforce.com
Tue Aug 14 07:18:18 CDT 2001


Hi evolters,

I am currently writing an XSLT to create an admin interface for content 
editing.
But I am stuck in something I really can't get :
I want the value of an attribute from the parent of an element.
i.e. example XML file :
<page no="1" titre="Un titre de page">
    <texte id_pos="39">test de breve</texte>
    <texte id_pos="40">retest</texte>
</page>

While rendering a 'texte' element I'd like to have access to the value 
of the 'no' attribute of the parent page ('1' in this case).

I've tried (for the sake of the example):
<xsl:template match="texte">
	No Page : <xsl:value-of select="string(parent::attribute/@no)"/>
</xsl:template>
But it doesn't work. Am I missing something ?

Best regards,
	Eric





More information about the thelist mailing list