Subject:XST1.0: create node list as variable (macros implemetation) Author:Siarhei Barysiuk Date:14 Apr 2007 07:59 AM Originally Posted: 14 Apr 2007 07:50 AM
I've try to realize simple macros system in xml I need.
1) we define macros in separated file as
2) we use macros in other file as
3) we need process macros at runtime and substitute all real
values of parameters(attributes)
CREATE VARIABLE WITH THESE NODES, SUBSTITUTE REAL VALUES OF VARIABLES
and APPLY TEMPLATES to nodes in this variable (now tree will look like
except tag <myns:use-macros...> in processed document
Now question: Can I create in memory(as xsl:variable) tree which I'll apply templates for further processing?
If I use built-in processor in Stylus Studio all is ok. But if I try to use other processors(such Xalan, Saxon and MS) I have error about converting variable to node list. As I understand I create this variable as RTF (not node list) but how can I create this variable with possibilities to further processing (I use copy and copy-of and all seems ok). Is it possible in XSLT 1.0?
In my application I use xsltproc (XSLT processor in Linux, you can try it under Cygwin enviroment) and it doesn't work too.
I attached small example and result I expect. (Stylus Studio built-in processor generate this result).
If you have any ideas or advices, please, write.
I wouldn't like to use processing in 2 steps
xml_with_macroses->xml_with_processed_macroses->result, would do it "beautiful".