Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Need help with passing a parameter

From: "Someone" <someone@---.--->
To: NULL
Date: 10/7/2006 1:27:00 PM

Thanks again Martin for your reply but I got it working now. Here is a 
sample for anyone looking to do the same thing.

<?php
$filter = $_GET[value];
?>

<script>
var processor = new XSLTProcessor();
var xslt = document.implementation.createDocument("", "", null);
xslt.async = false;
xslt.load("file.xsl");
processor.importStylesheet(xslt);
var src_doc = document.implementation.createDocument("","", null);
src_doc.async = false;
src_doc.load("file.xml");
processor.setParameter(null,"filter","<?PHP echo $filter ?>");
var result = processor.transformToDocument(src_doc);
var xmls = new XMLSerializer();
var output = xmls.serializeToString(result);
document.write(output);
</script>



"Martin Honnen" <mahotrash@y...> wrote in message 
news:%23$xqc8i6GHA.4572@T......
>
>
> Someone wrote:
>
>> I would love to do that but my hosting company does not have PHP5.
>
> Mozilla's XSLT processor API is described/documented here:
> <http://developer.mozilla.org/en/docs/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations>
> Note that it is quite different from the MSXML API as it creates document 
> fragment nodes allowing you to insert the result of an XSLT transformation 
> with appendChild into an existing document.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 




transparent
Print
Mail
Like It
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