Re: [xsl] Xpath problem

Subject: Re: [xsl] Xpath problem
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 5 Mar 2002 14:00:07 +0000
Hi Kan,

> I want to get at the node where the value element is 2111.
>      ie //Outer[value='2111']
>
> But the problem is that it goes to the node that matches just the
> first four digits if it exists in the DOM ... so it goes to the node
> where value = 21110. So I am not able to specify that it should go
> to the first node that exactly matches 2111.

In XPath, the path that you've specified should only select the Outer
elements whose value element children exactly match '2111'.

I suspect, therefore, that you're using Microsoft's "XSL Pattern"
syntax, which looks a lot like XPath but isn't. Try using the
setProperty() method on the DOMDocument object to state that when
you use selectSingleNode(), you are doing so using XPath rather than
an XSL Pattern:

  objXMLDOM.setProperty("SelectionLanguage", "XPath");
  objXMLDOM.selectSingleNode("//Outer[value = '2111']");

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread