[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Clark notation in XPath


Subject: Re: [xsl] Clark notation in XPath
From: Jirka Kosek <jirka@xxxxxxxx>
Date: Sun, 02 Oct 2005 20:13:37 +0200

Joe Fawcett wrote:

> One idea was to allow Clark notation when doing searches on documents as
> developers seem to struggle with the idea that that don't need to know
> the actual prefix used in a document.
>
> Let's say I have in memory a document that has all elements in the
> http://myDomain.co.uk/namespaces/ns1 namespace.
> I can select an element using the xpath:
>
> MyDom.select("{http://myDomain.co.uk/namespaces/ns1}myElement")

I bet that anyone who need to do more then one query would not like this
syntax. AFAIK MS API allows to bind namespaces to prefixes and use them
in XPath queries. So what is needed here is better education of
developers. And you can always stick to good old XPath way:

*[local-name() = 'myElement' and namespace-uri() =
'http://myDomain.co.uk/namespaces/ns1']

However it wouldn't be bad if some future version of XML (and XPath)
allowed to use Clarks notation everywhere where QName is allowed. But
this will hardly happen I think.

					Jirka

--
------------------------------------------------------------------
   Jirka Kosek     e-mail: jirka@xxxxxxxx     http://www.kosek.cz
------------------------------------------------------------------
   Profesionalnm 9kolenm a poradenstvm v oblasti technologim XML.
      Podmvejte se na na9 novl spu9tln} web http://DocBook.cz
        Podrobn} pxehled 9kolenm http://xmlguru.cz/skoleni/
------------------------------------------------------------------
   Nejbli>9m termmny 9kolenm: DocBook 5.-7.12. * XSL-FO 19.-20.12.
      XSLT 17.-20.10. * XML schimata (vhetnl RELAX NG) 7.-9.11.
------------------------------------------------------------------

[demime 1.01d removed an attachment of type application/x-pkcs7-signature which had a name of smime.p7s]


Current Thread
Keywords