I'm talking about the creation of dynamic XSL. In other words, code-generation, and then executing the generated code. EXSLT provides a document function, which is supported by LibXSLT.
[snip]
I have taken some time to think about the approaches suggested by David (using a custom Provider) and Simon (using EXSL) to generate dynamic XSL and am trying to find the one that best fits my requirements. I have concluded that the EXSL approach is good at generating XSL from within XSL, but that this is not the approach I require.
It seems that a custom Provider that can dynamically create XSL and provide it when asked for is the one for me, but I still have issues regarding how that XSL is provided (as a string vs. an XML::LibXML::Document object). My main issue is that I do not want to turn the object I create into a string (to serve in get_strref()), only to have AxKit parse that string back into an object (which I am assuming is the case).
Here are the essentials of the process I am trying to adapt so that it can fit inside an AxKit pipeline:
1. Perl packages that take an initial XML document and create the XML source document that sits at the top of the pipeline, and one or more XSL stylesheets that form the pipeline.
Starting with an XML document, I parse it using XML::LibXML, process it using my Perl packages to create another XML document and one or more XSL documents. These "documents" are XML::LibXML::Document objects that I create dynamically.
# basically... my $libxml = new XML::LibXML(); my $xml_str = load_initial_xml(); my $xml_doc = $libxml->parse_string($xml_str); my $dynamic_xml_doc = generate_dynamic_xml($xml_doc); my @dynamic_xsl_docs = generate_dynamic_xsl($xml_doc);
2. Process dynamic XML source against dynamic XSL stylesheets For each XSL document, transform the XML document using XML::LibXSLT.
# basically... my $libxslt = new XML::LibXSLT(); foreach my $dynamic_xsl_doc (@dynamic_xsl_docs) { my $xslt_stylesheet = $libxslt->parse_stylesheet($dynamic_xsl_doc); $dynamic_xml_doc = $xslt_stylesheet->transform($dynamic_xml_doc); }
I have yet to complete part 2, so I'm not saying that I have a working implementation of this that I want to replace with an AxKit implementation. It's just that I see this process as being fundamental to AxKit, plus I am keen to use XSP and taglibs elsewhere, and that an AxKit solution would provide this and more. Additionally, I am not looking to benefit from any AxKit caching capability in this situation.
Essentially, is there an alternative to get_strref() that works like get_domref(), or something obvious that I am missing?
/dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]