On Monday, January 7, 2002, at 11:48 AM, John Merrells wrote:



In XPath there is no way to associate a namespace URI with a namespace
prefix, but you can still include the prefix in the queries. The methods
are necessary so that the XPath engine can do something intelligent when
it sees a namespace prefix in a query.

Ok, I see that in the XPath grammar now.


QName::= (Prefix ':')? LocalPart

So, is this just some syntactic sugar to make writing XPath
expressions a little less laborious?

It's syntactic sugar to make executing namespace qualified queries possible. The problem is the prefix itself doesn't mean anything. So you have to have some other mechanism to associate the prefix with a URI. The URI is what is important, and it is what you need to know in order to properly evaluate the namespace qualified query.



Or, is there a more subtle reason... like when an XPath expression is embedded in an XML Document as an attribute or element value. That expression could make use of the namespace prefix to uri mapping defined in the document.

That would depend on the application. XSL-T is an example of an XML application where this would be true. XPath expressions in XSL-T take the namespace mappings from the parent document. In the API we don't have that context, so we have to manually specify the mappings to create the context.



John



_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------


Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------

Reply via email to