You are viewing a plain text version of this content. The canonical link for it is here.
Posted to crimson-cvs@xml.apache.org by ed...@apache.org on 2001/01/24 04:43:20 UTC
cvs commit: xml-crimson/src/org/apache/crimson/tree Doctype.java XmlDocument.java
edwingo 01/01/23 19:43:20
Modified: src/org/apache/crimson/tree Doctype.java XmlDocument.java
Log:
Implement DocumentType.cloneNode() and cleanup
Revision Changes Path
1.2 +14 -17 xml-crimson/src/org/apache/crimson/tree/Doctype.java
Index: Doctype.java
===================================================================
RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/tree/Doctype.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Doctype.java 2000/11/23 01:53:35 1.1
+++ Doctype.java 2001/01/24 03:43:19 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: Doctype.java,v 1.1 2000/11/23 01:53:35 edwingo Exp $
+ * $Id: Doctype.java,v 1.2 2001/01/24 03:43:19 edwingo Exp $
*
* The Apache Software License, Version 1.1
*
@@ -76,7 +76,7 @@
* for editor support, and is of dubious interest otherwise.
*
* @author David Brownell
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
final class Doctype extends NodeBase implements DocumentType
{
@@ -91,15 +91,9 @@
private String internalSubset;
- // XXX Obsolete remove this constructor and other obsolete ones too
- // package private
- Doctype (String n)
- {
- name = n;
- entities = new Nodemap ();
- notations = new Nodemap ();
- }
-
+ /**
+ * XXX Obsolete, but keep it for backwards compatibility
+ */
// package private
Doctype (String pub, String sys, String subset)
{
@@ -108,7 +102,9 @@
internalSubset = subset;
}
- // New DOM2 constructor
+ /**
+ * New DOM Level 2 constructor
+ */
// package private
Doctype(String name, String publicId, String systemId,
String internalSubset)
@@ -174,13 +170,14 @@
public String getNodeName ()
{ return name; }
- /** DOM: NYI
- * @deprecated Not yet implemented.
+ /**
+ * Only implement shallow clone for now, which is allowed in DOM Level 2.
*/
- public Node cloneNode (boolean deep)
+ public Node cloneNode(boolean deep)
{
-// XXX
- throw new RuntimeException (getMessage ("DT-000"));
+ Doctype retval = new Doctype(name, publicId, systemId, internalSubset);
+ retval.setOwnerDocument((XmlDocument)getOwnerDocument());
+ return retval;
}
/**
1.2 +2 -11 xml-crimson/src/org/apache/crimson/tree/XmlDocument.java
Index: XmlDocument.java
===================================================================
RCS file: /home/cvs/xml-crimson/src/org/apache/crimson/tree/XmlDocument.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XmlDocument.java 2000/11/23 01:53:34 1.1
+++ XmlDocument.java 2001/01/24 03:43:19 1.2
@@ -1,5 +1,5 @@
/*
- * $Id: XmlDocument.java,v 1.1 2000/11/23 01:53:34 edwingo Exp $
+ * $Id: XmlDocument.java,v 1.2 2001/01/24 03:43:19 edwingo Exp $
*
* The Apache Software License, Version 1.1
*
@@ -129,7 +129,7 @@
*
* @author David Brownell
* @author Rajiv Mordani
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class XmlDocument extends ParentNode implements DocumentEx
{
@@ -753,15 +753,6 @@
if (n instanceof DocumentType)
return (DocumentType) n;
}
- }
-
- // XXX Obsolete remove this method!
- // package private!!
- Doctype createDoctype (String name)
- {
- Doctype retval = new Doctype (name);
- retval.setOwnerDocument (this);
- return retval;
}
/**