[prev in list] [next in list] [prev in thread] [next in thread]
List: xerces-cvs
Subject: cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLEntityManager.java
From: sandygao () apache ! org
Date: 2002-01-31 15:17:56
[Download RAW message or body]
sandygao 02/01/31 07:17:56
Modified: java/src/org/apache/xerces/impl XMLEntityManager.java
Log:
Sometimes the system id was not (properly) expanded. Now we expand it
before calling the user-defined entity resolver.
Revision Changes Path
1.25 +13 -4 xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLEntityManager.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- XMLEntityManager.java 30 Jan 2002 01:41:18 -0000 1.24
+++ XMLEntityManager.java 31 Jan 2002 15:17:56 -0000 1.25
@@ -115,7 +115,7 @@
* @author Andy Clark, IBM
* @author Arnaud Le Hors, IBM
*
- * @version $Id: XMLEntityManager.java,v 1.24 2002/01/30 01:41:18 neilg Exp $
+ * @version $Id: XMLEntityManager.java,v 1.25 2002/01/31 15:17:56 sandygao Exp $
*/
public class XMLEntityManager
implements XMLComponent, XMLEntityResolver {
@@ -513,14 +513,23 @@
String expandedSystemId = resourceIdentifier.getExpandedSystemId();
// if no base systemId given, assume that it's relative
// to the systemId of the current scanned entity
+ // Sometimes the system id is not (properly) expanded.
+ // We need to expand the system id if:
+ // a. the expanded one was null; or
+ // b. the base system id was null, but becomes non-null from the current entity.
+ boolean needExpand = (expandedSystemId == null);
// REVISIT: why would the baseSystemId ever be null? if we
// didn't have to make this check we wouldn't have to reuse the
// fXMLResourceIdentifier object...
if (baseSystemId == null && fCurrentEntity != null && fCurrentEntity.entityLocation != null) {
baseSystemId = fCurrentEntity.entityLocation.getExpandedSystemId();
- }
-
- // give the entity resolver a chance
+ if (baseSystemId != null)
+ needExpand = true;
+ }
+ if (needExpand)
+ expandedSystemId = expandSystemId(literalSystemId, baseSystemId);
+
+ // give the entity resolver a chance
XMLInputSource xmlInputSource = null;
if (fEntityResolver != null) {
fResourceIdentifier.clear();
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic