Re: [xslt] (no subject)



Denis Davidov writes:
>But how? Registered extensions are stored in the XSLT context. If you
> want to transform different pair of XML-XSL, you have to create new
> XSLT context (right?). So you have to delete current context and
> create new one. Or there is a way to re-use XSLT context? Do you want
> me to provide short code example?

Use xsltRegisterExtModuleFunction() and xsltRegisterExtModuleElement().

>Create new dict using xmlDictCreate and then fill it with
> xmlDictLookup - correct?

IIRC the dict is used automagikally.

>Could you show me how could I set my node as the context node? I've
> tried to replace xmlXPathContextPtr->node with my node, but the
> program crashed (while my ugly method works fine).

I use nodePush() and nodePop().

> 1. Query for /procedures/procedure -> now I have the list of the procedures
> 2. Query for /param for each procedure (node) to obtain parameters
> list of each procedure. (in fact config structure is much complex, so
> I need to do it exactly this way)

If your needs are that simple, just whiffle through the children of
each <procedure> node.  If they are more complex, use xmlXPathEvalExpression()
to select an appropriate set of nodes.

Thanks,
 Phil


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