[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] problem with unc relative path


Subject: RE: [xsl] problem with unc relative path
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 26 Jun 2006 12:29:27 +0100

doc-available() returns true() or false(), it never returns empty.

Saxon delegates URI resolution to the Java runtime. I think Java VMs are not
usually very comfortable with URIs based on UNC filenames. It's worth
calling base-uri() to see what is the base URI of the node that the relative
document URI is being resolved against.

You can of course do the resolution yourself in your own URIResolver if this
proves necessary.

Michael Kay
http://www.saxonica.com/  

> -----Original Message-----
> From: Rick Roen [mailto:Rick@xxxxxxxxxxxxxxxxxx] 
> Sent: 26 June 2006 12:15
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] problem with unc relative path
> 
> Win XP sp2 - XSLT 2.0 - FOP trunk using Saxon 8.7.?
> 
> I'm having some difficulty resolving the relative file path 
> for a document in my transformation when I run from a unc file path.
> 
> The problem happens when I run the program from an unmapped 
> folder on a remote server, i.e. "\\lvsserver0\lvsapps". The 
> program, and the document I am trying to load are both in the 
> same folder, but it seems unable to resolve the relative file path.
> 
> When I run the same program + file combination from a local 
> drive, or from the same server's mapped drive, i.e. 
> "z:\lvsapps", no problem, the document loads properly.
> 
> How do I get this to resolve properly on an unmapped drive?
> 
> See below for details.
> 
> Thanks for any suggestions,
> 
> Rick
> 
> _______________________________________________
> 
> Xml fragment:
> 	 <letter-file>Cor_CreditLetter.xml</letter-file>
> 
> 
> XSL fragment
> 
> 	<xsl:if test="empty( doc-available( letter-file ) )">
>   	<xsl:message select="concat( '==== Unable to locate the 
> credit letter file: ', letter-file, ' . See your 
> administrator to resolve.' )"
> terminate="yes" /> 
>   	</xsl:if>
>  	<xsl:for-each select="doc(letter-file)">
>  	 <xsl:apply-templates /> 
>   	</xsl:for-each>
> 
> Error:
> 
> SEVERE: Exception
> net.sf.saxon.trans.DynamicError: Failed to load document 
> Cor_CreditLetter.xml
> 	at
> org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:167)
> 	at 
> org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:114)
> 	at org.apache.fop.cli.Main.startFOP(Main.java:159)
> 	at org.apache.fop.cli.Main.main(Main.java:190)
> 
> ---------
> 
> ; SystemID: file:////Lvsserver0/lvsapps/Cor_CreditLetter.xsl; 
> Line#: 195;
> Column#: -1
> net.sf.saxon.trans.DynamicError: Failed to load document 
> Cor_CreditLetter.xml
> 	at
> net.sf.saxon.expr.ComputedExpression.dynamicError(ComputedExpr
> ession.java:62
> 5)


Current Thread
Keywords