venu 2003/11/17 05:48:41
Modified: java/src/org/apache/xerces/dom
CoreDOMImplementationImpl.java
CoreDocumentImpl.java DOMConfigurationImpl.java
DOMInputImpl.java DOMOutputImpl.java
java/src/org/apache/xerces/dom3/as DOMASBuilder.java
DOMASWriter.java
java/src/org/apache/xerces/impl/xs XMLSchemaLoader.java
java/src/org/apache/xerces/parsers AbstractDOMParser.java
DOMASBuilderImpl.java DOMParserImpl.java
java/src/org/apache/xerces/util
DOMEntityResolverWrapper.java
java/src/org/apache/xerces/xs DOMInputList.java
XSLoader.java
Log:
DOM3LS CR changes bug #24742 . Submitted by Ramesh Mandava
Revision Changes Path
1.28 +32 -30
xml-xerces/java/src/org/apache/xerces/dom/CoreDOMImplementationImpl.java
Index: CoreDOMImplementationImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDOMImplementationImpl.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- CoreDOMImplementationImpl.java 10 Nov 2003 10:08:44 -0000 1.27
+++ CoreDOMImplementationImpl.java 17 Nov 2003 13:48:40 -0000 1.28
@@ -65,11 +65,11 @@
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
import org.w3c.dom.Element;
-import org.w3c.dom.ls.DOMParser;
+import org.w3c.dom.ls.LSParser;
import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.DOMInput;
-import org.w3c.dom.ls.DOMOutput;
-import org.w3c.dom.ls.DOMSerializer;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSSerializer;
/**
* The DOMImplementation class is description of a particular
* implementation of the Document Object Model. As such its data is
@@ -294,24 +294,24 @@
// DOM L3 LS
/**
- * DOM Level 3 WD - Experimental.
- * Create a new <code>DOMParser</code>. The newly constructed parser may
+ * DOM Level 3 LS CR - Experimental.
+ * Create a new <code>LSParser</code>. The newly constructed parser may
* then be configured by means of its <code>DOMConfiguration</code>
* object, and used to parse documents by means of its <code>parse</code>
* method.
* @param mode The <code>mode</code> argument is either
* <code>MODE_SYNCHRONOUS</code> or <code>MODE_ASYNCHRONOUS</code>, if
* <code>mode</code> is <code>MODE_SYNCHRONOUS</code> then the
- * <code>DOMParser</code> that is created will operate in synchronous
+ * <code>LSParser</code> that is created will operate in synchronous
* mode, if it's <code>MODE_ASYNCHRONOUS</code> then the
- * <code>DOMParser</code> that is created will operate in asynchronous
+ * <code>LSParser</code> that is created will operate in asynchronous
* mode.
* @param schemaType An absolute URI representing the type of the schema
* language used during the load of a <code>Document</code> using the
- * newly created <code>DOMParser</code>. Note that no lexical checking
+ * newly created <code>LSParser</code>. Note that no lexical checking
* is done on the absolute URI. In order to create a
- * <code>DOMParser</code> for any kind of schema types (i.e. the
- * DOMParser will be free to use any schema found), use the value
+ * <code>LSParser</code> for any kind of schema types (i.e. the
+ * LSParser will be free to use any schema found), use the value
* <code>null</code>.
* <p ><b>Note:</b> For W3C XML Schema [<a
href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>]
* , applications must use the value
@@ -320,22 +320,22 @@
* <code>"http://www.w3.org/TR/REC-xml"</code>. Other Schema languages
* are outside the scope of the W3C and therefore should recommend an
* absolute URI in order to use this method.
- * @return The newly created <code>DOMParser</code> object. This
- * <code>DOMParser</code> is either synchronous or asynchronous
+ * @return The newly created <code>LSParser</code> object. This
+ * <code>LSParser</code> is either synchronous or asynchronous
* depending on the value of the <code>mode</code> argument.
- * <p ><b>Note:</b> By default, the newly created <code>DOMParser</code>
+ * <p ><b>Note:</b> By default, the newly created <code>LSParser</code>
* does not contain a <code>DOMErrorHandler</code>, i.e. the value of
* the "<a
href='http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030609/core.html#parameter-error-handler'>
* error-handler</a>" configuration parameter is <code>null</code>. However,
implementations
* may provide a default error handler at creation time. In that case,
* the initial value of the <code>"error-handler"</code> configuration
- * parameter on the new created <code>DOMParser</code> contains a
+ * parameter on the new created <code>LSParser</code> contains a
* reference to the default error handler.
* @exception DOMException
* NOT_SUPPORTED_ERR: Raised if the requested mode or schema type is
* not supported.
*/
- public DOMParser createDOMParser(short mode, String schemaType)
+ public LSParser createLSParser(short mode, String schemaType)
throws DOMException {
if (mode == DOMImplementationLS.MODE_ASYNCHRONOUS) {
String msg =
@@ -359,27 +359,27 @@
}
}
/**
- * DOM Level 3 WD - Experimental.
- * Create a new <code>DOMSerializer</code> object.
- * @return The newly created <code>DOMSerializer</code> object.
+ * DOM Level 3 LS CR - Experimental.
+ * Create a new <code>LSSerializer</code> object.
+ * @return The newly created <code>LSSerializer</code> object.
* <p ><b>Note:</b> By default, the newly created
- * <code>DOMSerializer</code> has no <code>DOMErrorHandler</code>,
+ * <code>LSSerializer</code> has no <code>DOMErrorHandler</code>,
* i.e. the value of the <code>"error-handler"</code> configuration
* parameter is <code>null</code>. However, implementations may
* provide a default error handler at creation time. In that case, the
* initial value of the <code>"error-handler"</code> configuration
- * parameter on the new created <code>DOMSerializer</code> contains a
+ * parameter on the new created <code>LSSerializer</code> contains a
* reference to the default error handler.
*/
- public DOMSerializer createDOMSerializer() {
+ public LSSerializer createLSSerializer() {
return new DOMSerializerImpl();
}
/**
- * DOM Level 3 WD - Experimental.
+ * DOM Level 3 LS CR - Experimental.
* Create a new empty input source.
* @return The newly created input object.
*/
- public DOMInput createDOMInput() {
+ public LSInput createLSInput() {
return new DOMInputImpl();
}
@@ -430,14 +430,16 @@
return ++docAndDoctypeCounter;
}
- /* DOM Level 3 WD - Experimental.
+ /* DOM Level 3 LS CR - Experimental.
*
- * Create a new empty output source.
+ * Create a new empty output destination object where
+ * <code>LSOutput.characterStream</code>,
+ * <code>LSOutput.byteStream</code>, <code>LSOutput.systemId</code>,
+ * <code>LSOutput.encoding</code> are null.
+
* @return The newly created output object.
- * - Gopal Sharma
- * TODO: Real wording should be collected from W3C next LS
*/
- public DOMOutput createDOMOutput() {
+ public LSOutput createLSOutput() {
return new DOMOutputImpl();
}
1.59 +6 -7 xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java
Index: CoreDocumentImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/CoreDocumentImpl.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- CoreDocumentImpl.java 17 Nov 2003 10:53:07 -0000 1.58
+++ CoreDocumentImpl.java 17 Nov 2003 13:48:40 -0000 1.59
@@ -87,8 +87,7 @@
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.DOMSerializer;
-import org.w3c.dom.ls.DocumentLS;
+import org.w3c.dom.ls.LSSerializer;
/**
* The Document interface represents the entire HTML or XML document.
@@ -118,7 +117,7 @@
public class CoreDocumentImpl
-extends ParentNode implements Document, DocumentLS {
+extends ParentNode implements Document {
/**TODO::
* 1. Change XML11Char method names similar to XMLChar. That will prevent lot
@@ -1219,10 +1218,10 @@
* DOM Level 3 WD - Experimental.
* Save the document or the given node and all its descendants to a string
* (i.e. serialize the document or node).
- * <br>The parameters used in the <code>DOMSerializer</code> interface are
+ * <br>The parameters used in the <code>LSSerializer</code> interface are
* assumed to have their default values when invoking this method.
* <br> The result of a call to this method is the same the result of a
- * call to <code>DOMSerializer.writeToString</code> with the document as
+ * call to <code>LSSerializer.writeToString</code> with the document as
* the node to write.
* @param node Specifies what to serialize, if this parameter is
* <code>null</code> the whole document is serialized, if it's
@@ -1241,7 +1240,7 @@
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, msg);
}
DOMImplementationLS domImplLS =
(DOMImplementationLS)DOMImplementationImpl.getDOMImplementation();
- DOMSerializer xmlWriter = domImplLS.createDOMSerializer();
+ LSSerializer xmlWriter = domImplLS.createLSSerializer();
if (node == null) {
node = this;
}
1.13 +5 -5
xml-xerces/java/src/org/apache/xerces/dom/DOMConfigurationImpl.java
Index: DOMConfigurationImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMConfigurationImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DOMConfigurationImpl.java 14 Nov 2003 23:56:05 -0000 1.12
+++ DOMConfigurationImpl.java 17 Nov 2003 13:48:40 -0000 1.13
@@ -90,7 +90,7 @@
import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xni.parser.XMLParserConfiguration;
import org.w3c.dom.DOMException;
-import org.w3c.dom.ls.DOMResourceResolver;
+import org.w3c.dom.ls.LSResourceResolver;
@@ -649,9 +649,9 @@
}
}
else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof DOMResourceResolver) {
+ if (value instanceof LSResourceResolver) {
try {
- setEntityResolver(new
DOMEntityResolverWrapper((DOMResourceResolver) value));
+ setEntityResolver(new
DOMEntityResolverWrapper((LSResourceResolver) value));
}
catch (XMLConfigurationException e) {}
}
@@ -926,7 +926,7 @@
return (value instanceof DOMErrorHandler) ? true : false ;
}
else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- return (value instanceof DOMResourceResolver) ? true : false ;
+ return (value instanceof LSResourceResolver) ? true : false ;
}
else if (name.equals(Constants.DOM_SCHEMA_LOCATION)) {
return (value instanceof String) ? true : false ;
1.2 +12 -12 xml-xerces/java/src/org/apache/xerces/dom/DOMInputImpl.java
Index: DOMInputImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMInputImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMInputImpl.java 30 Jul 2003 13:38:53 -0000 1.1
+++ DOMInputImpl.java 17 Nov 2003 13:48:40 -0000 1.2
@@ -57,7 +57,7 @@
package org.apache.xerces.dom;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSInput;
import java.io.Reader;
import java.io.InputStream;
@@ -74,16 +74,16 @@
* source to the parser: as the argument to the <code>parse</code> method,
* or as the return value of the <code>DOMResourceResolver.resolveEntity</code>
* method.
- * <p> The <code>DOMParser</code> will use the <code>DOMInput</code>
+ * <p> The <code>DOMParser</code> will use the <code>LSInput</code>
* object to determine how to read XML input. If there is a character stream
* available, the parser will read that stream directly; if not, the parser
* will use a byte stream, if available; if neither a character stream nor a
* byte stream is available, the parser will attempt to open a URI
* connection to the resource identified by the system identifier.
- * <p> An <code>DOMInput</code> object belongs to the application: the
+ * <p> An <code>LSInput</code> object belongs to the application: the
* parser shall never modify it in any way (it may modify a copy if
* necessary). Eventhough all attributes in this interface are writable the
- * DOM implementation is expected to never mutate a DOMInput.
+ * DOM implementation is expected to never mutate a LSInput.
* <p>See also the <a
href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model
(DOM) Level 3 Abstract Schemas and Load
and Save Specification</a>.
*
@@ -94,10 +94,10 @@
// REVISIT:
// 1. it should be possible to do the following
-// DOMInputImpl extends XMLInputSource implements DOMInput
+// DOMInputImpl extends XMLInputSource implements LSInput
// 2. we probably need only the default constructor. -- el
-public class DOMInputImpl implements DOMInput {
+public class DOMInputImpl implements LSInput {
//
// Data
@@ -113,7 +113,7 @@
protected String fEncoding = null;
- protected boolean fCertified = false;
+ protected boolean fCertifiedText = false;
/**
* Default Constructor, constructs an input source
@@ -411,8 +411,8 @@
* in [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML 1.1</a>])
when
* parsing [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML
1.1</a>].
*/
- public boolean getCertified(){
- return fCertified;
+ public boolean getCertifiedText(){
+ return fCertifiedText;
}
/**
@@ -421,8 +421,8 @@
* parsing [<a href='http://www.w3.org/TR/2002/CR-xml11-20021015/'>XML
1.1</a>].
*/
- public void setCertified(boolean certified){
- fCertified = certified;
+ public void setCertifiedText(boolean certifiedText){
+ fCertifiedText = certifiedText;
}
}// class DOMInputImpl
1.2 +9 -9 xml-xerces/java/src/org/apache/xerces/dom/DOMOutputImpl.java
Index: DOMOutputImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMOutputImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMOutputImpl.java 30 Jul 2003 13:38:53 -0000 1.1
+++ DOMOutputImpl.java 17 Nov 2003 13:48:40 -0000 1.2
@@ -57,7 +57,7 @@
package org.apache.xerces.dom;
-import org.w3c.dom.ls.DOMOutput;
+import org.w3c.dom.ls.LSOutput;
import java.io.Writer;
import java.io.OutputStream;
@@ -72,16 +72,16 @@
* The application is expected to provide objects that implement this interface
* whenever such objects are needed. The application can either provide its
* own objects that implement this interface, or it can use the generic factory
- * method DOMImplementationLS.createDOMOutput() to create objects that
+ * method DOMImplementationLS.createLSOutput() to create objects that
* implement this interface.
- * The DOMSerializer will use the DOMOutput object to determine where to
+ * The DOMSerializer will use the LSOutput object to determine where to
* serialize the output to. The DOMSerializer will look at the different
- * outputs specified in the DOMOutput in the following order to know which one
+ * outputs specified in the LSOutput in the following order to know which one
* to output to, the first one that data can be output to will be used:
- * 1.DOMOutput.characterStream
- * 2.DOMOutput.byteStream
- * 3.DOMOutput.systemId
- * DOMOutput objects belong to the application. The DOM implementation will
+ * 1.LSOutput.characterStream
+ * 2.LSOutput.byteStream
+ * 3.LSOutput.systemId
+ * LSOutput objects belong to the application. The DOM implementation will
* never modify them (though it may make copies and modify the copies,
* if necessary).
*
@@ -90,7 +90,7 @@
* @author Gopal Sharma, Sun Microsystems
**/
-public class DOMOutputImpl implements DOMOutput {
+public class DOMOutputImpl implements LSOutput {
protected Writer fCharStream = null;
protected OutputStream fByteStream = null;
1.5 +8 -8 xml-xerces/java/src/org/apache/xerces/dom3/as/DOMASBuilder.java
Index: DOMASBuilder.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom3/as/DOMASBuilder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DOMASBuilder.java 30 Jul 2003 10:30:35 -0000 1.4
+++ DOMASBuilder.java 17 Nov 2003 13:48:41 -0000 1.5
@@ -12,8 +12,8 @@
package org.apache.xerces.dom3.as;
-import org.w3c.dom.ls.DOMInput;
-import org.w3c.dom.ls.DOMParser;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSParser;
/**
* @deprecated
@@ -23,9 +23,9 @@
* <p>See also the <a
href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model
(DOM) Level 3 Abstract Schemas and Load
and Save Specification</a>.
*/
-public interface DOMASBuilder extends DOMParser {
+public interface DOMASBuilder extends LSParser {
/**
- * Associate an <code>ASModel</code> with a <code>DOMParser</code>. This
+ * Associate an <code>ASModel</code> with a <code>LSParser</code>. This
* <code>ASModel</code> will be used by the "
* <code>validate-if-schema</code>" and "
* <code>datatype-normalization</code>" options during the load of a new
@@ -33,7 +33,7 @@
*/
public ASModel getAbstractSchema();
/**
- * Associate an <code>ASModel</code> with a <code>DOMParser</code>. This
+ * Associate an <code>ASModel</code> with a <code>LSParser</code>. This
* <code>ASModel</code> will be used by the "
* <code>validate-if-schema</code>" and "
* <code>datatype-normalization</code>" options during the load of a new
@@ -68,8 +68,8 @@
/**
* Parse a Abstract Schema from a location identified by an
- * <code>DOMInput</code>.
- * @param is The <code>DOMInput</code> from which the source
+ * <code>LSInput</code>.
+ * @param is The <code>LSInput</code> from which the source
* Abstract Schema is to be read.
* @return The newly created <code>ASModel</code>.
* @exception DOMASException
@@ -90,7 +90,7 @@
* system error occurs during the parse, but application defined error
* handlers are not required to do so.
*/
- public ASModel parseASInputSource(DOMInput is)
+ public ASModel parseASInputSource(LSInput is)
throws DOMASException, Exception;
}
1.5 +3 -3 xml-xerces/java/src/org/apache/xerces/dom3/as/DOMASWriter.java
Index: DOMASWriter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom3/as/DOMASWriter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DOMASWriter.java 30 Jul 2003 10:30:35 -0000 1.4
+++ DOMASWriter.java 17 Nov 2003 13:48:41 -0000 1.5
@@ -12,7 +12,7 @@
package org.apache.xerces.dom3.as;
-import org.w3c.dom.ls.DOMSerializer;
+import org.w3c.dom.ls.LSSerializer;
/**
* @deprecated
@@ -26,11 +26,11 @@
* Abstract Schema. DOMASWriter is applied to serialize a single Abstract
* Schema. Serializing a document with an active Internal Abstract Schema
* will serialize this internal Abstract Schema with the document as it is
- * part of the Document (see <code>DOMSerializer</code>).
+ * part of the Document (see <code>LSSerializer</code>).
* <p>See also the <a
href='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model
(DOM) Level 3 Abstract Schemas and Load
and Save Specification</a>.
*/
-public interface DOMASWriter extends DOMSerializer {
+public interface DOMASWriter extends LSSerializer {
/**
* Write out the specified Abstract Schema to the specified destination.
* Does it write a DTD or an XML Schema (or something else)? Is it
1.21 +6 -6
xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
Index: XMLSchemaLoader.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- XMLSchemaLoader.java 14 Nov 2003 19:35:53 -0000 1.20
+++ XMLSchemaLoader.java 17 Nov 2003 13:48:41 -0000 1.21
@@ -105,7 +105,7 @@
import org.apache.xerces.xs.XSLoader;
import org.apache.xerces.xs.XSModel;
import org.w3c.dom.DOMException;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSInput;
import org.xml.sax.InputSource;
/**
@@ -1011,9 +1011,9 @@
}
/* (non-Javadoc)
- * @see org.apache.xerces.xs.XSLoader#load(org.w3c.dom.ls.DOMInput)
+ * @see org.apache.xerces.xs.XSLoader#load(org.w3c.dom.ls.LSInput)
*/
- public XSModel load(DOMInput is) {
+ public XSModel load(LSInput is) {
try {
Grammar g = loadGrammar(dom2xmlInputSource(is));
return ((XSGrammar) g).toXSModel();
@@ -1240,8 +1240,8 @@
}
- private XMLInputSource dom2xmlInputSource(DOMInput is) {
- // need to wrap the DOMInput with an XMLInputSource
+ private XMLInputSource dom2xmlInputSource(LSInput is) {
+ // need to wrap the LSInput with an XMLInputSource
XMLInputSource xis = null;
// if there is a string data, use a StringReader
// according to DOM, we need to treat such data as "UTF-16".
1.98 +28 -28
xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
Index: AbstractDOMParser.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- AbstractDOMParser.java 13 Nov 2003 22:47:16 -0000 1.97
+++ AbstractDOMParser.java 17 Nov 2003 13:48:41 -0000 1.98
@@ -105,7 +105,7 @@
import org.w3c.dom.NodeList;
import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text;
-import org.w3c.dom.ls.DOMParserFilter;
+import org.w3c.dom.ls.LSParserFilter;
import org.w3c.dom.traversal.NodeFilter;
/**
@@ -279,7 +279,7 @@
protected boolean fFirstChunk = false;
- /** DOMParserFilter: specifies that element with given QNAME and all its
children
+ /** LSParserFilter: specifies that element with given QNAME and all its children
must be rejected */
protected boolean fFilterReject = false;
@@ -289,10 +289,10 @@
protected Stack fBaseURIStack = new Stack();
- /** DOMParserFilter: the QNAME of rejected element*/
+ /** LSParserFilter: the QNAME of rejected element*/
protected final QName fRejectedElement = new QName();
- /** DOMParserFilter: store qnames of skipped elements*/
+ /** LSParserFilter: store qnames of skipped elements*/
protected Stack fSkippedElemStack = null;
/** Attribute QName. */
@@ -300,7 +300,7 @@
// handlers
- protected DOMParserFilter fDOMFilter = null;
+ protected LSParserFilter fDOMFilter = null;
//
// Constructors
@@ -625,16 +625,16 @@
(fDOMFilter.getWhatToShow() & NodeFilter.SHOW_COMMENT)!= 0) {
short code = fDOMFilter.acceptNode(comment);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of the
document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
// REVISIT: the constant FILTER_REJECT should be changed
when new
// DOM LS specs gets published
// fall through to SKIP since comment has no children.
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
// REVISIT: the constant FILTER_SKIP should be changed when
new
// DOM LS specs gets published
fCurrentNode.removeChild(comment);
@@ -707,13 +707,13 @@
(fDOMFilter.getWhatToShow() &
NodeFilter.SHOW_PROCESSING_INSTRUCTION)!= 0) {
short code = fDOMFilter.acceptNode(pi);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of the
document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
// fall through to SKIP since PI has no children.
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
fCurrentNode.removeChild(pi);
// fFirstChunk must be set to true so that data
// won't be lost in the case where the child before PI is
@@ -1004,15 +1004,15 @@
if (fDOMFilter != null) {
short code = fDOMFilter.startElement(el);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of the
document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
fFilterReject = true;
fRejectedElement.setValues(element);
return;
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
fSkippedElemStack.push(element);
return;
}
@@ -1286,16 +1286,16 @@
if ((fDOMFilter.getWhatToShow() & NodeFilter.SHOW_ELEMENT)!=0) {
short code = fDOMFilter.acceptNode(fCurrentNode);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of
the document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
Node parent = fCurrentNode.getParentNode();
parent.removeChild(fCurrentNode);
fCurrentNode = parent;
return;
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
// make sure that if any char data is available
// the fFirstChunk is true, so that if the next event
// is characters(), and the last node is text, we will
copy
@@ -1376,13 +1376,13 @@
(fDOMFilter.getWhatToShow() & NodeFilter.SHOW_CDATA_SECTION)!=
0) {
short code = fDOMFilter.acceptNode(fCurrentCDATASection);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of
the document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
// fall through to SKIP since CDATA section has no
children.
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
Node parent = fCurrentNode.getParentNode();
parent.removeChild(fCurrentCDATASection);
fCurrentNode = parent;
@@ -1489,17 +1489,17 @@
(fDOMFilter.getWhatToShow() &
NodeFilter.SHOW_ENTITY_REFERENCE)!= 0) {
short code = fDOMFilter.acceptNode(fCurrentNode);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of
the document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
Node parent = fCurrentNode.getParentNode();
parent.removeChild(fCurrentNode);
fCurrentNode = parent;
return;
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
// make sure we don't loose chars if next event is
characters()
fFirstChunk = true;
removeEntityRef = true;
@@ -2537,13 +2537,13 @@
if ((fDOMFilter.getWhatToShow() & NodeFilter.SHOW_TEXT)!= 0) {
short code = fDOMFilter.acceptNode(child);
switch (code) {
- case DOMParserFilter.FILTER_INTERRUPT:{
+ case LSParserFilter.FILTER_INTERRUPT:{
throw new RuntimeException("The normal processing of
the document was interrupted.");
}
- case DOMParserFilter.FILTER_REJECT:{
+ case LSParserFilter.FILTER_REJECT:{
// fall through to SKIP since Comment has no children.
}
- case DOMParserFilter.FILTER_SKIP: {
+ case LSParserFilter.FILTER_SKIP: {
fCurrentNode.removeChild(child);
return;
}
@@ -2559,7 +2559,7 @@
/**
- * @see org.w3c.dom.ls.DOMParser#abort()
+ * @see org.w3c.dom.ls.LSParser#abort()
*/
public void abort() {
throw new RuntimeException();
1.24 +6 -6
xml-xerces/java/src/org/apache/xerces/parsers/DOMASBuilderImpl.java
Index: DOMASBuilderImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMASBuilderImpl.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- DOMASBuilderImpl.java 30 Jul 2003 10:30:36 -0000 1.23
+++ DOMASBuilderImpl.java 17 Nov 2003 13:48:41 -0000 1.24
@@ -72,7 +72,7 @@
import org.apache.xerces.xni.grammars.Grammar;
import org.apache.xerces.xni.grammars.XMLGrammarPool;
import org.apache.xerces.xni.parser.XMLInputSource;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSInput;
/**
* This is Abstract Schema DOM Builder class. It extends the DOMParserImpl
@@ -233,9 +233,9 @@
/**
* Parse a Abstract Schema from a location identified by an
- * <code>DOMInput</code>.
+ * <code>LSInput</code>.
*
- * @param is The <code>DOMInput</code> from which the source
+ * @param is The <code>LSInput</code> from which the source
* Abstract Schema is to be read.
* @return The newly created <code>ASModel</code>.
* @exception DOMASException
@@ -256,10 +256,10 @@
* system error occurs during the parse, but application defined error
* handlers are not required to do so.
*/
- public ASModel parseASInputSource(DOMInput is)
+ public ASModel parseASInputSource(LSInput is)
throws DOMASException, Exception {
- // need to wrap the DOMInput with an XMLInputSource
+ // need to wrap the LSInput with an XMLInputSource
XMLInputSource xis = this.dom2xmlInputSource(is);
try {
return parseASInputSource(xis);
1.6 +23 -23 xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java
Index: DOMParserImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DOMParserImpl.java 14 Nov 2003 23:56:05 -0000 1.5
+++ DOMParserImpl.java 17 Nov 2003 13:48:41 -0000 1.6
@@ -81,10 +81,10 @@
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
-import org.w3c.dom.ls.DOMParser;
-import org.w3c.dom.ls.DOMParserFilter;
-import org.w3c.dom.ls.DOMResourceResolver;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSParserFilter;
+import org.w3c.dom.ls.LSResourceResolver;
+import org.w3c.dom.ls.LSInput;
/**
@@ -100,7 +100,7 @@
public class DOMParserImpl
-extends AbstractDOMParser implements DOMParser, DOMConfiguration {
+extends AbstractDOMParser implements LSParser, DOMConfiguration {
@@ -140,7 +140,7 @@
// REVISIT: this value should be null by default and should be set during
creation of
- // DOMParser
+ // LSParser
protected String fSchemaType = null;
protected boolean fBusy = false;
@@ -291,7 +291,7 @@
* the document is being validated when it's loaded the validation
* happens before the filter is called.
*/
- public DOMParserFilter getFilter() {
+ public LSParserFilter getFilter() {
return fDOMFilter;
}
@@ -304,7 +304,7 @@
* the document is being validated when it's loaded the validation
* happens before the filter is called.
*/
- public void setFilter(DOMParserFilter filter) {
+ public void setFilter(LSParserFilter filter) {
fDOMFilter = filter;
if (fSkippedElemStack == null) {
fSkippedElemStack = new Stack();
@@ -420,9 +420,9 @@
}
else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof DOMResourceResolver) {
+ if (value instanceof LSResourceResolver) {
try {
- fConfiguration.setProperty(ENTITY_RESOLVER, new
DOMEntityResolverWrapper((DOMResourceResolver) value));
+ fConfiguration.setProperty(ENTITY_RESOLVER, new
DOMEntityResolverWrapper((LSResourceResolver) value));
}
catch (XMLConfigurationException e) {}
}
@@ -677,7 +677,7 @@
return false;
}
else if (name.equals(Constants.DOM_RESOURCE_RESOLVER)) {
- if (value instanceof DOMResourceResolver) {
+ if (value instanceof LSResourceResolver) {
return true;
}
return false;
@@ -746,12 +746,12 @@
/**
* Parse an XML document from a resource identified by an
- * <code>DOMInput</code>.
+ * <code>LSInput</code>.
*
*/
- public Document parse(DOMInput is) {
+ public Document parse(LSInput is) {
- // need to wrap the DOMInput with an XMLInputSource
+ // need to wrap the LSInput with an XMLInputSource
XMLInputSource xmlInputSource = dom2xmlInputSource(is);
fBusy = true;
@@ -777,12 +777,12 @@
/**
* Parse an XML document or fragment from a resource identified by an
- * <code>DOMInput</code> and insert the content into an existing
+ * <code>LSInput</code> and insert the content into an existing
* document at the position epcified with the <code>contextNode</code>
* and <code>action</code> arguments. When parsing the input stream the
* context node is used for resolving unbound namespace prefixes.
*
- * @param is The <code>DOMInput</code> from which the source
+ * @param is The <code>LSInput</code> from which the source
* document is to be read.
* @param cnode The <code>Node</code> that is used as the context for
* the data that is being parsed.
@@ -794,7 +794,7 @@
* HIERARCHY_REQUEST_ERR: Thrown if this action results in an invalid
* hierarchy (i.e. a Document with more than one document element).
*/
- public Node parseWithContext(DOMInput is, Node cnode,
+ public Node parseWithContext(LSInput is, Node cnode,
short action) throws DOMException {
// REVISIT: need to implement.
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Not supported");
@@ -802,13 +802,13 @@
/**
- * NON-DOM: convert DOMInput to XNIInputSource
+ * NON-DOM: convert LSInput to XNIInputSource
*
* @param is
* @return
*/
- XMLInputSource dom2xmlInputSource(DOMInput is) {
- // need to wrap the DOMInput with an XMLInputSource
+ XMLInputSource dom2xmlInputSource(LSInput is) {
+ // need to wrap the LSInput with an XMLInputSource
XMLInputSource xis = null;
// if there is a string data, use a StringReader
// according to DOM, we need to treat such data as "UTF-16".
@@ -840,14 +840,14 @@
}
/**
- * @see org.w3c.dom.ls.DOMParser#getAsync()
+ * @see org.w3c.dom.ls.LSParser#getAsync()
*/
public boolean getAsync() {
return false;
}
/**
- * @see org.w3c.dom.ls.DOMParser#getBusy()
+ * @see org.w3c.dom.ls.LSParser#getBusy()
*/
public boolean getBusy() {
return fBusy;
1.7 +20 -15
xml-xerces/java/src/org/apache/xerces/util/DOMEntityResolverWrapper.java
Index: DOMEntityResolverWrapper.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/util/DOMEntityResolverWrapper.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- DOMEntityResolverWrapper.java 30 Jul 2003 13:38:53 -0000 1.6
+++ DOMEntityResolverWrapper.java 17 Nov 2003 13:48:41 -0000 1.7
@@ -63,8 +63,8 @@
import org.apache.xerces.xni.parser.XMLEntityResolver;
import org.apache.xerces.xni.parser.XMLInputSource;
-import org.w3c.dom.ls.DOMResourceResolver;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSResourceResolver;
+import org.w3c.dom.ls.LSInput;
import java.io.InputStream;
import java.io.IOException;
@@ -74,10 +74,11 @@
/**
* This class wraps DOM entity resolver to XNI entity resolver.
*
- * @see DOMResourceResolver
+ * @see LSResourceResolver
*
* @author Gopal Sharma, SUN MicroSystems Inc.
* @author Elena Litani, IBM
+ * @author Ramesh Mandava, Sun Microsystems
* @version $Id$
*/
public class DOMEntityResolverWrapper
@@ -87,8 +88,11 @@
// Data
//
+ /** XML 1.0 type constant according to DOM L3 LS CR spec
"http://www.w3.org/TR/2003/CR-DOM-Level-3-LS-20031107" */
+ private static final String XML_TYPE="http://www.w3.org/TR/REC-xml";
+
/** The DOM entity resolver. */
- protected DOMResourceResolver fEntityResolver;
+ protected LSResourceResolver fEntityResolver;
//
// Constructors
@@ -98,23 +102,23 @@
public DOMEntityResolverWrapper() {}
/** Wraps the specified DOM entity resolver. */
- public DOMEntityResolverWrapper(DOMResourceResolver entityResolver) {
+ public DOMEntityResolverWrapper(LSResourceResolver entityResolver) {
setEntityResolver(entityResolver);
- } // DOMResourceResolver
+ } // LSResourceResolver
//
// Public methods
//
/** Sets the DOM entity resolver. */
- public void setEntityResolver(DOMResourceResolver entityResolver) {
+ public void setEntityResolver(LSResourceResolver entityResolver) {
fEntityResolver = entityResolver;
- } // setEntityResolver(DOMResourceResolver)
+ } // setEntityResolver(LSResourceResolver)
/** Returns the DOM entity resolver. */
- public DOMResourceResolver getEntityResolver() {
+ public LSResourceResolver getEntityResolver() {
return fEntityResolver;
- } // getEntityResolver():DOMResourceResolver
+ } // getEntityResolver():LSResourceResolver
//
// XMLEntityResolver methods
@@ -131,14 +135,15 @@
*/
public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier)
throws XNIException, IOException {
-
// resolve entity using DOM entity resolver
if (fEntityResolver != null) {
try {
- DOMInput inputSource =
+ // For entity resolution the type of the resource would be XML TYPE
+ // DOM L3 LS spec mention only the XML 1.0 recommendation right now
+ LSInput inputSource =
resourceIdentifier == null ?
- fEntityResolver.resolveResource(null, null, null) :
-
fEntityResolver.resolveResource(resourceIdentifier.getPublicId(),
resourceIdentifier.getLiteralSystemId(), resourceIdentifier.getBaseSystemId());
+ fEntityResolver.resolveResource(null, null, null, null, null) :
+ fEntityResolver.resolveResource( XML_TYPE,
resourceIdentifier.getNamespace(), resourceIdentifier.getPublicId(),
resourceIdentifier.getLiteralSystemId(), resourceIdentifier.getBaseSystemId());
if (inputSource != null) {
String publicId = inputSource.getPublicId();
String systemId = inputSource.getSystemId();
1.2 +5 -5 xml-xerces/java/src/org/apache/xerces/xs/DOMInputList.java
Index: DOMInputList.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xs/DOMInputList.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMInputList.java 12 Nov 2003 23:17:34 -0000 1.1
+++ DOMInputList.java 17 Nov 2003 13:48:41 -0000 1.2
@@ -57,16 +57,16 @@
package org.apache.xerces.xs;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSInput;
/**
* The <code>DOMInputList</code> interface provides the abstraction of an
- * ordered collection of <code>DOMInput</code>s, without defining or
+ * ordered collection of <code>LSInput</code>s, without defining or
* constraining how this collection is implemented.
*/
public interface DOMInputList {
/**
- * The number of <code>DOMInput</code>s in the list. The range of valid
+ * The number of <code>LSInput</code>s in the list. The range of valid
* child object indices is 0 to <code>length-1</code> inclusive.
*/
public int getLength();
@@ -76,10 +76,10 @@
* <code>null</code> if <code>index</code> is greater than or equal to
* the number of objects in the list. The index starts at 0.
* @param index index into the collection.
- * @return The <code>DOMInput</code> at the <code>index</code>th
+ * @return The <code>LSInput</code> at the <code>index</code>th
* position in the <code>DOMInputList</code>, or <code>null</code> if
* the index specified is not valid.
*/
- public DOMInput item(int index);
+ public LSInput item(int index);
}
1.3 +5 -5 xml-xerces/java/src/org/apache/xerces/xs/XSLoader.java
Index: XSLoader.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xs/XSLoader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XSLoader.java 14 Nov 2003 19:33:19 -0000 1.2
+++ XSLoader.java 17 Nov 2003 13:48:41 -0000 1.3
@@ -58,7 +58,7 @@
package org.apache.xerces.xs;
import org.apache.xerces.dom3.DOMConfiguration;
-import org.w3c.dom.ls.DOMInput;
+import org.w3c.dom.ls.LSInput;
/**
* An interface that provides a method to load XML Schema documents. This
@@ -102,8 +102,8 @@
/**
* Parses the content of XML Schema documents specified as a list of
- * <code>DOMInput</code>s.
- * @param is The list of <code>DOMInput</code>s from which the XML
+ * <code>LSInput</code>s.
+ * @param is The list of <code>LSInput</code>s from which the XML
* Schema documents are to be read.
* @return An XSModel representing schema documents.
*/
@@ -120,11 +120,11 @@
/**
* Parse an XML Schema document from a resource identified by a
- * <code>DOMInput</code> .
+ * <code>LSInput</code> .
* @param is The <code>DOMInputSource</code> from which the source
* document is to be read.
* @return An XSModel representing this schema.
*/
- public XSModel load(DOMInput is);
+ public XSModel load(LSInput is);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]