Re: [xslt] (no subject)



Sorry, forgot to press "Answer all" :)

2012/2/27 Phil Shafer <phil juniper net>:
> Parameters can be quoted if you want the string value.  If you don't
 > quote them, you get the value of the expression.

Oh, now I see. Thanks, that helped!


 >>http://www.everfall.com/paste/id.php?y22esn1kbwic
 > Is this just an artifact of the cpp interface?  In C, I just register
 > my extensions once.

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?


 >>- How I can specify my own dictionary using libxslt API?
 > Can you just use the dictionary from the context (ctxt->dict)?

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


 >>http://www.everfall.com/paste/id.php?wzgzmx95uza8
 > Not sure why you'd want to use that node as the root node instead
 > of just setting it as the context node, but, no, there's no easy
 > way to do this.

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). Let me explain the
 motivation why do I need this. I have a complex config in XML format.
 I use XPath to fetch some set of nodes. After that I need to do XPath
 request inside each node. Something like that:

 <procedures>
    <procedure name="append">
        <param name="..." type="..." />
        <param name="..." type="..." />
    </procedure>
    <procedure name="delete">
        <param name="..." type="..." />
    </procedure>
    <procedure name="select">
    </procedure>
 </procedures>

 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)



 Denis.


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