Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Passing a Javascript Variable into an XSL Stylesheet

From: AlexanderWood@-----.---
To: NULL
Date: 8/1/2007 3:18:00 PM

On Aug 1, 1:11 pm, AlexanderW...@gmail.com wrote:
> Hi,
>
> I've got a clientside javascript control that uses an XML datasource.
> The control appllies XSL to the XML data in order to dynamically
> generate tables on the page.  I want to be able to render part of the
> table without having to reload the whole thing.
>
> I've got the XSL doc that I need and the XML that I need for this
> operation.  The problem is that the XSL file needs a parameter in
> order to create the table rows with their ids set correctly. This
> parameter normally comes from another XSL template which I won't be
> using in this place.
>
> something like this:
>
> function partialRender(xmlNode,intRecordID,xslDoc){
>     var sOutputHTML;
>    sOutputHTML = xmlNode.transformNode(xslDoc);
> return sOutputHTML;
>
> }
>
> How do I get the value from the variable intRecordID into the XSLDoc?
> Any ideas?
>
> Thanks.

I figured it out....

function partialRender(xmlNode,intRecordID,xslDoc){
    var sOutputHTML;
    xsl.selectSingleNode("/xsl:stylesheet/xsl:template/
xsl:param[@name]").nodeTypedValue=intRecordID;
    sOutputHTML = xmlNode.transformNode(xslDoc);
 return sOutputHTML;

 }

Thanks,




transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent