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
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Calvin IIISubject: New to XQuery question
Author: Calvin III
Date: 02 May 2005 04:53 PM
Hello,
I am new to XQuery and XPath, having problmes understanding the following 3 statements:

.[//@id], .[//[not(@id)]], .[not(//[not(@id))]]

can anyone help?
thanks in advance

Posttop
Alberto MassariSubject: New to XQuery question
Author: Alberto Massari
Date: 03 May 2005 04:40 AM
>Hello,
>I am new to XQuery and XPath, having problmes understanding the
>following 3 statements:
>.[//@id]

This will return the current context if it or one of its children contains an attribute named "id"

>.[//[not(@id)]]

This has an error: "//" must be followed by a test expression.
I guess you meant ".[//*[not(@id)]]".
This will return the current context if it or one of its children does not contain an attribute named "id"

>.[not(//[not(@id))]]

Two errors here: the same "//" not followed by a test expression, and the last ")" closed before the "]".
I guess you meant ".[not(//*[not(@id)])]".
This will return the current context if it and all of its children contain an attribute named "id"

Alberto

 
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.