XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Muly IlanSubject: Function current() is not recognized in XPath
Author: Muly Ilan
Date: 28 Nov 2017 05:00 PM
Hi,

The XPath Query Editor does not support the current() function.
See attached error message.

It's true that current() is an XSLT addition to XPath but since Stylus Studio supports XSLT I was expecting the current() function to be supported too.

Is there a workaround?

Best,

Muly

Error message

Postnext
Ivan PedruzziSubject: Function current() is not recognized in XPath
Author: Ivan Pedruzzi
Date: 28 Nov 2017 05:24 PM
As the name implies, the "XPath Query Editor" supports XPath syntax, XPath 2 to be precised.

What you are trying to accomplish with your query?


Ivan Pedruzzi
Stylus Studio Team

Postnext
Muly IlanSubject: Function current() is not recognized in XPath
Author: Muly Ilan
Date: 29 Nov 2017 03:03 PM
Hi,

I'm trying to evaluate and design XPath expressions in YANG models.
Specifically, the expressions in YANG 'When' and 'Must' statements.

Many such XPath expressions use relative format so the issue of context node and current node is important.

Example expression:
count(../../../../../protocol[action/tunnel/mac-change/mac-address!=current()])

I was hoping to use Stylus Studio for this purpose as the many free XPath evaluators out there, don't support setting the context node.

Thanks,

Muly


Postnext
Ivan PedruzziSubject: Function current() is not recognized in XPath
Author: Ivan Pedruzzi
Date: 29 Nov 2017 03:36 PM

Stylus Studio XPath query editor is context aware. If you switch to tree view, select a node and run a relative expression it will more evident.

See the attached screenshot which makes use of the "for" statement.


Does it help?

Ivan Pedruzzi
Stylus Studio Team

Postnext
Muly IlanSubject: Function current() is not recognized in XPath
Author: Muly Ilan
Date: 29 Nov 2017 03:56 PM
Yes, I checked the tree view and played around with setting the context.
This works fine.

So, it's partial help. Since I'm still missing the support of the current() function.
As you can see in my example XPath expression, current() is part of it. I cannot evaluate the expression 'as is'.

Thanks,

Muly

Posttop
Ivan PedruzziSubject: Function current() is not recognized in XPath
Author: Ivan Pedruzzi
Date: 29 Nov 2017 04:22 PM
You either did not pay attention to the screenshot or I failed understanding your goal.

1) variable $t behaves as function current().
You select which node you want as current and run a relative expression.

2) Stylus Studio feature a very powerful XSLT editor, If you need current(), why you are not writing an XSLT?

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.