On Thu, Nov 02, 2000 at 10:14:17AM +0000, Matt Sergeant wrote:
> > Ok that works, but i have absolutely no clue why that happens. You
> > introduced a new namespace (either it's rss or foo it equally works) that is
> > not ever mentioned in the XML source. Why introducing a bogus namespace in
> > the stylesheet works for rendering content in xml (that doesn't mention the
> > namespace in question).
>
> The problem is that in XPath, you cannot use an un-prefixed name to mean
> the default namespace. If you think about this as an implementor it makes
> perfect sense. Lets look at things from an expanded name point of
> view. All elements with a namespace in an XML document have an expanded
> name, so the following:
>
> <root xmlns:foo="http://foo" xmlns="http://bar">
> <p>
> <foo:b>Hello World</foo:b>
> </p>
> </root>
that i understand.
[snip]
> So what you've got in your XML, is an item tag in the default namespace
> (the RSS 0.9 namespace). Now in a completely separate document (your XSLT
> stylesheet) you have to match against
> '{http://my.netscape.com/rdf/simple/0.9/}item', not just 'item'. The only
> way to do that is to define the namespace in your XSLT stylesheet and use
> a prefix mapping to expand that name out to the fully qualified name
> above.
ah. What i failed to grasp, was that rss was the default namespace, my
problem was that i was using the wrong premise. (that rdf was the elements
namespace since it was inside an rdf namespace)
> And that, in summary, is how XPath namespaces work. Hope it helps clarify
it does. (until the next stupid doubt)
> things further for you! (I really should be writing a book about this, but
> I just don't have time, so you get it all in email snippets!).
which is indoubtely our gain. :-)
thanks.
--
Tiago Pascoal ([EMAIL PROTECTED]) FAX : +351-1-7273394
Politicamente incorrecto, e membro (nao muito) proeminente da geracao rasca.
Recem empossado (engajado) cidadao da republica das bananas.
To live is always desirable.
-- Eleen the Capellan, "Friday's Child", stardate 3498.9