stefano 00/06/06 05:54:09
Modified: src/org/apache/arch/config Tag: xml-cocoon2
SAXConfigurationBuilder.java
src/org/apache/cocoon/filters Tag: xml-cocoon2
LogFilter.java
src/org/apache/cocoon/serializers Tag: xml-cocoon2
HTMLSerializer.java XMLSerializer.java
src/org/apache/cocoon/sitemap Tag: xml-cocoon2
LinkTranslator.java
src/org/apache/cocoon/xml/util Tag: xml-cocoon2
DOMBuilder.java DocumentHandlerAdapter.java
DocumentHandlerWrapper.java NamespacesTable.java
Log:
moving to SAX2 final
WARNING: could break your compilation, you require Xerces 1.0.4 or greater
Revision Changes Path
No revision
No revision
1.1.2.3 +2 -2
xml-cocoon/src/org/apache/arch/config/Attic/SAXConfigurationBuilder.java
Index: SAXConfigurationBuilder.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/arch/config/Attic/SAXConfigurationBuilder.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SAXConfigurationBuilder.java 2000/02/27 01:33:03 1.1.2.2
+++ SAXConfigurationBuilder.java 2000/06/06 12:54:04 1.1.2.3
@@ -24,7 +24,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:33:03 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/06/06 12:54:04 $
*/
public class SAXConfigurationBuilder implements ContentHandler,
DocumentHandler {
/** The current Locator. */
@@ -127,7 +127,7 @@
Hashtable t=new Hashtable();
// Process the attributes
for (int x=0; x<a.getLength(); x++) {
- String
aname=resolve(a.getURI(x),a.getLocalName(x),a.getRawName(x));
+ String
aname=resolve(a.getURI(x),a.getLocalName(x),a.getQName(x));
t.put(aname,a.getValue(x));
}
this.startElement(name,t);
No revision
No revision
1.1.2.2 +293 -293
xml-cocoon/src/org/apache/cocoon/filters/Attic/LogFilter.java
Index: LogFilter.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/filters/Attic/LogFilter.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- LogFilter.java 2000/04/01 07:42:52 1.1.2.1
+++ LogFilter.java 2000/06/06 12:54:05 1.1.2.2
@@ -1,28 +1,28 @@
-/*****************************************************************************
- * Copyright (C) The Apache Software Foundation. All rights reserved.
*
- * -------------------------------------------------------------------------
*
- * This software is published under the terms of the Apache Software License
*
- * version 1.1, a copy of which has been included with this distribution in
*
- * the LICENSE file.
*
-
*****************************************************************************/
-package org.apache.cocoon.filters;
-
-import org.apache.cocoon.Parameters;
-import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.Request;
-import org.apache.cocoon.Response;
-import org.apache.cocoon.xml.AbstractXMLProducer;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Date;
-
-/**
- *
+/*****************************************************************************
+ * Copyright (C) The Apache Software Foundation. All rights reserved.
*
+ * -------------------------------------------------------------------------
*
+ * This software is published under the terms of the Apache Software License
*
+ * version 1.1, a copy of which has been included with this distribution in
*
+ * the LICENSE file.
*
+
*****************************************************************************/
+package org.apache.cocoon.filters;
+
+import org.apache.cocoon.Parameters;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.Request;
+import org.apache.cocoon.Response;
+import org.apache.cocoon.xml.AbstractXMLProducer;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+
+/**
+ *
* The <code>LogFilter</code> is a class that can be plugged into a pipeline
* to print the SAX events which passes thru this filter in a readable form
* to a file.
@@ -42,272 +42,272 @@
* <br>
* This filters main purpose is debugging.
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * (PWR Organisation & Entwicklung)
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2000/04/01 07:42:52 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
+ * (PWR Organisation & Entwicklung)
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/06/06 12:54:05 $
*
- */
-public class LogFilter extends AbstractFilter {
-
- /** Wether we are forwarding XML data or not. */
- private boolean canReset=true;
-
- private String lf = System.getProperty("line.separator", "\n");
-
- /** true if filename is valid and writeable */
- private boolean isValid = true;
- /** filename for log file */
- private String logfilename = null;
- /** log file */
- private FileWriter logfile = null;
- /** should we append content to the log file */
- private boolean append = false;
-
- /** BEGIN SitemapComponent methods **/
-
- public void setup(Request request, Response response,
- String source, Parameters parameters)
- throws ProcessingException, SAXException, IOException {
- if (logfile == null) {
- String appends = parameters.getParameter("append", null);
- logfilename = parameters.getParameter("logfile", null);
- if (appends != null && appends.equals ("yes")) {
- append = true;
- } else {
- append = false;
- }
- try {
- logfile = new FileWriter(logfilename, append );
- } catch (IOException e) {
- isValid = false;
- throw e;
- }
- }
- Date date = new Date();
- StringBuffer logEntry = new StringBuffer();
- logEntry.append ( "---------------------------- [" );
- logEntry.append ( date.toString() );
- logEntry.append ( "] ----------------------------" );
- log("setup", logEntry.toString());
- }
-
- /** END SitemapComponent methods **/
-
- /**
- * Receive an object for locating the origin of SAX document events.
- */
- public void setDocumentLocator(Locator locator) {
- log("setDocumentLocator","");
- if (super.contentHandler!=null)
- super.contentHandler.setDocumentLocator(locator);
- }
-
- /**
- * Receive notification of the beginning of a document.
- */
- public void startDocument()
- throws SAXException {
- log("startDocument", "");
- if (super.contentHandler!=null)
- super.contentHandler.startDocument();
- this.canReset=false;
- }
-
- /**
- * Receive notification of the end of a document.
- */
- public void endDocument()
- throws SAXException {
- log ("endDocument", "");
- if (super.contentHandler!=null)
- super.contentHandler.endDocument();
- this.canReset=true;
- }
-
- /**
- * Begin the scope of a prefix-URI Namespace mapping.
- */
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- log ("startPrefixMapping", "prefix="+prefix+",uri="+uri);
- if (super.contentHandler!=null)
- super.contentHandler.startPrefixMapping(prefix,uri);
- }
-
- /**
- * End the scope of a prefix-URI mapping.
- */
- public void endPrefixMapping(String prefix)
- throws SAXException {
- log ("endPrefixMapping", "prefix="+prefix);
- }
-
- /**
- * Receive notification of the beginning of an element.
- */
- public void startElement(String uri, String loc, String raw, Attributes
a)
- throws SAXException {
- log ("startElement", "uri="+uri+",local="+loc+",raw="+raw);
- for (int i = 0; i < a.getLength(); i++) {
- log (" ", new Integer(i+1).toString()
- +". uri="+a.getURI(i)
- +",local="+a.getLocalName(i)
- +",raw="+a.getRawName(i)
- +",type="+a.getType(i)
- +",value="+a.getValue(i));
- }
- if (super.contentHandler!=null)
- super.contentHandler.startElement(uri,loc,raw,a);
- }
-
-
- /**
- * Receive notification of the end of an element.
- */
- public void endElement(String uri, String loc, String raw)
- throws SAXException {
- log ("endElement", "uri="+uri+",local="+loc+",raw="+raw);
- if (super.contentHandler!=null)
- super.contentHandler.endElement(uri,loc,raw);
- }
-
- /**
- * Receive notification of character data.
- */
- public void characters(char ch[], int start, int len)
- throws SAXException {
- log ("characters", new String(ch).substring(start, len));
- if (super.contentHandler!=null)
- super.contentHandler.characters(ch,start,len);
- }
-
- /**
- * Receive notification of ignorable whitespace in element content.
- */
- public void ignorableWhitespace(char ch[], int start, int len)
- throws SAXException {
- log ("ignorableWhitespace", new String(ch).substring(start, len));
- if (super.contentHandler!=null)
- super.contentHandler.ignorableWhitespace(ch,start,len);
- }
-
- /**
- * Receive notification of a processing instruction.
- */
- public void processingInstruction(String target, String data)
- throws SAXException {
- log ("processingInstruction", "target="+target+",data="+data);
- if (super.contentHandler!=null)
- super.contentHandler.processingInstruction(target,data);
- }
-
- /**
- * Receive notification of a skipped entity.
- */
- public void skippedEntity(String name)
- throws SAXException {
- log ("skippedEntity", "name="+name);
- if (super.contentHandler!=null)
- super.contentHandler.skippedEntity(name);
- }
-
- /**
- * Report the start of DTD declarations, if any.
- */
- public void startDTD(String name, String publicId, String systemId)
- throws SAXException {
- log ("startDTD",
"name="+name+",publicId="+publicId+",systemId="+systemId);
- if (super.lexicalHandler!=null)
- super.lexicalHandler.startDTD(name,publicId,systemId);
- }
-
- /**
- * Report the end of DTD declarations.
- */
- public void endDTD()
- throws SAXException {
- log ("endDTD", "");
- if (super.lexicalHandler!=null)
- super.lexicalHandler.endDTD();
- }
-
- /**
- * Report the beginning of an entity.
- */
- public void startEntity(String name)
- throws SAXException {
- log ("startEntity", "name="+name);
- if (super.lexicalHandler!=null)
- super.lexicalHandler.startEntity(name);
- }
-
- /**
- * Report the end of an entity.
- */
- public void endEntity(String name)
- throws SAXException {
- log ("endEntity", "name="+name);
- if (super.lexicalHandler!=null)
- super.lexicalHandler.endEntity(name);
- }
-
- /**
- * Report the start of a CDATA section.
- */
- public void startCDATA()
- throws SAXException {
- log ("startCDATA", "");
- if (super.lexicalHandler!=null)
- super.lexicalHandler.startCDATA();
- }
-
- /**
- * Report the end of a CDATA section.
- */
- public void endCDATA()
- throws SAXException {
- log ("endCDATA", "");
- if (super.lexicalHandler!=null)
- super.lexicalHandler.endCDATA();
- }
-
- /**
- * Report an XML comment anywhere in the document.
- */
- public void comment(char ch[], int start, int len)
- throws SAXException {
- log ("comment", new String(ch).substring(start, len));
- if (super.lexicalHandler!=null)
- super.lexicalHandler.comment(ch,start,len);
- }
-
- /**
- * Report to logfile.
- */
- private void log (String location, String description) {
- if (isValid) {
- StringBuffer logEntry = new StringBuffer();
- logEntry.append ( "[" );
- logEntry.append ( location );
- logEntry.append ( "] " );
- logEntry.append ( description );
- logEntry.append ( lf );
- synchronized (logfile) {
- try {
- logfile.write( logEntry.toString(), 0,
logEntry.length());
- logfile.flush();
- }
- catch(IOException ioe) { }
- }
- }
- }
-
- /**
- * Attempt to close the log file when the class is GC'd
- */
- public void destroy() {
- try {
- logfile.close();
- } catch (Exception e) {}
- }
-}
+ */
+public class LogFilter extends AbstractFilter {
+
+ /** Wether we are forwarding XML data or not. */
+ private boolean canReset=true;
+
+ private String lf = System.getProperty("line.separator", "\n");
+
+ /** true if filename is valid and writeable */
+ private boolean isValid = true;
+ /** filename for log file */
+ private String logfilename = null;
+ /** log file */
+ private FileWriter logfile = null;
+ /** should we append content to the log file */
+ private boolean append = false;
+
+ /** BEGIN SitemapComponent methods **/
+
+ public void setup(Request request, Response response,
+ String source, Parameters parameters)
+ throws ProcessingException, SAXException, IOException {
+ if (logfile == null) {
+ String appends = parameters.getParameter("append", null);
+ logfilename = parameters.getParameter("logfile", null);
+ if (appends != null && appends.equals ("yes")) {
+ append = true;
+ } else {
+ append = false;
+ }
+ try {
+ logfile = new FileWriter(logfilename, append );
+ } catch (IOException e) {
+ isValid = false;
+ throw e;
+ }
+ }
+ Date date = new Date();
+ StringBuffer logEntry = new StringBuffer();
+ logEntry.append ( "---------------------------- [" );
+ logEntry.append ( date.toString() );
+ logEntry.append ( "] ----------------------------" );
+ log("setup", logEntry.toString());
+ }
+
+ /** END SitemapComponent methods **/
+
+ /**
+ * Receive an object for locating the origin of SAX document events.
+ */
+ public void setDocumentLocator(Locator locator) {
+ log("setDocumentLocator","");
+ if (super.contentHandler!=null)
+ super.contentHandler.setDocumentLocator(locator);
+ }
+
+ /**
+ * Receive notification of the beginning of a document.
+ */
+ public void startDocument()
+ throws SAXException {
+ log("startDocument", "");
+ if (super.contentHandler!=null)
+ super.contentHandler.startDocument();
+ this.canReset=false;
+ }
+
+ /**
+ * Receive notification of the end of a document.
+ */
+ public void endDocument()
+ throws SAXException {
+ log ("endDocument", "");
+ if (super.contentHandler!=null)
+ super.contentHandler.endDocument();
+ this.canReset=true;
+ }
+
+ /**
+ * Begin the scope of a prefix-URI Namespace mapping.
+ */
+ public void startPrefixMapping(String prefix, String uri)
+ throws SAXException {
+ log ("startPrefixMapping", "prefix="+prefix+",uri="+uri);
+ if (super.contentHandler!=null)
+ super.contentHandler.startPrefixMapping(prefix,uri);
+ }
+
+ /**
+ * End the scope of a prefix-URI mapping.
+ */
+ public void endPrefixMapping(String prefix)
+ throws SAXException {
+ log ("endPrefixMapping", "prefix="+prefix);
+ }
+
+ /**
+ * Receive notification of the beginning of an element.
+ */
+ public void startElement(String uri, String loc, String raw, Attributes
a)
+ throws SAXException {
+ log ("startElement", "uri="+uri+",local="+loc+",raw="+raw);
+ for (int i = 0; i < a.getLength(); i++) {
+ log (" ", new Integer(i+1).toString()
+ +". uri="+a.getURI(i)
+ +",local="+a.getLocalName(i)
+ +",qname="+a.getQName(i)
+ +",type="+a.getType(i)
+ +",value="+a.getValue(i));
+ }
+ if (super.contentHandler!=null)
+ super.contentHandler.startElement(uri,loc,raw,a);
+ }
+
+
+ /**
+ * Receive notification of the end of an element.
+ */
+ public void endElement(String uri, String loc, String qname)
+ throws SAXException {
+ log ("endElement", "uri="+uri+",local="+loc+",qname="+qname);
+ if (super.contentHandler!=null)
+ super.contentHandler.endElement(uri,loc,qname);
+ }
+
+ /**
+ * Receive notification of character data.
+ */
+ public void characters(char ch[], int start, int len)
+ throws SAXException {
+ log ("characters", new String(ch).substring(start, len));
+ if (super.contentHandler!=null)
+ super.contentHandler.characters(ch,start,len);
+ }
+
+ /**
+ * Receive notification of ignorable whitespace in element content.
+ */
+ public void ignorableWhitespace(char ch[], int start, int len)
+ throws SAXException {
+ log ("ignorableWhitespace", new String(ch).substring(start, len));
+ if (super.contentHandler!=null)
+ super.contentHandler.ignorableWhitespace(ch,start,len);
+ }
+
+ /**
+ * Receive notification of a processing instruction.
+ */
+ public void processingInstruction(String target, String data)
+ throws SAXException {
+ log ("processingInstruction", "target="+target+",data="+data);
+ if (super.contentHandler!=null)
+ super.contentHandler.processingInstruction(target,data);
+ }
+
+ /**
+ * Receive notification of a skipped entity.
+ */
+ public void skippedEntity(String name)
+ throws SAXException {
+ log ("skippedEntity", "name="+name);
+ if (super.contentHandler!=null)
+ super.contentHandler.skippedEntity(name);
+ }
+
+ /**
+ * Report the start of DTD declarations, if any.
+ */
+ public void startDTD(String name, String publicId, String systemId)
+ throws SAXException {
+ log ("startDTD",
"name="+name+",publicId="+publicId+",systemId="+systemId);
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.startDTD(name,publicId,systemId);
+ }
+
+ /**
+ * Report the end of DTD declarations.
+ */
+ public void endDTD()
+ throws SAXException {
+ log ("endDTD", "");
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.endDTD();
+ }
+
+ /**
+ * Report the beginning of an entity.
+ */
+ public void startEntity(String name)
+ throws SAXException {
+ log ("startEntity", "name="+name);
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.startEntity(name);
+ }
+
+ /**
+ * Report the end of an entity.
+ */
+ public void endEntity(String name)
+ throws SAXException {
+ log ("endEntity", "name="+name);
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.endEntity(name);
+ }
+
+ /**
+ * Report the start of a CDATA section.
+ */
+ public void startCDATA()
+ throws SAXException {
+ log ("startCDATA", "");
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.startCDATA();
+ }
+
+ /**
+ * Report the end of a CDATA section.
+ */
+ public void endCDATA()
+ throws SAXException {
+ log ("endCDATA", "");
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.endCDATA();
+ }
+
+ /**
+ * Report an XML comment anywhere in the document.
+ */
+ public void comment(char ch[], int start, int len)
+ throws SAXException {
+ log ("comment", new String(ch).substring(start, len));
+ if (super.lexicalHandler!=null)
+ super.lexicalHandler.comment(ch,start,len);
+ }
+
+ /**
+ * Report to logfile.
+ */
+ private void log (String location, String description) {
+ if (isValid) {
+ StringBuffer logEntry = new StringBuffer();
+ logEntry.append ( "[" );
+ logEntry.append ( location );
+ logEntry.append ( "] " );
+ logEntry.append ( description );
+ logEntry.append ( lf );
+ synchronized (logfile) {
+ try {
+ logfile.write( logEntry.toString(), 0,
logEntry.length());
+ logfile.flush();
+ }
+ catch(IOException ioe) { }
+ }
+ }
+ }
+
+ /**
+ * Attempt to close the log file when the class is GC'd
+ */
+ public void destroy() {
+ try {
+ logfile.close();
+ } catch (Exception e) {}
+ }
+}
No revision
No revision
1.1.4.3 +5 -5
xml-cocoon/src/org/apache/cocoon/serializers/Attic/HTMLSerializer.java
Index: HTMLSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serializers/Attic/HTMLSerializer.java,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -r1.1.4.2 -r1.1.4.3
--- HTMLSerializer.java 2000/03/30 04:53:26 1.1.4.2
+++ HTMLSerializer.java 2000/06/06 12:54:06 1.1.4.3
@@ -23,7 +23,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.4.2 $ $Date: 2000/03/30 04:53:26 $
+ * @version CVS $Revision: 1.1.4.3 $ $Date: 2000/06/06 12:54:06 $
*/
public class HTMLSerializer extends AbstractSerializer implements
XMLConsumer {
/** The namespaces table */
@@ -99,10 +99,10 @@
throws SAXException {
this.print('<');
- this.print(this.ns.resolve(uri,raw,null,loc).getRawName());
+ this.print(this.ns.resolve(uri,raw,null,loc).getQName());
for (int x=0; x<a.getLength(); x++) {
- String name=this.ns.resolve(a.getURI(x),a.getRawName(x),null,
- a.getLocalName(x)).getRawName();
+ String name=this.ns.resolve(a.getURI(x),a.getQName(x),null,
+ a.getLocalName(x)).getQName();
String value=a.getValue(x);
if ((name.equals("checked")) || (name.equals("compact")) ||
(name.equals("declare")) || (name.equals("defer")) ||
@@ -149,7 +149,7 @@
*/
public void endElement (String uri, String loc, String raw)
throws SAXException {
- String name=this.ns.resolve(uri,raw,null,loc).getRawName();
+ String name=this.ns.resolve(uri,raw,null,loc).getQName();
if ((name.equalsIgnoreCase("AREA")) ||
(name.equalsIgnoreCase("BASE")) ||
(name.equalsIgnoreCase("BASEFONT")) ||
(name.equalsIgnoreCase("BR")) ||
(name.equalsIgnoreCase("COL")) ||
(name.equalsIgnoreCase("FRAME")) ||
1.1.4.7 +5 -5
xml-cocoon/src/org/apache/cocoon/serializers/Attic/XMLSerializer.java
Index: XMLSerializer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/serializers/Attic/XMLSerializer.java,v
retrieving revision 1.1.4.6
retrieving revision 1.1.4.7
diff -u -r1.1.4.6 -r1.1.4.7
--- XMLSerializer.java 2000/05/03 19:18:35 1.1.4.6
+++ XMLSerializer.java 2000/06/06 12:54:06 1.1.4.7
@@ -23,7 +23,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.4.6 $ $Date: 2000/05/03 19:18:35 $
+ * @version CVS $Revision: 1.1.4.7 $ $Date: 2000/06/06 12:54:06 $
*/
public class XMLSerializer extends AbstractSerializer implements XMLConsumer
{
/** The namespaces table */
@@ -107,11 +107,11 @@
this.closeElement();
this.print('<');
- this.print(this.ns.resolve(uri,raw,null,loc).getRawName());
+ this.print(this.ns.resolve(uri,raw,null,loc).getQName());
for (int x=0; x<a.getLength(); x++) {
this.print(' ');
- this.print(this.ns.resolve(a.getURI(x),a.getRawName(x),null,
- a.getLocalName(x)).getRawName());
+ this.print(this.ns.resolve(a.getURI(x),a.getQName(x),null,
+ a.getLocalName(x)).getQName());
this.print('=');
this.print('\"');
this.printSafe(a.getValue(x));
@@ -158,7 +158,7 @@
}
this.print('<');
this.print('/');
- this.print(this.ns.resolve(uri,raw,null,loc).getRawName());
+ this.print(this.ns.resolve(uri,raw,null,loc).getQName());
this.print('>');
}
No revision
No revision
1.1.2.4 +2 -2
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/LinkTranslator.java
Index: LinkTranslator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/LinkTranslator.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- LinkTranslator.java 2000/02/28 18:43:21 1.1.2.3
+++ LinkTranslator.java 2000/06/06 12:54:07 1.1.2.4
@@ -21,7 +21,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/02/28 18:43:21 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/06/06 12:54:07 $
*/
public class LinkTranslator extends AbstractXMLProducer implements
XMLConsumer {
@@ -133,7 +133,7 @@
if (a.getLocalName(x).equals("partition"))
part=a.getValue(x);
if (a.getLocalName(x).equals("translate"))
tran=a.getValue(x);
} else {
-
a2.addAttribute(a.getURI(x),a.getLocalName(x),a.getRawName(x),
+ a2.addAttribute(a.getURI(x),a.getLocalName(x),a.getQName(x),
a.getType(x),a.getValue(x));
}
}
No revision
No revision
1.1.2.5 +9 -9
xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DOMBuilder.java
Index: DOMBuilder.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DOMBuilder.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- DOMBuilder.java 2000/03/30 04:52:54 1.1.2.4
+++ DOMBuilder.java 2000/06/06 12:54:08 1.1.2.5
@@ -32,7 +32,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.4 $ $Date: 2000/03/30 04:52:54 $
+ * @version CVS $Revision: 1.1.2.5 $ $Date: 2000/06/06 12:54:08 $
*/
public class DOMBuilder implements XMLConsumer {
/** The document was not started */
@@ -221,15 +221,15 @@
if (this.name!=null) {
// Check that this root element is equal to the one specified
// in the DTD
- if (!this.name.equals(n.getRawName()))
+ if (!this.name.equals(n.getQName()))
throw new SAXException("The name specified in the DTD '"+
this.name+"' differs from the root
"+
- "element name '"+n.getRawName()+
+ "element name '"+n.getQName()+
"'"+location());
// Recreate the document since no DTD was specified
} else {
// Recreate the document element
- Document doc=this.factory.newDocument(n.getRawName());
+ Document doc=this.factory.newDocument(n.getQName());
// Copy the old document root PIs
NodeList list=this.document.getChildNodes();
for (int x=0; x<list.getLength(); x++) {
@@ -247,17 +247,17 @@
// element check
if(state!=S_BODY) throw new SAXException("Invalid state"+location());
// Create the Element node
- Element e=this.document.createElementNS(n.getUri(),n.getRawName());
+ Element e=this.document.createElementNS(n.getUri(),n.getQName());
// Process all attributes
for(int x=0;x<a.getLength();x++) {
String auri=a.getURI(x);
String aloc=a.getLocalName(x);
- String araw=a.getRawName(x);
+ String araw=a.getQName(x);
String aval=a.getValue(x);
NamespacesTable.Name
k=this.namespaces.resolve(auri,araw,null,aloc);
// Set the attribute into the element
auri=k.getPrefix().length()==0?"":k.getUri();
- e.setAttributeNS(auri,k.getRawName(),aval);
+ e.setAttributeNS(auri,k.getQName(),aval);
}
// Append the xmlns... attributes
if (this.undecl.size()>0) {
@@ -299,8 +299,8 @@
// Check if the current element has the same tag name of this event
NamespacesTable.Name n=this.namespaces.resolve(uri,raw,null,loc);
String oldname=((Element)this.current).getTagName();
- if (!oldname.equals(n.getRawName()))
- throw new SAXException("Element end tag name '"+n.getRawName()+
+ if (!oldname.equals(n.getQName()))
+ throw new SAXException("Element end tag name '"+n.getQName()+
"' differs from start tag name '"+
oldname+"'"+location());
// Restore the old node as current
1.1.2.3 +4 -4
xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerAdapter.java
Index: DocumentHandlerAdapter.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerAdapter.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DocumentHandlerAdapter.java 2000/02/27 01:33:12 1.1.2.2
+++ DocumentHandlerAdapter.java 2000/06/06 12:54:08 1.1.2.3
@@ -30,7 +30,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:33:12 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/06/06 12:54:08 $
*/
public class DocumentHandlerAdapter extends AbstractXMLProducer
implements DocumentHandler {
@@ -127,11 +127,11 @@
String val=a.getValue(x);
String typ=a.getType(x);
String uri=k.getPrefix().length()==0?"":k.getUri();
- a2.addAttribute(uri,k.getLocalName(),k.getRawName(),typ,val);
+ a2.addAttribute(uri,k.getLocalName(),k.getQName(),typ,val);
}
// Notify the contentHandler
super.contentHandler.startElement(w.getUri(),w.getLocalName(),
- w.getRawName(),a2);
+ w.getQName(),a2);
// Forward on the stack
this.stack++;
}
@@ -148,7 +148,7 @@
// Notify the contentHandler
NamespacesTable.Name w=this.namespaces.resolve(null,name,null,null);
super.contentHandler.endElement(w.getUri(),w.getLocalName(),
- w.getRawName());
+ w.getQName());
// Undeclare namespaces
Vector nslist=(Vector)this.stackedNS.remove(new Integer(this.stack));
if (nslist==null) return;
1.1.2.3 +5 -5
xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerWrapper.java
Index: DocumentHandlerWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/util/Attic/DocumentHandlerWrapper.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DocumentHandlerWrapper.java 2000/02/27 01:33:12 1.1.2.2
+++ DocumentHandlerWrapper.java 2000/06/06 12:54:08 1.1.2.3
@@ -27,7 +27,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:33:12 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/06/06 12:54:08 $
*/
public class DocumentHandlerWrapper extends AbstractXMLConsumer {
@@ -136,13 +136,13 @@
// Set the real attributes
for (int x=0; x<a.getLength(); x++) {
NamespacesTable.Name aname=namespaces.resolve(a.getURI(x),
- a.getRawName(x),
+ a.getQName(x),
null,
a.getLocalName(x));
- a2.addAttribute(aname.getRawName(),a.getType(x),a.getValue(x));
+ a2.addAttribute(aname.getQName(),a.getType(x),a.getValue(x));
}
// Call the document handler startElement() method.
- this.documentHandler.startElement(name.getRawName(),a2);
+ this.documentHandler.startElement(name.getQName(),a2);
}
@@ -154,7 +154,7 @@
if (this.documentHandler==null)
throw new SAXException("DocumentHandler not set");
NamespacesTable.Name name=this.namespaces.resolve(uri,raw,null,loc);
- this.documentHandler.endElement(name.getRawName());
+ this.documentHandler.endElement(name.getQName());
}
/**
1.1.2.3 +3 -3
xml-cocoon/src/org/apache/cocoon/xml/util/Attic/NamespacesTable.java
Index: NamespacesTable.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/xml/util/Attic/NamespacesTable.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- NamespacesTable.java 2000/02/27 01:33:12 1.1.2.2
+++ NamespacesTable.java 2000/06/06 12:54:08 1.1.2.3
@@ -15,7 +15,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.2.2 $ $Date: 2000/02/27 01:33:12 $
+ * @version CVS $Revision: 1.1.2.3 $ $Date: 2000/06/06 12:54:08 $
*/
public class NamespacesTable {
/** The initial namespace declaration. */
@@ -274,7 +274,7 @@
/** Return the namespace local name. */
public String getLocalName() { return(this.local); }
/** Return the namespace raw name. */
- public String getRawName() { return(this.raw); }
+ public String getQName() { return(this.raw); }
}
/**
@@ -289,7 +289,7 @@
/** Return the namespace local name. */
public String getLocalName();
/** Return the namespace raw name. */
- public String getRawName();
+ public String getQName();
}
/**