You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/10/25 03:50:40 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLEntity.java XMLEntityManager.java
andyc 00/10/24 18:50:40
Modified: java/src/org/apache/xerces/impl Tag: xerces_j_2
XMLEntityManager.java
Added: java/src/org/apache/xerces/impl Tag: xerces_j_2
XMLEntity.java
Log:
Added a way to query the current entity from the entity manager.
This is needed so that the scanners can make sure that the entity
that started a piece of XML is the same entity at the end of the
piece of XML. For example, the following should not be allowed:
(need to find exact place in spec where it states this error...)
<!ENTITY foo "<elem">
&foo;/>
So the document scanner would save the current entity when starting
to scan the start element and then check that against the current
entity after finishing looking at the end of the empty element tag.
If they match, everything is fine; if they don't match, then we
have a well-formedness error that signals that they were broken up.
(If this is not explicitly stated as a WFC in the spec, then we
can still issue a warning, but I believe that it's in the spec --
I will have to check it later.)
Revision Changes Path
No revision
No revision
1.1.2.37 +17 -2 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLEntityManager.java
Index: XMLEntityManager.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLEntityManager.java,v
retrieving revision 1.1.2.36
retrieving revision 1.1.2.37
diff -u -r1.1.2.36 -r1.1.2.37
--- XMLEntityManager.java 2000/10/24 00:13:47 1.1.2.36
+++ XMLEntityManager.java 2000/10/25 01:50:36 1.1.2.37
@@ -114,7 +114,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLEntityManager.java,v 1.1.2.36 2000/10/24 00:13:47 andyc Exp $
+ * @version $Id: XMLEntityManager.java,v 1.1.2.37 2000/10/25 01:50:36 andyc Exp $
*/
public class XMLEntityManager
implements XMLComponent {
@@ -546,6 +546,11 @@
return fEntityScanner;
} // getEntityScanner():XMLEntityScanner
+ /** Returns the currently active entity. */
+ public XMLEntity getCurrentEntity() {
+ return fCurrentEntity;
+ } // getCurrentEntity():XMLEntity
+
//
// XMLComponent methods
//
@@ -1109,7 +1114,8 @@
*
* @author Andy Clark, IBM
*/
- protected static abstract class Entity {
+ protected static abstract class Entity
+ implements XMLEntity {
//
// Data
@@ -1148,6 +1154,15 @@
public void setValues(Entity entity) {
name = entity.name;
} // setValues(Entity)
+
+ //
+ // XMLEntity methods
+ //
+
+ /** Returns the name of the entity. */
+ public String getName() {
+ return name;
+ } // getName():String
} // class Entity
No revision
No revision
1.1.2.1 +76 -0 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLEntity.java