This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems to interpret an attribute value as an Xpath expression


"Roman Huditsch" <roman.huditsch@hico.com> wrote:
> I'd like to use the value of a ref attribute as an
> XPath expression in my stylesheet.
...
> I used a "normal" <xsl:value-of select="@ref"/> ,but
> the processor didn't interpret it as an XPath expression
> but as a string.

Well, the processor evaulates the expression "@ref" and
gets for example the string "/applicationform/applicant[1]/name"
as a result. It won't evaulate this string again just because
it looks like a XPath expression. After all, if the value of
the attribute were "foo", you didn't expect the processor to
do so, did you?

> Does anyone know a method to tell the processor to use a
> source document's attribute value as an XPath expression
> in the stylesheet?

There is no standardized way to do it. Most processors
have extension functions like saxon:evaluate() for this
purpose, look it up in the documentation. With MSXML
you'll probably need some JScript.

Seems i have to withdraw my objections about having
evaluate() in the next XPath standard. Life sucks sometimes.

HTH
J.Pietschmann

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]