tmiller 2002/06/04 04:58:31
Modified: java/src/org/apache/xalan/xsltc/runtime/output
OutputBase.java SAXHTMLOutput.java SAXOutput.java
SAXXMLOutput.java StreamOutput.java
StreamTextOutput.java StreamXMLOutput.java
Log:
updating work in progress
Revision Changes Path
1.4 +1 -13
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/OutputBase.java
Index: OutputBase.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/OutputBase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- OutputBase.java 3 Jun 2002 17:14:22 -0000 1.3
+++ OutputBase.java 4 Jun 2002 11:58:31 -0000 1.4
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: OutputBase.java,v 1.3 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: OutputBase.java,v 1.4 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -244,19 +244,7 @@
}
// -- Temporary
- public void startDocument() throws TransletException { }
- public void endDocument() throws TransletException { }
- public void startElement(String elementName) throws TransletException { }
- public void endElement(String elementName) throws TransletException { }
- public void characters(String characters) throws TransletException { }
- public void characters(char[] characters, int offset, int length)
- throws TransletException { }
- public void attribute(String attributeName, String attributeValue)
- throws TransletException { }
public void namespace(String prefix, String uri) throws
TransletException { }
- public void comment(String comment) throws TransletException { }
- public void processingInstruction(String target, String data)
- throws TransletException { }
public void setType(int type) { }
public void setIndent(boolean indent) { }
public void omitHeader(boolean value) { }
1.6 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXHTMLOutput.java
Index: SAXHTMLOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXHTMLOutput.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SAXHTMLOutput.java 3 Jun 2002 17:14:22 -0000 1.5
+++ SAXHTMLOutput.java 4 Jun 2002 11:58:31 -0000 1.6
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: SAXHTMLOutput.java,v 1.5 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: SAXHTMLOutput.java,v 1.6 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -130,7 +130,7 @@
* This method is called when all the data needed for a call to the
* SAX handler's startElement() method has been gathered.
*/
- public void closeStartTag() throws TransletException {
+ protected void closeStartTag() throws TransletException {
try {
_startTagOpen = false;
1.7 +41 -17
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXOutput.java
Index: SAXOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXOutput.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SAXOutput.java 3 Jun 2002 17:14:22 -0000 1.6
+++ SAXOutput.java 4 Jun 2002 11:58:31 -0000 1.7
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: SAXOutput.java,v 1.6 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: SAXOutput.java,v 1.7 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -71,7 +71,12 @@
import org.apache.xalan.xsltc.TransletException;
import org.apache.xalan.xsltc.runtime.Constants;
-public class SAXOutput extends OutputBase implements Constants {
+abstract class SAXOutput extends OutputBase implements Constants {
+
+ private static final char[] BEGCOMM = "<!--".toCharArray();
+ private static final char[] ENDCOMM = "-->".toCharArray();
+ private static final int BEGCOMM_length = BEGCOMM.length;
+ private static final int ENDCOMM_length = ENDCOMM.length;
protected ContentHandler _saxHandler;
protected LexicalHandler _lexHandler;
@@ -83,11 +88,15 @@
public SAXOutput(ContentHandler handler, String encoding) {
+System.err.println("GTM>> ################");
+System.out.println("GTM>> ################");
_saxHandler = handler;
_encoding = encoding;
}
public SAXOutput(ContentHandler hdler, LexicalHandler lex, String
encoding){
+System.err.println("GTM>> ################");
+System.out.println("GTM>> ################");
_saxHandler = hdler;
_lexHandler = lex;
_encoding = encoding;
@@ -102,26 +111,36 @@
}
}
- public void endDocument() throws TransletException {
- try {
- _saxHandler.endDocument();
- }
- catch (SAXException e) {
- throw new TransletException(e);
- }
- }
-
-
public void characters(String characters)
throws TransletException
{
+System.out.println("GTM>> SAXOutput value = " + characters);
+ characters(characters.toCharArray(), 0, characters.length());
+ }
+
+ public void comment(String comment) throws TransletException {
try {
- _saxHandler.characters(characters.toCharArray(), 0,
- characters.length());
- }
+ // Close any open element before emitting comment
+ if (_startTagOpen) {
+ closeStartTag();
+ }
+ else if (_cdataTagOpen) {
+ closeCDATA();
+ }
+
+ _saxHandler.characters(BEGCOMM, 0, BEGCOMM_length);
+ characters(comment);
+ _saxHandler.characters(ENDCOMM, 0, ENDCOMM_length);
+ }
catch (SAXException e) {
- throw new TransletException(e);
- }
+ throw new TransletException(e);
+ }
+ }
+
+ public void processingInstruction(String target, String data)
+ throws TransletException
+ {
+ // Redefined in SAXXMLOutput
}
/**
@@ -135,4 +154,9 @@
return (col > 0) ? qname.substring(col + 1) : null;
}
+ protected abstract void closeStartTag() throws TransletException;
+
+ protected void closeCDATA() throws SAXException {
+ // Redefined in SAXXMLOutput
+ }
}
1.7 +6 -3
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXXMLOutput.java
Index: SAXXMLOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/SAXXMLOutput.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SAXXMLOutput.java 3 Jun 2002 17:14:22 -0000 1.6
+++ SAXXMLOutput.java 4 Jun 2002 11:58:31 -0000 1.7
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: SAXXMLOutput.java,v 1.6 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: SAXXMLOutput.java,v 1.7 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -82,6 +82,7 @@
throws IOException
{
super(handler, encoding);
+System.out.println("GTM>> SAXXMLOutput.<init>");
initCDATA();
initNamespaces();
}
@@ -90,6 +91,7 @@
String encoding) throws IOException
{
super(handler, lex, encoding);
+System.out.println("GTM>> SAXXMLOutput.<init>");
initCDATA();
initNamespaces();
}
@@ -182,6 +184,7 @@
public void characters(char[] ch, int off, int len)
throws TransletException
{
+System.out.println("GTM>> SAXXMLOutput value = " + new String(ch,off,len));
try {
// Close any open start tag
if (_startTagOpen) {
@@ -248,7 +251,7 @@
* This method is called when all the data needed for a call to the
* SAX handler's startElement() method has been gathered.
*/
- private void closeStartTag() throws TransletException {
+ protected void closeStartTag() throws TransletException {
try {
_startTagOpen = false;
@@ -312,7 +315,7 @@
return stack != null && !stack.isEmpty() ? (String)stack.peek() :
null;
}
- private void closeCDATA() throws SAXException {
+ protected void closeCDATA() throws SAXException {
// Output closing bracket - "]]>"
_saxHandler.characters(ENDCDATA, 0, ENDCDATA.length);
_cdataTagOpen = false;
1.10 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamOutput.java
Index: StreamOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamOutput.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- StreamOutput.java 3 Jun 2002 17:14:22 -0000 1.9
+++ StreamOutput.java 4 Jun 2002 11:58:31 -0000 1.10
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: StreamOutput.java,v 1.9 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: StreamOutput.java,v 1.10 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -71,7 +71,7 @@
import java.util.Vector;
-class StreamOutput extends OutputBase {
+abstract class StreamOutput extends OutputBase {
protected static final String AMP = "&";
protected static final String LT = "<";
1.2 +28 -1
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamTextOutput.java
Index: StreamTextOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamTextOutput.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StreamTextOutput.java 23 May 2002 20:10:02 -0000 1.1
+++ StreamTextOutput.java 4 Jun 2002 11:58:31 -0000 1.2
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: StreamTextOutput.java,v 1.1 2002/05/23 20:10:02 santiagopg Exp $
+ * @(#)$Id: StreamTextOutput.java,v 1.2 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -80,10 +80,23 @@
super(out, encoding);
}
+ public void startDocument() throws TransletException {
+ }
+
public void endDocument() throws TransletException {
outputBuffer();
}
+ public void startElement(String elementName)
+ throws TransletException
+ {
+ }
+
+ public void endElement(String elementName)
+ throws TransletException
+ {
+ }
+
public void characters(String characters)
throws TransletException
{
@@ -95,4 +108,18 @@
{
_buffer.append(characters, offset, length);
}
+
+ public void comment(String comment) throws TransletException {
+ }
+
+ public void attribute(String name, String value)
+ throws TransletException
+ {
+ }
+
+ public void processingInstruction(String target, String data)
+ throws TransletException
+ {
+ }
}
+
1.10 +2 -2
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java
Index: StreamXMLOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/output/StreamXMLOutput.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- StreamXMLOutput.java 3 Jun 2002 17:14:22 -0000 1.9
+++ StreamXMLOutput.java 4 Jun 2002 11:58:31 -0000 1.10
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: StreamXMLOutput.java,v 1.9 2002/06/03 17:14:22 santiagopg Exp $
+ * @(#)$Id: StreamXMLOutput.java,v 1.10 2002/06/04 11:58:31 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -201,7 +201,7 @@
public void characters(char[] characters, int offset, int length)
throws TransletException
{
-// System.out.println("characters() char '" + new String(characters, offset,
length) + "'");
+System.out.println("characters() char '" + new String(characters, offset,
length) + "'");
if (length <= 0) return;
if (_startTagOpen) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]