RE: [xsl] How can i convert the variable value into xpath

Subject: RE: [xsl] How can i convert the variable value into xpath
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Sat, 9 Mar 2002 20:54:36 -0800 (PST)
Dear friends,
I wonder if I am trying to do the same thing. What has come to my
mind as a possibility is:

<xsl:variable name="try-this" select="${@LINK}"/>
<xsl:copy-of select="$try-this"/>
or
<xsl:copy-of select="${@LINK}"/>

The nodes all have the same name element, but the attribute value is
different. That same value matches the variable names of an
xsl:include document. The end result is the node that is called by
the template is matched to an array. When the array match is found,
then the value of the attribute of that node in the array is then
taken for the variable name. This attribute value which is now a
variable is then called up to replace the node called by the
template.

<my:array LINK="n3">see also  Shall we dance in the King and I *root*
RODGERS1</my:array>
<my:array LINK="n4">see  Climb every mountain in the Sound of Musis
*root* RODGERS2</my:array>

<xsl:variable name="n3">see <EMPH RENDER="quoted">Climb every
mountain</EMPH> in SHOW MUSIC : Manuscripts</xsl:variable>
<xsl:variable name="n3">see also  <EMPH RENDER="quoted">Shall we
dance</EMPH> in the King and I in SHOW MUSIC : Full
scores</xsl:variable>

The result is that I can have many cross-reference nodes in my
document, but a prepared list of i) exact unique occurances in my
array and ii) a list of pre-formatted replacements. At the same time
I can create the ref numbers for each cross-ref in the document.

Of course saxon rejects my syntax, but how would I write it if I were
to do this? I will definitely check out the extension function
Michael mentioned in the mean time.

Needing a little help,
Mike F.

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

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


Current Thread