Mailing List Archive

XPath Methods and namespaces
Hi folks,

Does the XPath Methods product for ParsedXML support XML namespaces?

I've had a look through the code and don't see anything, just curious.

--Dethe

==========================================================================
| dethe@burningtiger.com | http://livingcode.manilasites.com |
==========================================================================
"Well I've wrestled with reality for thirty-five years now, doctor, and I'm
happy to state I've finally won out over it." -- Elwood P. Dowd, Harvey
Re: XPath Methods and namespaces [ In reply to ]
Martijn Faassen wrote:
> Um, I don't know. It should to the extent that ParsedXML and 4Suite's
> XPath implementation support namespaces, but I'm not much of a namespce
> guru so perhaps there are special UI or API requirements you have?
> We could see about adding something.

4Suite supports XML namespaces, but you have to add them when you create the
Context object. I found this very confusing at first, especially since
documents which have a default namespace can't use a "default" prefix (a null
string). Prefixes used to define namespaces in the original document do not
have to match prefixes in the XPath context (but the namespace strings, the
URLs, do). If all of this is just adding to the confusion, I'll try to post
my XPath for ZPT tonight, which uses 4Suite and namespaces. I've tested it
with ParsedXML, but not with ParsedXML + Namespaces yet due to a problem with
my ParsedXML install--I can't create new instances. I'll try to test in
anyway on the train home and let you know the results.

--Dethe


==========================================================================
| dethe@burningtiger.com | http://livingcode.manilasites.com |
==========================================================================
"Well I've wrestled with reality for thirty-five years now, doctor, and I'm
happy to state I've finally won out over it." -- Elwood P. Dowd, Harvey
Re: XPath Methods and namespaces [ In reply to ]
delza@landry.alliances.org wrote:
> Does the XPath Methods product for ParsedXML support XML namespaces?
>
> I've had a look through the code and don't see anything, just curious.

Um, I don't know. It should to the extent that ParsedXML and 4Suite's
XPath implementation support namespaces, but I'm not much of a namespce
guru so perhaps there are special UI or API requirements you have?
We could see about adding something.

Regards,

Martijn
Re: XPath Methods and namespaces [ In reply to ]
delza@landry.alliances.org wrote:
> Martijn Faassen wrote:
> > Um, I don't know. It should to the extent that ParsedXML and 4Suite's
> > XPath implementation support namespaces, but I'm not much of a namespce
> > guru so perhaps there are special UI or API requirements you have?
> > We could see about adding something.
>
> 4Suite supports XML namespaces, but you have to add them when you create the
> Context object. I found this very confusing at first, especially since
> documents which have a default namespace can't use a "default" prefix (a null
> string). Prefixes used to define namespaces in the original document do not
> have to match prefixes in the XPath context (but the namespace strings, the
> URLs, do).

> If all of this is just adding to the confusion,

I'll just say you're for now the Zope-XML XPath namespace guru. I myself at
least will depend on your zen. :)

> I'll try to post
> my XPath for ZPT tonight, which uses 4Suite and namespaces. I've tested it
> with ParsedXML, but not with ParsedXML + Namespaces yet due to a problem with
> my ParsedXML install--I can't create new instances. I'll try to test in
> anyway on the train home and let you know the results.

Okay, sounds good. Looking forward to seeing it!

Regards,

Martijn