This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Creating and passing XML String to xsl:call-template.
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 28 Jan 2002 10:05:51 -0000
- Subject: RE: [xsl] Creating and passing XML String to xsl:call-template.
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I want to create a XML String in a template and pass it as a
> paramter to xsl:call-template.
> There I want to parse that XML String and get the values.
> Reasons why I want
> to do this
> is to reduce number of parameters passed to xsl:call-template
> and other is
> to reduce the size of the calling template.
Try passing a result-tree-fragment, as a single parameter, and then
accessing its component parts using a path expression that exploits the
xx:node-set() extension function.
Mike Kay
>
> eg:
>
> First template:
> <xsl:template name="FirstTemplate">
> <xsl:variable name="XMLString">
> <customer>
> <xsl:if test="cust_name1">
> <name>
> <xsl:value-of select="cust_name1" />
> </name>
> <xsl:if>
> <xsl:if test="cust_name2">
> <name>
> <xsl:value-of select="cust_name2" />
> </name>
> <xsl:if>
> </xsl:variable>
>
> <xsl:call-template name="SecondTemplate">
> <xsl:with-param name="xmlstr"
> select="$XMLString" />
> </xsl:call-template>
> </xsl:template>
>
>
> <xsl:template name="SecondTemplate>
> <xsl:param name="xmlstr" />
>
> here something like
> for each customer/name
> -- get the name and print by formattig.
> </xsl:template>
>
> Can I do something like this. If not Can any body suggest an
> alternative of doing this.
>
> Thanks for the help,
>
> Raj..
>
> "MMS <firstam.com>" made the following
> annotations on 01/26/02 14:38:29
> --------------------------------------------------------------
> ----------------
> "THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE
> INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED
> AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED
> INFORMATION. IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS
> MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH
> PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS
> MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE
> THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY
> E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."
>
> ==============================================================
> ================
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list