dbertoni 01/08/28 08:34:52
Modified: c/src/XSLT XSLTEngineImpl.cpp
Log:
Protect URL resolution code with try/catch block.
Revision Changes Path
1.115 +21 -10 xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
Index: XSLTEngineImpl.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- XSLTEngineImpl.cpp 2001/08/27 14:55:31 1.114
+++ XSLTEngineImpl.cpp 2001/08/28 15:34:52 1.115
@@ -854,19 +854,30 @@
fragBase.getOwnerDocument();
assert(theOwnerDocument != 0);
- if (length(xmlBaseIdent) == 0)
+ // Catch any XMLExceptions thrown, since we may not
+ // be able to resolve the URL. In that case, the
+ // parser will throw an error. We do this because
+ // we don't know what sort of EntityResolvers might
+ // be active, so we never want to error out here.
+ try
{
- localXSLURLString =
- URISupport::getURLStringFromString(
- localXSLURLString,
-
m_xpathEnvSupport.findURIFromDoc(theOwnerDocument));
+ if (length(xmlBaseIdent) == 0)
+ {
+ localXSLURLString =
+
URISupport::getURLStringFromString(
+ localXSLURLString,
+
m_xpathEnvSupport.findURIFromDoc(theOwnerDocument));
+ }
+ else
+ {
+ localXSLURLString =
+
URISupport::getURLStringFromString(
+ localXSLURLString,
+ xmlBaseIdent);
+ }
}
- else
+ catch(const XMLException&)
{
- localXSLURLString =
- URISupport::getURLStringFromString(
- localXSLURLString,
- xmlBaseIdent);
}
if(isRoot)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]