elena 2003/11/17 11:48:52
Modified: java/src/org/apache/xerces/dom ElementImpl.java
Log:
remove an extra check for getBaseURI computation
Revision Changes Path
1.63 +12 -27 xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java
Index: ElementImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/ElementImpl.java,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- ElementImpl.java 13 Nov 2003 22:47:15 -0000 1.62
+++ ElementImpl.java 17 Nov 2003 19:48:52 -0000 1.63
@@ -205,10 +205,10 @@
if (needsSyncData()) {
synchronizeData();
}
-
- //Absolute base URI is computed according to XML Base
(http://www.w3.org/TR/xmlbase/#granularity)
-
- //1. the base URI specified by an xml:base attribute on the element, if
one exists
+ // Absolute base URI is computed according to
+ // XML Base (http://www.w3.org/TR/xmlbase/#granularity)
+ // 1. The base URI specified by an xml:base attribute on the element,
+ // if one exists
if (attributes != null) {
Attr attrNode = (Attr)attributes.getNamedItem("xml:base");
if (attrNode != null) {
@@ -218,7 +218,6 @@
uri = new URI(uri).toString();
}
catch (org.apache.xerces.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
return null;
}
return uri;
@@ -226,37 +225,23 @@
}
}
- //2.the base URI of the element's parent element within the document or
external entity,
- //if one exists
-
- String parentElementBaseURI = (this.parentNode() != null) ?
this.parentNode().getBaseURI() : null ;
+ // 2.the base URI of the element's parent element within the
+ // document or external entity, if one exists
+ // 3. the base URI of the document entity or external entity
+ // containing the element
+
+ // ownerNode serves as a parent or as document
+ String baseURI = (this.ownerNode != null) ?
this.ownerNode.getBaseURI() : null ;
//base URI of parent element is not null
- if(parentElementBaseURI != null){
- try {
- //return valid absolute base URI
- return new URI(parentElementBaseURI).toString();
- }
- catch (org.apache.xerces.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
- return null;
- }
- }
- //3. the base URI of the document entity or external entity containing the
element
-
- //REVISIT: we are using ownerNode -- we need to return the base URI of the
document entity
- String baseURI = (this.ownerNode != null) ? this.ownerNode.getBaseURI() :
null ;
-
if(baseURI != null){
try {
//return valid absolute base URI
return new URI(baseURI).toString();
}
catch (org.apache.xerces.util.URI.MalformedURIException e){
- // REVISIT: what should happen in this case?
return null;
}
}
-
return null;
} //getBaseURI
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]