(no subject)

Denis Davidov <[email protected]>
Newsgroups gmane.comp.gnome.lib.xslt
Message-ID <CALUsooW=GbG6rrPwr6_WH6pE4khTMfGNFjy2ti497jRGPmW-5w@mail.gmail.com>
Hello. First of all, thanks for libxml and libxslt! I’m working on
software that uses both of the libraries and I found GNOME XML/XSLT
libraries very easy to use. Thanks, guys!

I have several questions and I hope I’ll find some help here. Here they are:

1. I’m trying to pass parameters into XSL, but something goes wrong
and it doesn’t work. Here I’ve published very short code example that
illustrates simple XSL transformation and parameter passing:
http://www.everfall.com/paste/id.php?76x88mgneaad

Unfortunately it doesn’t work. “value-of” element just returns an
empty string. I have this output:

<?xml version="1.0" encoding="utf-8"?>
Param =

What do I do wrong? You can edit code example right on the website
where its published.


2. When I create xsltTransformContext (using xsltNewTransformContext),
I have to specify both XML and XSL documents. When I call
xsltApplyStylesheetUser, I also need to pass both XML and XSL document
pointers. Why do I need to do this two times? Here is an explanation
why do I ask: I register a lot of extension elements and functions,
and perform a lot of transformations on the different documents and
style sheets. I don’t want to register all extensions each time when I
need to transform new XML-XSL pair, I want to reuse XSLT context.
Currently I do it in this way:
http://www.everfall.com/paste/id.php?y22esn1kbwic

Is there any better way to solve this problem?


3. When I perform transformation, I have a lot of such errors in stdout:

element div: error : Name is not from the document dictionnary 'div'

(btw, there is a misspell in “dictionary”). If I’ll specify XHTML
namespace in the XSL as a default namespace, then there are no such
errors. But I don’t want to specify it in XSL. I want to know:
- How I can specify my own dictionary using libxslt API?
- How I can switch error reporting off?


4. Assume that I have xmlDoc, xmlXPathContext (constructed from this
xmlDoc), and xmlNode (somewhere from this xmlDoc). I want to perform
XPath-request as if this node was the root of the document. What is
the best way to do this? Currently I replace root node, perform the
request, and place the root node back:
http://www.everfall.com/paste/id.php?wzgzmx95uza8

Is there any better solution for this?


Ok, that’s it for now, thanks for help :)

Denis.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.