>> I don't think it's a huge burden for the author of an XPath expression to

>> specify what sort of elements he/she is looking for.

The challenge, however, is that these "expressions" cannot, at present, be
uniformly represented or persisted, since the syntactic representation of
the Xpath (the actual path, including prefix) is "usage dependent" in the
tool/application used at the time.  If application #1 chooses to use prefix
NS1 for a certain namespace URI, and the path is /NS1:Thing/doc:Foo, this
path is not likely portable to another application which may handle the
default namespaces completely differently.  Therein lies the challenge, I
think!?

Rick


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 25, 2004 2:32 PM
To: [EMAIL PROTECTED]
Subject: RE: XPath with default namespace

> Aren't default namespaces just EVIL? ;)

Yes, I wish they weren't used so heavily, but XHTML started it, and now 
we're stuck.

> I always felt that this was a near-fatal flaw in the binding
> between XML and Xpath/XSLT...as it creates the need for a
> "programmer" to consciously "add" something to a DOM, parser
> or other component to enable Xpathing anything with a default
> namespace somewhere in the path.  And since the assigned
> prefix is determined by the programmer, it is essentially
> "non-portable" - the context used for an Xpath expression in
> product "A" might not be the same as product "B".

I think it's the only rational thing to do given default namespaces. Since 
the prefix is irrelevant, as long as it's bound to the correct namespace 
URI, there's no danger of getting unexpected results.  Imagine what would 
happen if the default namespace _did_ apply, and you got a document with a 
different default namespace then you were expecting -- what a mess.

I don't think it's a huge burden for the author of an XPath expression to 
specify what sort of elements he/she is looking for.

Dave

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to