xsl-list
[Top] [All Lists]

Re: access the root element

2005-11-03 10:12:41
Jon, 
just one question is still open. If I would add this xmlns entry to my xsl
stylesheet without the 'm' qualifier, would I then be able to access the
"Metrics" element without the m: before? Or is it mandatory to have a 
qualified namespace?

Regards,
Kai

--- Ursprüngliche Nachricht ---
Von: Jon Gorman <jonathan(_dot_)gorman(_at_)gmail(_dot_)com>
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: Re: [xsl] access the root element
Datum: Thu, 3 Nov 2005 11:00:47 -0600

On 11/3/05, Kai Hackemesser <kaha(_at_)gmx(_dot_)de> wrote:
Jon,

adding the namespace like Roman suuggested did work. But I have'nt fully
understood yet, why.

Well, you might want to google for some information on namespaces if
you're not sure.  Think of namespaces as a qualifier for an element. 
So to distingish, say a dublin core element with the name "Subject"
and an element in my own XML application "Subject" I could associate
each with a namespace.

The xmlns="http://metrics.sourceforge.net/2003/Metrics-First-Flat"; is
putting all the that element and all the descendent elements in that
doc into that namespace.  XSLT assumes that when you try to match
something like Metrics, you're look for unquaified elements named
Metrics.  But what you really want to look for are qualified elements
named Metrics.  To indicate in the XPATH that the name Metrics is in
the proper namespace you prefix it with the m, which in the beginning
of the document is assoicated with that namespace.

Hopefully I haven't made it any more confusing, but that's the
shortest description I can give.  Using google will more than likely
turn up much better descriptions.  (Or you could go to www.w3.org and
read the specs.)

Jon Gorman

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--