You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2005/09/01 13:20:44 UTC
svn commit: r265700 -
/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java
Author: cam
Date: Thu Sep 1 04:20:37 2005
New Revision: 265700
URL: http://svn.apache.org/viewcvs?rev=265700&view=rev
Log:
1. Keeps the document URI in sync, whether it was set from
Document.setDocumentURI or SVGOMDocument.setURLObject.
Modified:
xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java
Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java?rev=265700&r1=265699&r2=265700&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/dom/svg/SVGOMDocument.java Thu Sep 1 04:20:37 2005
@@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;
import java.util.MissingResourceException;
@@ -198,7 +199,7 @@
* <b>DOM</b>: Implements {@link SVGDocument#getURL()}
*/
public String getURL() {
- return (url == null) ? null : url.toString();
+ return documentURI;
}
/**
@@ -213,6 +214,19 @@
*/
public void setURLObject(URL url) {
this.url = url;
+ documentURI = url == null ? null : url.toString();
+ }
+
+ /**
+ * <b>DOM</b>: Implements {@link org.w3c.dom.Document#setDocumentURI(String)}.
+ */
+ public void setDocumentURI(String uri) {
+ documentURI = uri;
+ try {
+ url = uri == null ? null : new URL(uri);
+ } catch (MalformedURLException ex) {
+ url = null;
+ }
}
/**