Possible Bug Invalid URI passed to collection
Added by Anonymous over 16 years ago
Legacy ID: #5091315 Legacy Poster: pvallone (pvallone)
Hi, In saxon 9.006 and 9.1.0.1, I receive this error when using the collection function: SXWN9009: An empty xsl:for-each instruction has no effect Error on line 64 of ACMMEL-FO-BOOK.xsl: FODC0002: Invalid URI {file:///C:/sandbox/ACM_SCHEMAS...} passed to collection () function at xsl:call-template name="pdfBookmarks" (file:///C:/Documents.... Transformation failed: Run-time errors were reported The error reported by visual studio: A first chance exception of type 'Saxon.Api.DynamicError' occurred in saxon9api.netmodule My URI has no spaces. I tested this with the API and the transform.exe, with the same effect. However, when run under 9.0.0.2, it works. (I was having trouble sending a email to the SAXON XSLT and XQuery processor list, so I a posted here) Regards, Phil
Replies (11)
Please register to reply
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091386 Legacy Poster: Michael Kay (mhkay)
It's a shame the error message isn't showing the full URI - I will fix that. The error message is produced if the either the relative URI passed to the collection function, or the base URI that it is resolved against, is invalid according to the rules applied by the Java java.net.URI class (as implemented in the GNU ClassPath library). I've looked through the patches issued between 9.0.0.2 and 9.0.0.6 and I can't see any that are obviously relevant to this case. I'll need either: (a) a test case that I can use to reproduce the problem, or (b) evidence as to the relative URI and base URI when the collection() function was called. You can get that by displaying the values of the relevant parameter, and of static-base-uri() at the point of the call. I do notice that Saxon on this path is using the java.net.URI class to do relative URI resolution whereas it usually uses a .NET XmlUrlResolver, with the comment (in DotNetPlatform.java): // It's not entirely clear why the .NET product needs a different version of this method. // Possibly because of bugs in GNU classpath. But we'll need to know what the URIs actually are to get to the bottom of it. Michael Kay http://www.saxonica.com/
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091404 Legacy Poster: pvallone (pvallone)
Hi Michael, The XSL building the URI is: <xsl:param name="front-matter-folder">file:///C:/sandbox/ACM_SCHEMAS/DC10MEL/frontmatter</xsl:param> <xsl:variable name="front-filter"> <xsl:value-of select="$front-matter-folder"/> <xsl:text>?select=*.xml;recurse=no</xsl:text> </xsl:variable> <xsl:for-each select="collection($front-filter)"> ... </xsl:for-each> If this isn't enough, I will build a test case and post a link to my site. Let me know. Thanks, Phil
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091413 Legacy Poster: Michael Kay (mhkay)
Although you have passed an absolute URI and therefore in theory the base URI doesn't come into it, the code still uses the base URI and may fail if it is invalid. Try displaying static-base-uri(). Michael Kay http://www.saxonica.com/
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091460 Legacy Poster: pvallone (pvallone)
Hi Michael, The static-base-uri is: file:///C:/Documents and Settings/Compaq_Administrator/My Documents/Visual Studio 2008/Projects/ACMmelCREATOR/ACMmelCREATOR/bin/Debug/stylesheets/ACMMEL-FO-BOOK.xsl I would assume that my spaces would need to more my stylesheet to a directory that doesnt have a space in the name? Regards,
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091521 Legacy Poster: Michael Kay (mhkay)
It's possible that GNU Classpath is objecting to spaces in a URI. Try putting xml:base="http://www.w3.org/" (or something equally innocuous) on the instruction containing the call to collection(), and see what happens.
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5091639 Legacy Poster: pvallone (pvallone)
HI Michael, I added xml:base="http://www.w3.org/" to the instruction and still had the same effect. I even moved all files to a folder with no spaces in the name. Also, I was able to get it working in 9.006 - my original post said it didn't work in 9.0.0.6. I was mistaken. Still no luck in 9.1.0.1
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5158042 Legacy Poster: pvallone (pvallone)
Hi Michael, I wanted to follow up on this possible bug I reported. In Saxon 9.1.0.1, the collection function returns an invalid uri if the parameter has spaces or back slashes "". I was able to confirm that this is not the issue in 9.0.0.6. Regards, Phil
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous over 16 years ago
Legacy ID: #5158532 Legacy Poster: Michael Kay (mhkay)
I'll take another look at this when I get back from vacation. Micahel Kay
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous about 16 years ago
Legacy ID: #5202721 Legacy Poster: Michael Kay (mhkay)
I have fixed the code so that spaces in the name are now accepted. See ttp://sourceforge.net/tracker/index.php?func=detail&aid=2080345&group_id=29872&atid=397617 I have also checked that some other special characters (such as accented letters) are accepted. The case of backslash is more difficult. While it is a legal character in an anyURI, it has no special meaning in relation to the file:/// URI scheme, and I suspect most people using it are likely to be using it incorrectly as a separator where they should be using forwards slash. So it would not retrieve anything even if it were accepted. In the circumstances I think it is better to reject it as invalid. I know there are some (perhaps many) products that accept a Windows filename in a place where the specification says that a URI should be supplied. I'm reluctant to go down that route.
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous about 16 years ago
Legacy ID: #5202736 Legacy Poster: Michael Kay (mhkay)
I've just remembered that this was reported against the .NET product, whereas I have been testing the changes in the Java debugger. I'll make a note to self to do some testing in the .NET environment when I next rebuild. The patch does cause Saxon to use the same paths for URI handling that are used for other functions such as doc(), especially for URI resolution against the base URI, so the results should now be consistent. IIRC correctly the .NET code is more tolerant of backslashes in URIs than it probably should be...
RE: Possible Bug Invalid URI passed to collec - Added by Anonymous about 16 years ago
Legacy ID: #5204248 Legacy Poster: pvallone (pvallone)
Thanks Michael for the follow up. If you need a test case, let me know. Regards, Phil
Please register to reply