Package org.xml.sax

Examples of org.xml.sax.DTDHandler


        }
    }

    public void testSetDtdHandlerNotSupported() {
        try {
            new DefaultNonBlockingXMLReader().setDTDHandler(new DTDHandler() {
                public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
                        throws SAXException {
                }

                public void notationDecl(String name, String publicId, String systemId) throws SAXException {
View Full Code Here


        // unqueue all of the buffered events

        // for speed purposes, we don't allow contentHandler to be null
        if(ch!=null) {
            // determine what a given content handler represents
            DTDHandler dtdh=null;
            if(ch instanceof DTDHandler) {
                dtdh=(DTDHandler) ch;
            }

            ErrorHandler erh=null;
View Full Code Here

        // unqueue all of the buffered events

        // for speed purposes, we don't allow contentHandler to be null
        if(ch!=null) {
            // determine what a given content handler represents
            DTDHandler dtdh=null;
            if(ch instanceof DTDHandler) {
                dtdh=(DTDHandler) ch;
            }
           
            ErrorHandler erh=null;
            if(ch instanceof ErrorHandler) {
                erh=(ErrorHandler)ch;
            }
           
            LexicalHandler lh=null;
            if(ch instanceof LexicalHandler) {
                lh=(LexicalHandler)ch;
            }
       
            Enumeration args = eventArguments.elements ();
            ThreeString ths;
            CharBlock cd;
            TwoString ts;
            FourString fs;
            SAXParseException e;
       
            for (Enumeration types = eventTypes.elements (); types.hasMoreElements ();) {
                Integer type = (Integer)types.nextElement();

                // ContentHandler events
                if (STARTDOCUMENT.equals(type)) {
                    ch.startDocument ();
                } else if (ENDDOCUMENT.equals(type)) {
                    ch.endDocument ();
                } else if (STARTPREFIXMAPPING.equals(type)) {
                    ts=(TwoString) args.nextElement();
                    ch.startPrefixMapping(ts.first,ts.second);
                } else if (ENDPREFIXMAPPING.equals(type)) {
                    ch.endPrefixMapping((String)args.nextElement());
                } else if (STARTELEMENT.equals(type)) {
                    StartElementData sed = (StartElementData) args.nextElement ();
                    ch.startElement (sed.getURI(), sed.getLocalName(), sed.getQName(),sed.getAtts());
                } else if (ENDELEMENT.equals(type)) {
                    ths = (ThreeString) args.nextElement ();
                    ch.endElement (ths.first,ths.second,ths.third);
                } else if (CHARACTERS.equals(type)) {
                    cd = (CharBlock) args.nextElement ();
                    ch.characters (cd.getCh(), cd.getStart(), cd.getLength());
                } else if (IGNORABLEWHITESPACE.equals(type)) {
                    cd = (CharBlock) args.nextElement ();
                    ch.ignorableWhitespace (cd.getCh(), cd.getStart(), cd.getLength());
                } else if (PROCESSINGINSTRUCTION.equals(type)) {
                    ts=(TwoString) args.nextElement();
                    ch.processingInstruction (ts.first,ts.second);
                   
                // DTDHandler events
                } else if (NOTATIONDECL.equals(type)) {
                    if(dtdh!=null) {
                        ths=(ThreeString) args.nextElement();
                        dtdh.notationDecl(ths.first,ths.second,ths.third);
                    }
                } else if (UNPARSEDENTITYDECL.equals(type)) {
                    if(dtdh!=null) {
                        fs=(FourString) args.nextElement();
                        dtdh.unparsedEntityDecl(fs.first,fs.second,fs.third,fs.fourth);
                    }

                // ErrorHandler events
                } else if (WARNING.equals(type)) {
                    if(erh!=null) {
View Full Code Here

TOP

Related Classes of org.xml.sax.DTDHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.