You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/08/26 13:13:36 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/sax XMLByteStreamCompiler.java XMLByteStreamInterpreter.java

cziegeler    2002/08/26 04:13:36

  Modified:    src/java/org/apache/cocoon/components/sax Tag:
                        cocoon_2_0_3_branch XMLByteStreamCompiler.java
                        XMLByteStreamInterpreter.java
  Log:
  Adding all events to the compiled XML. This should fix bug 11943
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.5.2.1   +23 -9     xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java
  
  Index: XMLByteStreamCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamCompiler.java,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- XMLByteStreamCompiler.java	22 Feb 2002 07:00:12 -0000	1.5
  +++ XMLByteStreamCompiler.java	26 Aug 2002 11:13:36 -0000	1.5.2.1
  @@ -111,6 +111,13 @@
       private static final int PROCESSING_INSTRUCTION = 8;
       private static final int COMMENT                = 9;
       private static final int LOCATOR                = 10;
  +    private static final int START_DTD              = 11;
  +    private static final int END_DTD                = 12;
  +    private static final int START_CDATA            = 13;
  +    private static final int END_CDATA              = 14;
  +    private static final int SKIPPED_ENTITY         = 15;
  +    private static final int START_ENTITY           = 16;
  +    private static final int END_ENTITY             = 17;
   
   
       public Object getSAXFragment() {
  @@ -198,49 +205,56 @@
       }
   
       public void skippedEntity(java.lang.String name) throws SAXException {
  -        // ignore.
  +        this.writeEvent(SKIPPED_ENTITY);
  +        this.writeString(name);
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
  -    public void startDTD(String name, String public_id, String system_id) {
  -        // ignore
  +    public void startDTD(String name, String publicId, String systemId) 
  +    throws SAXException {
  +        this.writeEvent(START_DTD);
  +        this.writeString(name);
  +        this.writeString(publicId!=null?publicId:"");
  +        this.writeString(systemId!=null?systemId:"");
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
       public void endDTD() throws SAXException {
  -        // ignore
  +        this.writeEvent(END_DTD);
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
       public void startEntity(String name) throws SAXException {
  -        // ignore
  +        this.writeEvent(START_ENTITY);
  +        this.writeString(name);
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
       public void endEntity(String name) throws SAXException {
  -        // ignore
  +        this.writeEvent(END_ENTITY);
  +        this.writeString(name);
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
       public void startCDATA() throws SAXException {
  -        // ignore
  +        this.writeEvent(START_CDATA);
       }
   
       /**
        * SAX Event Handling: LexicalHandler
        */
       public void endCDATA() throws SAXException {
  -        // ignore
  +        this.writeEvent(END_CDATA);
       }
   
   
  
  
  
  1.7.2.2   +31 -1     xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java
  
  Index: XMLByteStreamInterpreter.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLByteStreamInterpreter.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- XMLByteStreamInterpreter.java	6 Aug 2002 09:54:43 -0000	1.7.2.1
  +++ XMLByteStreamInterpreter.java	26 Aug 2002 11:13:36 -0000	1.7.2.2
  @@ -81,6 +81,13 @@
       private static final int PROCESSING_INSTRUCTION = 8;
       private static final int COMMENT                = 9;
       private static final int LOCATOR                = 10;
  +    private static final int START_DTD              = 11;
  +    private static final int END_DTD                = 12;
  +    private static final int START_CDATA            = 13;
  +    private static final int END_CDATA              = 14;
  +    private static final int SKIPPED_ENTITY         = 15;
  +    private static final int START_ENTITY           = 16;
  +    private static final int END_ENTITY             = 17;
   
       private ArrayList list = new ArrayList();
       private byte[] input;
  @@ -165,6 +172,29 @@
                       locator.setColumnNumber(columnNumber);
                       contentHandler.setDocumentLocator(locator);
                       }
  +                    break;
  +                case START_DTD:
  +                    lexicalHandler.startDTD(this.readString(), 
  +                                            this.readString(), 
  +                                            this.readString());
  +                    break;
  +                case END_DTD:
  +                    lexicalHandler.endDTD();
  +                    break;
  +                case START_CDATA:
  +                    lexicalHandler.startCDATA();
  +                    break;
  +                case END_CDATA:
  +                    lexicalHandler.endCDATA();
  +                    break;
  +                case SKIPPED_ENTITY:
  +                    contentHandler.skippedEntity( this.readString() );
  +                    break;
  +                case START_ENTITY:
  +                    lexicalHandler.startEntity( this.readString() );
  +                    break;
  +                case END_ENTITY:
  +                    lexicalHandler.endEntity( this.readString() );
                       break;
                   default:
                       throw new SAXException ("parsing error: event not supported.");
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org