Defining namespace prefixes for the Xpath evaluator

Are you missing a feature? Request its implementation here.
beleta
Posts: 4
Joined: Sun Oct 17, 2004 2:48 am
Location: Barcelona

Defining namespace prefixes for the Xpath evaluator

Post by beleta »

If an XML document has default namespace:

Code: Select all

xmlns="something"
there is no way to match unprefixed elements (from the default namespace) using the standalone XPath evaluator, and most times is not practicable to add a prefix to the namespace definition and all unprefixed elements.

Both Xalan and Saxon provide in its XPath API ways to define namespace prefixes when evaluating an standalone XPath expression.

Please provide a mechanism to allow the user to define namespace prefixes that would be available to the standalone Xpath evaluator.

Thank you in advance.

Jose M Beleta
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Jose,

Oxygen does provide a handling for default namespaces, unfortunatelly this feature is not present in the user guide. If the document has a default namespace then oXygen will bind that to the first free prefix from

default
default1
default2
...

Best Regards,
George
dsmiley
Posts: 7
Joined: Tue Oct 26, 2004 12:03 am
Contact:

Suggestion

Post by dsmiley »

I suggest that it not be necessary to enter "default" as a magic namespace prefix. This is unintuitive.

Also... it would be nice if in the status bar or somewhere else displayed the xpath expression to your current location. Perhaps underneath the "model" tab area. I don't know.
~ David Smiley
Registered Oxygen User
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Suggestion

Post by george »

dsmiley wrote:I suggest that it not be necessary to enter "default" as a magic namespace prefix. This is unintuitive.<snip/>
This will be documented in the user guide. Any suggestions to make it more intuitive? And I think it is necessary, otherwise one cannot access a namespaced node.

Best Regards,
George
dsmiley
Posts: 7
Joined: Tue Oct 26, 2004 12:03 am
Contact:

Post by dsmiley »

It isn't necessary. A namespace'ed node can be accessed as it works currently -- with the appropriate prefix.
~ David Smiley
Registered Oxygen User
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi David,

Right, but we were talking about the case when there is no prefix, example:

Code: Select all


<test xmlns="http://test.com/test">
<a>a</a>
</test>
In this case test and a from the XPath expression test/a mean
test element from no namespace
a element from no namespace
and the XPath expression will not match any node in the sample document because there the test and a elements are from the http://test.com/test namespace.
I such a case oXygen will map default to the http://test.com/test namespace and the user can write default:test/default:a

Hope that clarifies things.

Best Regards,
George
Post Reply