[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: check if nodes match xpath expression

Subject: Re: check if nodes match xpath expression
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 30 Nov 2000 11:03:48 -0800 (PST)
check xpath expression
Christian,

The application you're describing is called the XPath Visualiser and
has been publicly announced 3 months ago. You can download it at
http://www.vbxml.com/xpathvisualizer

Besides its major function to hilight in the source xml documents all
nodes satisfying a given XPath expression and help the user navigate
through them, the XPath Visualiser displays also the results of scalar
XPath expressions, remembers all the XPath expressions entered for a
particular file and re-instates the appropriate list of expressions
when another XML file is re-loaded.

The collapsible/expandable syntax-coloured outline view also displays
in a special way "container nodes" that are collapsed and "hide" some
occurrence(s) of the result node-set elements.

And there are at least three new major features still to come in the
nearest future...

You can immediately find the answers to your questions in the source
code of this tool, as many other developers have already done. 

During these three months it has gained some popularity and now some
major sites including www.w3c.org, www.xslt.com, www.xmlinfo.com,
www.xmlsoftware.com (and of course www.vbxml.com :o)) ) have links and
brief descriptions of the XPath Visualiser.

I'd greatly appreciate receiving any comments reflecting your
experience with the XPath Visualiser.

Do enjoy,

Dimitre Novatchev.
P.S. Your original question can be stated more precisely in the
following way: 

What is the XPath expression that evaluates whether the current node
belongs to a given node-set.

Answer: 
<xsl:if test="count(. | $SelectedNodes) = count($SelectedNodes) ">

----------------------------------
------------------------------
Christian Nentwich wrote:

Dear all,

we have produced a simple stylesheet that transforms an XML document
into a simple HTML document, with tags in colours, etc. (like the IE5
default stylesheet).

We also have a parameter containing an xpath expression that can be
applied to the XML file. We want to highlight nodes in the translated
HTML page that match the xpath expression, e.g. the stylesheet looks
like this:

<xsl:param name="xpath"/>
....
<xsl:template match="node()">
  ..
</xsl:template>

This problem seems to appear in different forms in the FAQ but I
couldn't find a proper solution. I know that

<xsl:template match="$xpath">..</..>

won't work. Similarly,

<xsl:template match="node()">
  <xsl:choose>
     <xsl:when test="somefunc(.,$xpath)"/>
  </xsl:choose>
</xsl:template>

to check whether the current node matches the xpath, since there is no
such function.

Has anyone had a similar problem?

Thanks,
Christian



__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.