Subject:Passing Parameter to Templates Author:Paul Rajan Date:16 Jul 2002 01:01 AM
I'm attching the three four files:
1. Cap2vista.xsl (Transformation)
2. 202614_out.xml (Main Input)
3. CapFormField.xml (Look-up)
4. Cap2Vista.xml (Output by xXcelon)
5. ResponseFromXSLT.xml.tmp (Output by Commandline XSLT processor)
When transform using cXcelon Cap2Vista.xml is the out output I get. But when run through any other commandline xslt processor the parameter passed to is empty and no element or field created. Could some one explain this.
Subject:Re: Passing Parameter to Templates Author:Minollo I. Date:16 Jul 2002 02:16 AM
The problem is tricky, and in short it's a bug in the Stylus Studio processor.
In your stylesheet you are doing this:
....where $FormFieldTop is a document fragment defined as:
So,the root element in $FormFieldTop is Fields.
You don't have a template rule which matches Fields; so the processor hits
the built-in template rule for "*", which does an apply-templates; which
means that it looks for template rules defined for Fields' children, Field
elements in your case.
You do have a template rule which matches Field elements, it's the one
declared as match="Fields/Field", and you are back into your code.
So, what's the problem? The problem is that built-in template rules are not
supposed to propagate parameters... and even if the Stylus Studio processor
does that, and even if it would probably be a cool feature, it's not part
of the XSLT 1.0 specs... This is the bug in our processor, that we will fix
in the next public update.
In the meanwhile, you can make all processors happy by changing:
This way you won't go through the built-in template rule, and things will
work as expected.