You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ar...@locus.apache.org on 2000/02/08 02:20:05 UTC
cvs commit: xml-xerces/java/src/org/apache/xml/serialize Serializer.java BaseMarkupSerializer.java
arkin 00/02/07 17:20:05
Modified: java/src/org/apache/xml/serialize Serializer.java
BaseMarkupSerializer.java
Log:
Added SAX2 interfaces, no support yet
Revision Changes Path
1.5 +12 -0 xml-xerces/java/src/org/apache/xml/serialize/Serializer.java
Index: Serializer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/Serializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Serializer.java 2000/01/03 19:38:50 1.4
+++ Serializer.java 2000/02/08 01:20:04 1.5
@@ -67,6 +67,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Document;
import org.xml.sax.DocumentHandler;
+import org.xml.sax.ContentHandler;
/**
@@ -101,6 +102,7 @@
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @author <a href="mailto:Scott_Boag/CAM/Lotus@lotus.com">Scott Boag</a>
* @see DocumentHandler
+ * @see ContentHandler
* @see OutputFormat
* @see DOMSerializer
*/
@@ -143,6 +145,16 @@
* interface, it should return null.
*/
public DocumentHandler asDocumentHandler();
+
+
+ /**
+ * Return a {@link ContentHandler} interface into this serializer.
+ * If the serializer does not support the {@link ContentHandler}
+ * interface, it should return null.
+ */
+ /*
+ public ContentHandler asContentHandler();
+ */
/**
1.9 +59 -7 xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java
Index: BaseMarkupSerializer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/BaseMarkupSerializer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BaseMarkupSerializer.java 2000/02/05 02:24:15 1.8
+++ BaseMarkupSerializer.java 2000/02/08 01:20:04 1.9
@@ -69,8 +69,10 @@
import org.xml.sax.DTDHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
-import org.xml.sax.misc.LexicalHandler;
-import org.xml.sax.misc.DeclHandler;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Attributes;
+import org.xml.sax.ext.LexicalHandler;
+import org.xml.sax.ext.DeclHandler;
/**
@@ -238,8 +240,6 @@
*/
private Writer _docWriter;
-
-
//--------------------------------//
// Constructor and initialization //
@@ -261,12 +261,18 @@
}
- public DocumentHandler asDocumentHandler()
+ public DocumentHandler asDocumentHandler()
{
return this;
}
+ public ContentHandler asContentHandler()
+ {
+ return null;
+ }
+
+
public DOMSerializer asDOMSerializer()
{
return this;
@@ -397,9 +403,9 @@
}
- //---------------------------------------//
+ //------------------------------------------//
// SAX document handler serializing methods //
- //---------------------------------------//
+ //------------------------------------------//
public void characters( char[] chars, int start, int length )
@@ -568,6 +574,50 @@
}
+ //-----------------------------------------//
+ // SAX content handler serializing methods //
+ //-----------------------------------------//
+
+
+ public void skippedEntity ( String name )
+ throws SAXException
+ {
+ endCDATA();
+ content();
+ printText( "&" + name + ";" );
+ }
+
+
+ public void startPrefixMapping (String prefix, String uri)
+ throws SAXException
+ {
+ // Not yet supported
+ }
+
+
+ public void endPrefixMapping (String prefix)
+ throws SAXException
+ {
+ // Not yet supported
+ }
+
+
+ public void startElement (String namespaceURI, String localName,
+ String rawName, Attributes atts)
+ throws SAXException
+ {
+ // Not yet supported
+ }
+
+
+ public void endElement (String namespaceURI, String localName,
+ String rawName)
+ throws SAXException
+ {
+ // Not yet supported
+ }
+
+
//---------------------------------------//
// SAX DTD/Decl handler serializing methods //
//---------------------------------------//
@@ -761,6 +811,8 @@
}
break;
}
+
+
case Node.PROCESSING_INSTRUCTION_NODE :
processingInstruction( node.getNodeName(), node.getNodeValue() );
break;