You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Tomas Kulhanek (JIRA)" <xa...@xml.apache.org> on 2004/11/26 14:56:18 UTC

[jira] Created: (XALANJ-2000) xsl:include with relative href cause MalformedURL on unicode path

xsl:include with relative href cause MalformedURL on unicode path
-----------------------------------------------------------------

         Key: XALANJ-2000
         URL: http://nagoya.apache.org/jira/browse/XALANJ-2000
     Project: XalanJ2
        Type: Bug
    Versions: 2.6    
 Environment: Windows XP
    Reporter: Tomas Kulhanek


xsl:include with relative href cause MalformedURL on unicode path.

If the stylesheet contains <xsl:include> with relative reference and this reference is based on path with unicode characters the following is thrown when trying to tranform something by xalan command line:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: &#9532;Ö 

Our application throws following stack trace:
org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character:
&#9532;Ö 
        at org.apache.xml.utils.URI.initializePath(URI.java:799)
        at org.apache.xml.utils.URI.initialize(URI.java:473)
        at org.apache.xml.utils.URI.<init>(URI.java:231)
        at org.apache.xml.utils.URI.<init>(URI.java:214)
        at org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(SystemIDResolver
.java:251)
        at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInc
lude.java:173)
        at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetH
andler.java:668)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
arser.java:487)

Looking deeper into the code the consequences (not the reason!) could be repaired by transforming URI unicode characters to %XX form.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2000) xsl:include with relative href cause MalformedURL on unicode path

Posted by "Tomas Kulhanek (JIRA)" <xa...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XALANJ-2000?page=comments#action_56024 ]
     
Tomas Kulhanek commented on XALANJ-2000:
----------------------------------------

Yes. 
But mainly I see the problem in relative paths in href. 

The xalan classes makes absolute base by File(relativePath).getAbsolutePath(); and adds it to the URI and forgets to make conversion of unicode chars tto %XX form. This is forgotten in 

SystemIDResolver.getAbsolutePathFromRelativePath(String relativePath)

So I recommend to add the call filepath2URI(absoluteBase); (from previous attached hack) into the mentioned private method getAbsolutePathFromRelativePath(). 

(And the call of filepath2URI(absoluteBase); from previous mentioned attachment can be ommitted).

Our application could avoid the occurence with overriding some classes. Or the xsl stylesheets should use absolute paths in xsl:include with correct URI. But these are only workarrounds. Clear sollution is the recommended above.

Best regards Tomas Kulhanek
Systinet Support Engineer


> xsl:include with relative href cause MalformedURL on unicode path
> -----------------------------------------------------------------
>
>          Key: XALANJ-2000
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-2000
>      Project: XalanJ2
>         Type: Bug
>     Versions: 2.6
>  Environment: Windows XP
>     Reporter: Tomas Kulhanek
>  Attachments: SystemIDResolver.diff
>
> xsl:include with relative href cause MalformedURL on unicode path.
> If the stylesheet contains <xsl:include> with relative reference and this reference is based on path with unicode characters the following is thrown when trying to tranform something by xalan command line:
> (Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: &#9532;Ö 
> Our application throws following stack trace:
> org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character:
> &#9532;Ö 
>         at org.apache.xml.utils.URI.initializePath(URI.java:799)
>         at org.apache.xml.utils.URI.initialize(URI.java:473)
>         at org.apache.xml.utils.URI.<init>(URI.java:231)
>         at org.apache.xml.utils.URI.<init>(URI.java:214)
>         at org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(SystemIDResolver
> .java:251)
>         at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInc
> lude.java:173)
>         at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetH
> andler.java:668)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
> arser.java:487)
> Looking deeper into the code the consequences (not the reason!) could be repaired by transforming URI unicode characters to %XX form.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2000) xsl:include with relative href cause MalformedURL on unicode path

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XALANJ-2000?page=comments#action_55995 ]
     
Henry Zongaro commented on XALANJ-2000:
---------------------------------------

The same MalformedURIException is produced if the URI is an absolute URI that contains characters that are not permitted in a URI.

I believe this should be considered an enhancement request.  Is there any reason why the base URI can't be corrected by the application so that it is a valid URI?

