RE: Namespace prefixes in XPath

I removed the regular expressions, because I thought it is probably easier to understand it in plain English rather than in regular expressions.  Do you think regular expressions are better ?

Rather than regular expressions, I can put is more clarifying text as you suggested
1) I can explicitly put in  "(not the :: of XPath axes)".
2) The white space can occur between the prefix and the colon.
e.g.  "/     soap    :   Envelope"

So I am saying that you locate a single colon, then start going backwards and skip over whitespace, and then get the prefix.

3) The search for the prefix ends , when you find a non NCName character. 


Pratik


-----Original Message-----
From: Meiko Jensen [mailto:Meiko.Jensen@ruhr-uni-bochum.de] 
Sent: Tuesday, January 11, 2011 8:46 AM
To: XMLSec WG Public List
Subject: Namespace prefixes in XPath

Pratik,

I just had a look at the text you added to C14N2.0 in terms of how to
find namespace prefixes in XPath. Since it looks a little different from
the regexp you've send around, I must admit I'm not completely happy
with it ;)

First of all, the notion of a "single colon" is a little tricky: the
double colon used for specifying XPath axes is not obvious to all
developers, hence they might ignore the word "single" and take the
"prefixes" of all things that end at a colon. This includes prefixes
like "parent", "parent:", and some more. Just in order to avoid
confusion here I'd suggest to add a remark in brackets, sth. like "(not
the :: of XPath axes)".

The note to "skip whitespaces" was disturbing to me. What does this
mean? Does the backward search for the beginning of the prefix end at a
whitespace? Does that search continue, just omitting the whitespace? I'm
not sure about what XPath 1.0 allows in terms of whitespaces, but I'd
suggest to be precise here.

In the same line, where does the backward search for the beginning of a
prefix end? Usually, I'd expect something like "until you encounter a /
or a : " or such (since I think prefixes in XPath 1.0 would only occur
directly after a "/" or ":" character, at least for our streamable subset).

Besides that I'm perfectly fine with the approach you've taken here.

This relates to my ACTION-538 , but does not yet close it.

best regards

Meiko

-- 
Dipl.-Inf. Meiko Jensen
Chair for Network and Data Security 
Horst Görtz Institute for IT-Security 
Ruhr University Bochum, Germany
_____________________________
Universitätsstr. 150, Geb. ID 2/411
D-44801 Bochum, Germany
Phone: +49 (0) 234 / 32-26796
Telefax: +49 (0) 234 / 32-14347
http:// www.nds.rub.de

Received on Tuesday, 11 January 2011 17:30:08 UTC