Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Context Node in XPath 1.0

Reply
Thread Tools

Context Node in XPath 1.0

 
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-11-2007
Hi, there!

As I understand the XPaht recommendation, the context node is a node;
not a node-list, not XPath object -- but a single node.

Now, the WS-BPEL 2.0 specification allows an XML simple type value to be
the context of an XPath expression, by converting it to an XPath object
-- either boolean, string or float.

I do not see how this is possible, but I would like your thoughts on it.

A note, that might help: In the WS-BPEL specification the phrase is "the
context node MUST point to the XPath object" -- the "point to" makes it
sound like some kind of reference.

Thanks.

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      11-11-2007
Since your question is really about how WS-BPEL is using XPath, you
might want to direct this question straight to that working group's
public comments list.

>Now, the WS-BPEL 2.0 specification allows an XML simple type value to
>be the context of an XPath expression


Could you indicate where you think you're seeing this?

Section 8.2.3 says that an XPath context consists of five basic items --
context node, context position and size, variable bindings, function
library, and namespaces in scope for the expression. Later sections go
on to explain how these are set up before the XPath runs. That's exactly
what I would have expected...

(I assume that the current copy is indeed the one posted at
http://docs.oasis-open.org/wsbpel/2....#_Toc164738496)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-12-2007
Joe Kesselman skrev:
> Since your question is really about how WS-BPEL is using XPath, you
> might want to direct this question straight to that working group's
> public comments list.


That list is dead quiet -- besides my own post, nothing had happened
since January. This is why it tried to make it about XPath...

> >Now, the WS-BPEL 2.0 specification allows an XML simple type value to
> >be the context of an XPath expression

>
> Could you indicate where you think you're seeing this?


In section 8.2.6:
"The context node is determined as follows: ... If the type is a simple
type, the context node MUST point to the XPath object specified in
section 8.2.2"

In section 8.2.2:
"WS-BPEL simple type variables MUST be manifested directly as either an
XPath string, Boolean or float object."

> Section 8.2.3 says that an XPath context consists of five basic items --
> context node, context position and size, variable bindings, function
> library, and namespaces in scope for the expression. Later sections go
> on to explain how these are set up before the XPath runs. That's exactly
> what I would have expected...


Yes, the five basic items are listed exactly as in the XPath
recommendation. However, as I read the above quoted, the context node
must point to either a XPath string, Boolean or float object. Is this
possible; how do you create a node pointing to an XPath object?

> (I assume that the current copy is indeed the one posted at
> http://docs.oasis-open.org/wsbpel/2....#_Toc164738496)


Indeed. Thanks.
 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      11-13-2007
I need to look at this in more detail, but I think you're confusing the
context node with the type of the node's contents. A node can't "be" a
simple type, but its content can.


--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-15-2007
Joe Kesselman skrev:
> I need to look at this in more detail, but I think you're confusing the
> context node with the type of the node's contents. A node can't "be" a
> simple type, but its content can.


Yes, I can pass a TextNode holding the simple type content, but how do I
declare it to be either string, boolean or float?

For example. passing a TextNode, holding the string "false", to the
expression "boolean(self::node())", will return true, because it is a
string, not a boolean: a string is true if and only if its length is
non-zero.

Your opinion is much appreciated. Thanks.
 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      11-15-2007
Tim Hallwyl wrote:
> Yes, I can pass a TextNode holding the simple type content, but how do I
> declare it to be either string, boolean or float?


To _declare_ it as such, you say so in the schema and validate against
the schema so that information is in the Post-Schema-Validation Infoset.

To _retrieve_ it as such, you may have to explicitly use the appropriate
method in your XPath API (which I believe is out of the scope of the
XPath Specification; check the documentation for your particular
implementation).

I believe XPath 2.0 and XQuery have syntax that allows the expression to
say what type the value is expected to be.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-15-2007
Joe Kesselman skrev:
> Tim Hallwyl wrote:
> To _declare_ it as such, you say so in the schema and validate against
> the schema so that information is in the Post-Schema-Validation Infoset.


I admit that I have not tried using a PSVI, but I do not believe this
helps. As I understand it, XPath 1.0 does not support XML Schema at all
-- thus, any content of a TextNode, regardless of its intended type, is
always an XPath String object -- also when passed as the context node.

Am I wrong?

> To _retrieve_ it as such, you may have to explicitly use the appropriate
> method in your XPath API [...]


I have no problems retrieving typed values, corresponding the XPath 1.0
objects.

> I believe XPath 2.0 and XQuery have syntax that allows the expression to
> say what type the value is expected to be.


Yes, I believe so too. However, the WS-BPEL specification, section
2.8.6, says: "When XPath 1.0 is used as Query Language [...]"

So, to summarize: The WS-BPEL specification requires in some cases, that
the context node must point to an XPath object. The question is, how
is this possible, using XPath 1.0?

Thanks.


 
Reply With Quote
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-15-2007
Tim Hallwyl skrev:
> I admit that I have not tried using a PSVI


Now I have tried it, with a small set-up in Java. I verified that the
node passed as context node was a boolean using the Xerces
PSVIDocumentImpl. As I expected it did not change anything.

I am somewhat convinced that XPath 1.0 does not support XML Schema and
all node values are string objects in XPath. If so, what could they
mean, when writing that the context node must point to an XPath object,
such as boolean, float or string?

Any thoughts are welcome. Thanks.
 
Reply With Quote
 
Joseph Kesselman
Guest
Posts: n/a
 
      11-15-2007
Tim Hallwyl wrote:
> I am somewhat convinced that XPath 1.0 does not support XML Schema and
> all node values are string objects in XPath.


Actually, I think that is true in 1.0.

> If so, what could they
> mean, when writing that the context node must point to an XPath object,
> such as boolean, float or string?


I'm still not convinced they intended to say that. At this point I
really would suggest trying to bounce this back to the working group, or
picking out one of the authors and pestering them...




--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
 
Reply With Quote
 
Tim Hallwyl
Guest
Posts: n/a
 
      11-25-2007
Joseph Kesselman skrev:

> At this point I really would suggest trying to bounce this back to
> the working group, or picking out one of the authors and pestering
> them...


I have moved the discussion to the newly created WS-BPEL forum at:

http://bpel.xml.org/how-can-context-...t-xpath-object

Thank you for your input so far. You are more than welcome to join the
discussions at http://bpel.xml.org

--tim
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath - context node evaluation problem Thomas Schmidt XML 4 01-10-2007 12:09 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
"Memory leak" in javax.xml.xpath.XPath Marvin_123456 Java 4 07-29-2005 03:49 PM
Problem selecting a node with XPATH if attribute value contains backslashes - how to force XPATH string to be treated as literal? Alastair Cameron XML 1 07-08-2003 07:24 PM



Advertisments