Re: [xslt] Re: simpler testcase



On Fri, Mar 28, 2003 at 12:01:09AM -0500, S Woodside wrote:
> On Thursday, March 27, 2003, at 11:35  PM, Daisuke Maki wrote:
> > I'm going to take a wild guess and say that your problem might be 
> > because you use the default xml namespace in the <rngform /> tag.
> >
> > AFAIK, XML::LibXML doesn't deal with default namespaces elegantly...

  Libxml might not be elegant, it's *conformant* ! Elegance is a purely
subjective measure, conformance is what brings interoperability, and
lower solution costs. I definitely chose my camp in the later !

> >   use XML::LibXML;
> >   my $parser = XML::LibXML->new();
> >   my $xml = $parser->parse_string( <<EOM );
> >   <?xml version="1.0" encoding="iso-8859-1"?>
> >   <foo xmlns="urn:bar">
> >      <value>FOO!</value>
> >   </foo>
> >   EOM
> >
> >   # you'd expect "FOO!", but...
> >   print "VALUE: ", $xml->findvalue( '/foo/value' ), "\n";
> >
> > XML::LibXML v1.54_3 and libxml2-2.4.26
> >
> > Try with an explicity namespace. If that works, AxKit isn't broken. 
> > XML::LibXML is.

  No it's not brokeness, libxml2 implements the spec. If findvalue
claims to implements the XPath spec expression evaluation then AxKit
is broken !!! The XPath spec is cristal clear [1] that the expression
             /foo/value
only match foo and value node which are in NO namespace ! If the
elements are in the default namespace they MUST not be selected by
that expression.
  Saying that libxml2 is broken because it follows the spec reflects
really badly on whatever tool your are trying to advocate !

Daniel

[1] http://www.w3.org/TR/xpath#node-tests
    QName matching is done on expanded names, i.e. the full {URI}:localname
    pairs !

-- 
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]