Re: [xslt] Re: simpler testcase



On Fri, Mar 28, 2003 at 02:43:27AM -0800, Daisuke Maki wrote:
> 
>  > Of course, because you haven't mapped the namespace prefix. To do 
> that you
>  > need XML::LibXML::XPathContext, from CPAN.
>  >
> 
> All,
> 
> sorry, I think I made a pretty big confusion by making that typo, which 
> I wrote in this previous mail.

  okay,

> What I meant is that
> 
>    (1) xsltproc *automatically* recognizes the element name as the
>        prefix when a default namespace is used:
> 
>            e.g. if the tag is
>               <foo xmlns="urn:foo"> .... </foo>
> 
>            the xpath expression "foo:foo" matches the above node.

  Right, but there is no "magic" here, the XPath expression being embedded
in an XSLT atylesheet, the XSLT spec defines the rules of the XPath context
initialization to inherit the namespaces in scope at the place where that
XPath expression is placed in the stylesheet. This is all defined within
the XSLT spec.

>    (2) XML::LibX(ML|SLT) doesn't *automatically* do this.

 You must understand that XPath spec was NOT designed to be used in isolation
but as a specification reused by other specifications like XPointer and 
XSLT. As a result there is *no conformance* statement for an isolated XPath
implementation possible, as nothing explains what and how the context is
to be initialized before an XPath query can be executed.

>        And yes, I know why, but the problem is that it doesn't,
>        and it's a bit confusing if you're used to xsltproc

 You can't ask libxml2 or XML::LibXML to provide a well defined namespace
context initilization because there is NO specification defining those.
If you take an out of context XPath expression using prefixes, nothing 
explains how they are supposed to be initialized, you're operating outside
of the scope of the XPath or XSLT specification. No interoperability
can be guaranteed, clear ?
 Now your claim is extended to XML::LibXSLT, and I ask you to be extremely
precise about this because in an XSLT framework those problem should not exist.
What do you claim is broken in the XML::LibXSLT, please provide examples !

> Since xsltproc automagically seems to handle it, it seemed to me that 

  You're irritating, there is no magic here, only specs :-(

> default namespaces should inherit the element name. If that's not in the 
> spec, then oh well.

  What spec ? XPath, no ! The specs are free, they are available online,
read them !

> Anyway, can we get this back to axkit-users only now? I really didn't 
> mean to (and didn't expect anybody to) send it to libx(ml2|slt) guys, as 
> I was *sure* it's a Perl-level problem.
> 
> Sorry for the confusion.

  It is not a Perl only problem, the confusion is that you seems to think
the XPath spec covers use cases that it does NOT cover, and the fact of
using it outside of the scope where it was intended sure leads to problems
and interoperability problems. But understanding the spec and its scope
should be the first step before arguing about correctness of implementations.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]