This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

FW: problem with passing parameters


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


> -----Original Message-----
> From: Mistroni Marco (NET-MIA/Helsinki) 
> Sent: 31. July 2000 11:53
> To: 'smuench@us.oracle.com'
> Subject: problem with passing parameters
> 
> 
> Hi Steve,
> 	how r u?? long time that we don't 'see' each ohter
> 
> i have a problem with xsl:param
> 
> i am setting an XSL parameter at runtime
> the parameter contains the URL of another XSL file 
> whenever i run the program, i got the following exception
> 
> 
> XSL Error: pattern = 'file:///c:\marcodev\layouthtml.xml'
> Extra illegal tokens: 'marcodev', '\', 'layouthtml.xml', 
> style tree node: org.ap
> ache.xalan.xslt.StylesheetRoot@5514f802
> XSL Error: SAX Exception
> There was a SAX Exception!
> org.apache.xalan.xslt.XSLProcessorException: pattern = 
> 'file:///c:\marcodev\layo
> uthtml.xml'
> Extra illegal tokens: 'marcodev', '\', 'layouthtml.xml'
>         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)
> 
> 
> what's wrong with that?????
> how can i pass an URL without having the processor complain??
> 
> thanx in advance & best regards
> 	marco
> 


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]