Re: [xsl] Matching namespaces - one works, one doesn't ?

Subject: Re: [xsl] Matching namespaces - one works, one doesn't ?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 29 Nov 2007 12:18:34 +0000
On 29/11/2007, Kerry, Richard <richard.kerry@xxxxxxxxxxx> wrote:
> I now have only the one template :
>         <xsl:template
> match="@*[local-name()='noNamespaceSchemaLocation']" />

you could if you wanted re-write that to:

match="@*:noNamespaceSchemaLocation"

which is a bit nicer.

> Seems I may need to read up a bit more on namespaces.  Doesn't seem too
> intuitive to me.....

No it's far from intuitive - the worst thing you can do is rely on
what you expect to happen when it comes to learning namespaces...

Oddly enough every company seems to like to put their XML into a
namespace which represents their company, regardless of whether the
XML will come into contact with any other XML during it's life.  I've
even seen things like:

<comp:someElem>
  <xhtml:p>some text <xhtml:p> some more </xhtml:p></xhtml:p>
</comp:someElem>

...where its thought the "presentational" markup should be separate
from the the business markup.  All nonsense as it just causes problems
down the line and doesn't add anything at all to the XML... and once
its been used like this for a while the cost/time to change it
outweighs just putting up with it.


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread