Problem in using "ancestor()" func. in qualifier list of XSL query

Subject: Problem in using "ancestor()" func. in qualifier list of XSL query
From: "Amit Rekhi" <amitr@xxxxxxxxxxxxx>
Date: Tue, 25 Jan 2000 18:17:06 +0530
Hi!

This ques. pertains to Decemeber 18 working draft of XSL

PROBLEM STATEMENT

I am trying to include a function call from within the qualifier list of an
XSL
query but I am not getting the desired result.
Let me explain with an eg.
Let's say I have a the following XML fragment:
.
.
<ElementDecl Name = "ELE1">
   <Seq>
       <Ref Element = "ELE2">
       <Seq>
           <Ref Element = "ELE3">
       </Seq>
   </Seq>
</ElementDecl>
<AttDef Element = "ELE1" Name = "Type" AttValue = "TSet" />

For the above XML fragment, I have a template rule for "<Seq>".

Now, in this "<Seq>" template rule, I want to check whether the ancestor
"<ElementDecl>" element's "Name" attribute will match an "<AttDef>"
element's
"Element" attribute. I want to achieve all this in one XSL query. i.e.
.
.
<xsl:when test = "AttDef[@Name = 'Type' and @AttValue = 'TSet' and
@Element = ancestor(ElementDecl[@Name])] " />

But this query does not work!

- How to make the above query work so that I can test the equality of
"<ElementDecl>" element's "@Name" attribute with "<AttDef>" element's
"@Element"
attribute in a single query?

- Is it possible to use the ancestor() XSL function within the qualifier
list of an
XSL query? If so, how?

Thanks in advance for any replies,

Amit Rekhi,
Software Engineer,
A.B. Infosys Private Limited,
B-102, Gulmohar Park,
New Delhi - 110049,
INDIA.
Tel: +91-11-6512816,6512822,6968976
Fax: +91-11-6518873
Website: http://www.abinfosys.com
EMail: amit@xxxxxxxxxxxxx

Note: Not related to Infosys Technologies Limited








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


Current Thread