From: <sju...@ko...> - 2006-07-31 07:47:47
|
Replying to myself: Den 28. jul. 2006 kl. 21.28 skrev Sjur N=F8rsteb=F8 Moshagen: > ... and the following item in the changelog > caught our attention: > > - Added important safeguard in XmldbURI to ensure that non-ASCII > chars are always encoded It relates to this change: Index: XmldbURI.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- XmldbURI.java (revision 3308) +++ XmldbURI.java (revision 3309) @@ -34,6 +34,7 @@ import org.exist.storage.DBBroker; import org.exist.xquery.Constants; import org.exist.xquery.util.URIUtils; +import org.exist.xquery.value.AnyURIValue; /** A utility class for xmldb URis. * Since, java.net.URI is <strong>final</strong> this class acts as =20= a wrapper. @@ -87,7 +88,7 @@ } public static XmldbURI xmldbUriFor(String xmldbURI) throws =20 URISyntaxException { - URI uri =3D new URI(xmldbURI); + URI uri =3D new URI(AnyURIValue.escape(xmldbURI)); if(isCollectionPathOnly(uri)) { return new XmldbURI(uri); } Reverting this change in the 1.0rc code base isn't enough - a Cocoon =20 error is thrown instead, indicating that the XIncludes were left =20 untouched by eXist, causing Cocoon to try to resolve references that =20 are internal to the eXist db, which of course fails. The error =20 reported by Cocoon is ironically about the URI containing illegal =20 characters:-) I'll have a look at the current trunk, and see if that one behaves =20 any better (but beware that I'm no Java guy, I'm just copying and =20 pasting, trying and failing:-) NOTE: the proper solution would probably be to always ensure proper =20 unescaping of escaped URIs, leaving the above escaping as is. Best regards, Sjur |