[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: FW: problem with passing parameters

Subject: Re: FW: problem with passing parameters
From: Gary L Peskin <garyp@xxxxxxxxxxxx>
Date: Mon, 31 Jul 2000 09:14:15 -0700
gary marco
Marco --

Remove the quotes from around '$layout' in the document() function. 
This is causing document() to try to load a file named $layout.  Also,
be sure your command line has

	-PARAM layout "'file...'"

The newest version of Xalan (1.2.D01) will replace the #UNKNOWN with the
proper type in the error message.  However, removing the quotes should
do the trick.

You'll also have a problem with your select="$layout/html".  Not sure
what you're trying to
do here but I think you mean $page/html.

Gary


Marco.Mistroni@xxxxxxxxx wrote:
> 
> Hi Steve,
>         please ignore my previous message
> i got the following problem:
> i want to use the document() function in my XSL stylesheet
> the name of hte document must be provided dynamically at run time
> my stylesheet looks like this:
> 
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:param name="layout" select="'default'"/>
> <xsl:variable name="page" select="document('$layout') />
> 
> <xsl:template match="/">
>         <xsl:apply-templates select="$layout/html" />
> </xsl:template>
> 
> <xsl:template match="insert-body">
>         <xsl:apply-templates select="$page/content/*" />
> </xsl:template>
> 
> <xsl:template match="content" >
>         hello
> </xsl:template>
> 
> <xsl:template match="@*|*">
>         <xsl:copy>
>                 <xsl:apply-templates select="@*|node()" />
>         </xsl:copy>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> what i want to do:
> - i want to set a parameter with the name of an XML file and then apply the
> document() function
> 
> Due to the error that i am receiving, i decided to make it longer, by
> setting one parameter with the name of the file
> and then creating a variable that applies the document() function to the
> parameter (i have tried also the shortest way)
> 
> the parameter value is  file:///c:\\marcodev\layouthtml.xml
> 
> whenever i run my stylesheet, i got the following exception:
> 
> XSL Error: SAX Exception
> There was a SAX Exception!
> org.apache.xalan.xslt.XSLProcessorException: Can not convert #UNKNOWN to a
> NodeL
> ist!
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1630)
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1594)
>         at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java,
> Com
> piled Code)
> 
> i am using Xalan, latest version
> when i set the stylesheet, the parameter value is "'file........ '"  (the
> file name between quotes)
> i don't understand what is the #UNKNOWN
> 
> can anyone help me please????
> thanx in advance & best regards
>         marco


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.