From: Hauser, W. A. <Wol...@ea...> - 2007-02-05 10:42:31
|
Hi Thomas, that's easy to solve: Chang your xsl into <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" = version=3D"2.0"> <xsl:param name=3D"test"/> <xsl:template match=3D"/"> <tesT> <xsl:value-of select=3D"$test"/> </tesT> </xsl:template> </xsl:stylesheet> and it will work because the parameter is global now. The parameters passed by transform:transform are parameters of the = stylesheet not parameters of the templates. If you have to call a template with parameters, you have to pass them by = <xsl:with-param> while calling it. Regards Wolfgang Hauser -----Urspr=FCngliche Nachricht----- Von: exi...@li... = [mailto:exi...@li...] Im Auftrag von Thomas = Wagner Gesendet: Montag, 5. Februar 2007 10:58 An: exi...@li... Betreff: [Exist-open] No parameter for xsl transform Hello, i try to call a xslt - stylesheet in a xquery. The stylesheet: <?xml version=3D"1.0" encoding=3D"UTF-8"?> <xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform" = version=3D"2.0"> <xsl:template match=3D"/"> <xsl:param name=3D"test"/> <tesT> <xsl:value-of select=3D"$test"/> </tesT> </xsl:template> </xsl:stylesheet> My Query: xquery version "1.0"; declare namespace transform =3D "http://exist-db.org/xquery/transform"; declare option exist:serialize "method=3Dxml = media-type=3Dapplication/xml"; let $doc :=3D fn:doc('/db/fs_daten/scl/regler/version0.xml') let $params :=3D (<parameters><param name=3D"test" = value=3D"testValue"/></parameters>) return = transform:transform($doc,'xmldb:exist:///db/fs_daten/xslt/test.xsl',$para= ms) The expected output is <tesT>testValue</tesT>=20 but i only get <tesT/>. I think the source xml doesn't matter, however i can provide it, if it = helps answering my question. I'm using=20 eXist Version: 1.1.2dev=20 eXist Build: 20070130=20 eXist Home: C:\eXists_SVN=20 SVN Revision: 5155=20 Java Vendor: Sun Microsystems Inc.=20 Java Version: 1.6.0=20 Saxon: 8.7.3 Xerces-J 2.9.0 Mit freundlichen Gr=FC=DFen i.A. Thomas Wagner F&S PROZESSAUTOMATION GmbH Gewerbering 35 01809 Dohna Tel: +49 3529 5667-0 Fax: +49 3529 5667-15=20 Email: tho...@fs... Home: www.fs-aut.de -------------------------------------------------------------------------= Using Tomcat but need to do more? Need to support web services, = security? Get stuff done quickly with pre-integrated technology to make your job = easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache = Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 _______________________________________________ Exist-open mailing list Exi...@li... https://lists.sourceforge.net/lists/listinfo/exist-open |