[xml] Some words about libxslt

Date view Thread view Subject view Author view

From: Tom . (ptittom@free.fr)
Date: Mon Mar 05 2001 - 08:35:47 EST


Hi,
Here are some notes about XPath/XSLT functions in libxslt.

In xsltDocumentFunction, the problem with XPointer could have been solved
with some kind of "Simple API for XPath/XPtr/XSLT" as I earlier suggested
it : whether an XPtrExpr returns a location set or a node-set can be
guessed by its syntax (if it uses the range, range-inside, start-point,
end-point, range-to or string-range functions) ; using a "plugable" API
similar to the SAX one allows you to handle expressions differently without
having to write another parser. I'm writing such an API and will keep you
informed. Another solution should be to evaluate the XPointer expression
and test the result type.

In xsltKeyFunction, the "TODO: find uri when qualified name" is, I guess,
just a call to xmlXPathNsLookup to add, isn't it?
The TODO "handle NODE set as 2nd args of key()" should be very easy to
solve. It's basically the same as the id() function when passing a node-set
argument.

There is a problem in xsltSystemPropertyFunction : you don't use QNames.
The Rec says "version", "vendor" and "vendor-url" Ťare all in the XSLT
namespace". The "xsl" prefix in the Rec is just an understanding. If my
stylesheet binds the XSLT namespace URI to the "foo" prefix, I'll call
system-property with "foo:version", not "xsl:version" since the "xsl"
prefix isn't necessary bound to the XSLT namespace. I also suggest using an
hash table to set and retrieve predefined and "vendor-defined" properties.
This hash table should be application-wide, not bound to each evaluation
context.

In xsltFunctionAvailableFunction, it seems you just need to call
xmlXPathFunctionLookupNs after having expanded the prefix with
xmlXPathNsLookup.

I'll try to provide some patch soon...

Tom.

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Mar 05 2001 - 08:44:28 EST