Subject: Re: Namespaces
From: David Totten <xsl@xxxxxxxxxxxxxx>
Date: Tue, 10 Jun 2003 07:37:56 -0400
|
Thank you David, this works, and your explanation helped me to
understand this alot better. I appreciate your help.
David Totten
On Tue, Jun 10, 2003 at 12:07:52PM +0100, David Carlisle wrote:
>
> > Anyway, the dtd is here:
>
> wherein we find:
>
> <!ENTITY % ESJA.xmlns "'http://www.elsevier.com/xml/ja/dtd'" >
>
> <!ENTITY % top-level.att
> "xmlns CDATA #FIXED %ESJA.xmlns;
>
> which means that every element is in http://www.elsevier.com/xml/ja/dtd
> (or at least i assume that applies to every element, I didn't actually
> read much of the dtd)
>
> Assuming that's right it means that a source element that looks like
> <title>
> is really
> <title xmlns="http://www.elsevier.com/xml/ja/dtd">
> which means that a match of "title" or a select of /foo/bar/title
> will not find it, as they are looking for no-namespace.
> you need on teh xsl:stylesheet element
>
> xmlns:e="http://www.elsevier.com/xml/ja/dtd"
>
> (or any other prefix that is free if e: is taken)
>
> then have
>
> match="e:title"
> select="/e:foo/e:/bar/e:/title"
> etc.
>
> In XPath 1 you have to prefix any elements in a namespace.
>
> Xpath/xslt2 drafts allow you to say that the default namespace for
> Xpath is "http://www.elsevier.com/xml/ja/dtd" then your original would
> work, but XSLT2 is not yet a done deal.
>
> David
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|