peiyongz 2004/05/25 11:11:47 Modified: c/src/xercesc/util XMLUri.cpp XMLUri.hpp Log: normalizeURI() added Revision Changes Path 1.25 +33 -1 xml-xerces/c/src/xercesc/util/XMLUri.cpp Index: XMLUri.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLUri.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- XMLUri.cpp 4 Feb 2004 13:14:15 -0000 1.24 +++ XMLUri.cpp 25 May 2004 18:11:46 -0000 1.25 @@ -1645,6 +1645,7 @@ return false; const XMLCh* tmpStr = uricString; + while (*tmpStr) { if (isReservedOrUnreservedCharacter(*tmpStr)) @@ -2541,6 +2542,37 @@ } //if (pathStrLen...) return true; +} + +/*** + * [Bug7698]: filenames with embedded spaces in schemaLocation strings not handled properly + * + * This method is called when Scanner/TraverseSchema knows that the URI reference is + * for local file. + * + ***/ +void XMLUri::normalizeURI(const XMLCh* const systemURI, + XMLBuffer& normalizedURI) +{ + const XMLCh* pszSrc = systemURI; + + normalizedURI.reset(); + + while (*pszSrc) { + + if ((*(pszSrc) == chPercent) + && (*(pszSrc+1) == chDigit_2) + && (*(pszSrc+2) == chDigit_0)) + { + pszSrc += 3; + normalizedURI.append(chSpace); + } + else + { + normalizedURI.append(*pszSrc); + pszSrc++; + } + } } /*** 1.17 +9 -1 xml-xerces/c/src/xercesc/util/XMLUri.hpp Index: XMLUri.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XMLUri.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- XMLUri.hpp 12 Jan 2004 22:01:02 -0000 1.16 +++ XMLUri.hpp 25 May 2004 18:11:47 -0000 1.17 @@ -57,6 +57,9 @@ /* * $Id$ * $Log$ + * Revision 1.17 2004/05/25 18:11:47 peiyongz + * normalizeURI() added + * * Revision 1.16 2004/01/12 22:01:02 cargilld * Minor performance change for handling reserved and unreserved characters. * @@ -147,6 +150,7 @@ #include <xercesc/util/XMLString.hpp> #include <xercesc/internal/XSerializable.hpp> +#include <xercesc/framework/XMLBuffer.hpp> XERCES_CPP_NAMESPACE_BEGIN @@ -418,6 +422,10 @@ */ static bool isValidURI( bool haveBaseURI , const XMLCh* const uriStr); + + + static void normalizeURI(const XMLCh* const systemURI, + XMLBuffer& normalizedURI); /*** * Support for Serialization/De-serialization
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]