> xsl:include with relative href cause MalformedURL on unicode path
> -----------------------------------------------------------------
>
>          Key: XALANJ-2000
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-2000
>      Project: XalanJ2
>         Type: Bug
>     Versions: 2.6
>  Environment: Windows XP
>     Reporter: Tomas Kulhanek
>  Attachments: SystemIDResolver.diff
>
> xsl:include with relative href cause MalformedURL on unicode path.
> If the stylesheet contains <xsl:include> with relative reference and this reference is based on path with unicode characters the following is thrown when trying to tranform something by xalan command line:
> (Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: &#9532;Ö 
> Our application throws following stack trace:
> org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character:
> &#9532;Ö 
>         at org.apache.xml.utils.URI.initializePath(URI.java:799)
>         at org.apache.xml.utils.URI.initialize(URI.java:473)
>         at org.apache.xml.utils.URI.<init>(URI.java:231)
>         at org.apache.xml.utils.URI.<init>(URI.java:214)
>         at org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(SystemIDResolver
> .java:251)
>         at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInc
> lude.java:173)
>         at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetH
> andler.java:668)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
> arser.java:487)
> Looking deeper into the code the consequences (not the reason!) could be repaired by transforming URI unicode characters to %XX form.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2000) xsl:include with relative href cause MalformedURL on unicode path

Posted by "Tomas Kulhanek (JIRA)" <xa...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XALANJ-2000?page=history ]

Tomas Kulhanek updated XALANJ-2000:
-----------------------------------

    Attachment: SystemIDResolver.diff

SystemIDResolver.java difference file against original org\apache\xml\utils\SystemIDResolver.java of xalan-j_2_6_0 sources. This solves the one consequence (may be not the reason) of the bug.
The added method converts URI string with unicode characters to URI string with %XX where X could be '0'..'F'. This added method is called from getAbsoluteURI().


> xsl:include with relative href cause MalformedURL on unicode path
> -----------------------------------------------------------------
>
>          Key: XALANJ-2000
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-2000
>      Project: XalanJ2
>         Type: Bug
>     Versions: 2.6
>  Environment: Windows XP
>     Reporter: Tomas Kulhanek
>  Attachments: SystemIDResolver.diff
>
> xsl:include with relative href cause MalformedURL on unicode path.
> If the stylesheet contains <xsl:include> with relative reference and this reference is based on path with unicode characters the following is thrown when trying to tranform something by xalan command line:
> (Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: &#9532;Ö 
> Our application throws following stack trace:
> org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character:
> &#9532;Ö 
>         at org.apache.xml.utils.URI.initializePath(URI.java:799)
>         at org.apache.xml.utils.URI.initialize(URI.java:473)
>         at org.apache.xml.utils.URI.<init>(URI.java:231)
>         at org.apache.xml.utils.URI.<init>(URI.java:214)
>         at org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(SystemIDResolver
> .java:251)
>         at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInc
> lude.java:173)
>         at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetH
> andler.java:668)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
> arser.java:487)
> Looking deeper into the code the consequences (not the reason!) could be repaired by transforming URI unicode characters to %XX form.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Commented: (XALANJ-2000) xsl:include with relative href cause MalformedURL on unicode path

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XALANJ-2000?page=comments#action_56032 ]
     
Henry Zongaro commented on XALANJ-2000:
---------------------------------------

Your base URI contains characters that are not permitted in URIs, but no error is reported.  That is the real bug here.

However, Yash Talwar is looking at adding support for XML 1.1 to Xalan-Java.  That entails adding support for IRIs in various places.  IRIs are permitted to contain characters such as &#9532;, and are mapped to URIs using the usual %XX escaping.  That's why I regard this as an enhancement request.

> xsl:include with relative href cause MalformedURL on unicode path
> -----------------------------------------------------------------
>
>          Key: XALANJ-2000
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-2000
>      Project: XalanJ2
>         Type: Bug
>     Versions: 2.6
>  Environment: Windows XP
>     Reporter: Tomas Kulhanek
>  Attachments: SystemIDResolver.diff
>
> xsl:include with relative href cause MalformedURL on unicode path.
> If the stylesheet contains <xsl:include> with relative reference and this reference is based on path with unicode characters the following is thrown when trying to tranform something by xalan command line:
> (Location of error unknown)XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character: &#9532;Ö 
> Our application throws following stack trace:
> org.apache.xml.utils.URI$MalformedURIException: Path contains invalid character:
> &#9532;Ö 
>         at org.apache.xml.utils.URI.initializePath(URI.java:799)
>         at org.apache.xml.utils.URI.initialize(URI.java:473)
>         at org.apache.xml.utils.URI.<init>(URI.java:231)
>         at org.apache.xml.utils.URI.<init>(URI.java:214)
>         at org.apache.xml.utils.SystemIDResolver.getAbsoluteURI(SystemIDResolver
> .java:251)
>         at org.apache.xalan.processor.ProcessorInclude.startElement(ProcessorInc
> lude.java:173)
>         at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetH
> andler.java:668)
>         at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
> arser.java:487)
> Looking deeper into the code the consequences (not the reason!) could be repaired by transforming URI unicode characters to %XX form.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org