XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Paul RajanSubject: Passing Parameter to Templates
Author: Paul Rajan
Date: 16 Jul 2002 01:01 AM
Hi,

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.

Ta!

Paul Rajan
Melbourne




ApplicationCap2Vista.xsl
XSL Transformation Sheet

Application202614_out.xml
XSL Transformation Sheet

ApplicationCapFormField.xml
Look-up

ApplicationCap2Vista.xml
Output using eXcelon

ApplicationResponseFromXSLT.xml.tmp
Output by Command Line XSLT Processor

Postnext
Minollo I.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:
{xsl:apply-templates select="$FormFieldTop"}

....where $FormFieldTop is a document fragment defined as:
{xsl:variable name="FormFieldTop"
select="document('CapFormField.xml')/Form/TableId/Fields"/}

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:
{xsl:apply-templates select="$FormFieldTop"}
....into...
{xsl:apply-templates select="$FormFieldTop/Field"}

This way you won't go through the built-in template rule, and things will
work as expected.

Thanks for reporting this,
Minollo

Posttop
Paul RajanSubject: Re: Passing Parameter to Templates
Author: Paul Rajan
Date: 16 Jul 2002 03:03 AM
Hi Carlo,

Great man! It's magic! I've been struggling with this for a couple of days! It works now. Thanks for your help.


Paul Rajan
Melbourne

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.