KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > xml > xmlc > parsers > xerces > XercesParser


1 /*
2  * enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: XercesParser.java,v 1.3 2005/01/26 08:29:24 jkjome Exp $
22  */

23
24 package org.enhydra.xml.xmlc.parsers.xerces;
25
26 import java.io.IOException JavaDoc;
27
28 import org.enhydra.apache.xerces.framework.XMLAttrList;
29 import org.enhydra.apache.xerces.framework.XMLContentSpec;
30 import org.enhydra.apache.xerces.framework.XMLDocumentHandler;
31 import org.enhydra.apache.xerces.framework.XMLParser;
32 import org.enhydra.apache.xerces.readers.XMLEntityHandler;
33 import org.enhydra.apache.xerces.utils.QName;
34 import org.enhydra.apache.xerces.validators.common.XMLAttributeDecl;
35 import org.enhydra.xml.io.ErrorReporter;
36 import org.enhydra.xml.io.XMLEntityResolver;
37 import org.enhydra.xml.xmlc.XMLCError;
38 import org.enhydra.xml.xmlc.XMLCException;
39 import org.enhydra.xml.xmlc.dom.XMLCDocument;
40 import org.enhydra.xml.xmlc.dom.XMLCDomFactory;
41 import org.enhydra.xml.xmlc.metadata.MetaData;
42 import org.enhydra.xml.xmlc.metadata.Parser;
43 import org.enhydra.xml.xmlc.misc.LineNumberMap;
44 import org.enhydra.xml.xmlc.parsers.DocBuilder;
45 import org.enhydra.xml.xmlc.parsers.ParseTracer;
46 import org.enhydra.xml.xmlc.parsers.XMLCParser;
47 import org.xml.sax.EntityResolver JavaDoc;
48 import org.xml.sax.ErrorHandler JavaDoc;
49 import org.xml.sax.InputSource JavaDoc;
50 import org.xml.sax.SAXException JavaDoc;
51 import org.xml.sax.SAXParseException JavaDoc;
52
53 /*
54  * FIXME:
55  * - How to handle built-in entities (see xerces DOMParser).
56  * - Split handlers, entity resolvers into inner classes.
57  * or turn into minimal parser, or just use native DOMParser
58  * (however must work with other DOMS)
59  * - DOM builder doesn't build ElementDecl nodes correctly.
60  * - Need a hack to org.enhydra.apache.xerces.dom.EntityReferenceImpl to
61  * not create entity references read-only. Need to figure out
62  * how to make this conform to what Xerces does (like to Entity
63  * nodes).
64  */

65
66 /**
67  * Parse using the Xerces parser.
68  */

69 public class XercesParser extends XMLParser
70     implements XMLCParser, EntityResolver,
71                XMLDocumentHandler, XMLDocumentHandler.DTDHandler {
72
73     /**
74      * Error handler class that handles mapping of line numbers
75      */

76     private class MappingErrorHandler implements ErrorHandler JavaDoc {
77         private ErrorReporter fErrorReporter;
78         private LineNumberMap fLineNumberMap;
79
80         /**
81          * Constructor.
82          */

83         public MappingErrorHandler(ErrorReporter errorReporter,
84                                    LineNumberMap lineNumberMap) {
85             fErrorReporter = errorReporter;
86             fLineNumberMap = lineNumberMap;
87         }
88
89         /**
90          * Wrap a SAXParseException with a SAXParseException with the
91          * location mapped. If there is no line number map, return the
92          * exception unchanged.
93          */

94         private SAXParseException JavaDoc mapException(SAXParseException JavaDoc exception) {
95             if (fLineNumberMap == null) {
96                 return exception;
97             } else {
98                 LineNumberMap.Line line
99                     = fLineNumberMap.getLineFromLineNum(exception.getLineNumber());
100                 return new SAXParseException JavaDoc(exception.getMessage(),
101                                              exception.getPublicId(),
102                                              line.getFileName(),
103                                              line.getLineNum(),
104                                              exception.getColumnNumber(),
105                                              exception);
106             }
107         }
108
109         /**
110          * Receive notification of a SAX recoverable error.
111          */

112         public void error(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
113             fErrorReporter.error(mapException(exception));
114         }
115
116         /**
117          * Receive notification of a SAX warning.
118          */

119         public void warning(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
120             fErrorReporter.warning(mapException(exception));
121         }
122
123         /**
124          * Receive notification of a SAX non-recoverable error.
125          */

126         public void fatalError(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
127             fErrorReporter.fatalError(mapException(exception));
128         }
129     }
130
131     /**
132      * Verbose tracing.
133      */

134     private XercesTracer fTracer;
135
136     /**
137      * The document builder.
138      */

139     private DocBuilder fDocBuilder;
140
141     /**
142      * Is a CDATASection being processed?
143      */

144     private boolean fProcessingCDATASection = false;
145
146     /**
147      * Currently processing a document.
148      */

149     private static final int PROCESSING_DOCUMENT = 0;
150
151     /**
152      * Currently processing the external subset.
153      */

154     private static final int PROCESSING_EXTERNAL_SUBSET = 1;
155
156     /**
157      * Currently processing the internal subset.
158      */

159     private static final int PROCESSING_INTERNAL_SUBSET = 2;
160
161     /**
162      * Part of the document being processed.
163      */

164     private int fProcessingState;
165
166     /**
167      * Classpath/XCatalog entity resolver.
168      */

169     private XMLEntityResolver fResolver;
170
171     /*
172      * String pool indexes of built-in character entities.
173      */

174     private int fAmpIndex;
175     private int fLtIndex;
176     private int fGtIndex;
177     private int fAposIndex;
178     private int fQuotIndex;
179
180
181     /**
182      * @see XMLCParser
183      */

184     public XMLCDocument parse(InputSource JavaDoc input,
185                               LineNumberMap lineNumberMap,
186                               XMLCDomFactory domFactory,
187                               MetaData metaData,
188                               ErrorReporter errorReporter,
189                               ParseTracer tracer)
190         throws IOException JavaDoc, XMLCException, SAXException JavaDoc {
191
192         Parser parser = metaData.getParser();
193         fTracer = new XercesTracer(fStringPool, tracer);
194         fDocBuilder = new DocBuilder(domFactory);
195
196         fProcessingState = PROCESSING_DOCUMENT;
197
198         // Configure parser.
199
initCharEntity();
200         initHandlers(true, this, this);
201         setEntityResolver(this);
202         if (lineNumberMap != null) {
203             setErrorHandler(new MappingErrorHandler(errorReporter,
204                                                     lineNumberMap));
205         } else {
206             setErrorHandler(errorReporter);
207         }
208         setAllowJavaEncodings(true);
209         setNamespaces(true);
210         
211         Boolean JavaDoc validate = parser.getValidate();
212         setValidation((validate == null) ? true : validate.booleanValue());
213
214         // Setup entity resolver
215
fResolver = new XMLEntityResolver();
216         if (tracer.enabled()) {
217             fResolver.setDebugWriter(tracer);
218         }
219         // Add defaults bore adding catalogs so defautls can be overridden.
220
fResolver.setDefaultResolving();
221
222         String JavaDoc[] xCatalog = parser.getXCatalogURLs();
223         for (int idx = 0; idx < xCatalog.length; idx++) {
224             fResolver.loadCatalog(new InputSource JavaDoc(xCatalog[idx]));
225         }
226
227         super.parse(input);
228         fDocBuilder.finish();
229
230         return fDocBuilder.getDocument();
231
232     }
233
234     /**
235      * Get a string from the string pool.
236      */

237     private String JavaDoc getString(int index) {
238         return fStringPool.toString(index);
239     }
240
241     /*
242      * Initialize the built-in character entity name indexes.
243      */

244     private void initCharEntity() {
245         fAmpIndex = fStringPool.addSymbol("amp");
246         fLtIndex = fStringPool.addSymbol("lt");
247         fGtIndex = fStringPool.addSymbol("gt");
248         fAposIndex = fStringPool.addSymbol("apos");
249         fQuotIndex = fStringPool.addSymbol("quot");
250     }
251
252     /**
253      * Determine of an entity is one of the standard character
254      * entities.
255      */

256     boolean isCharEntity(int entityName) {
257         return ((entityName == fAmpIndex) ||
258                 (entityName == fGtIndex) ||
259                 (entityName == fLtIndex) ||
260                 (entityName == fAposIndex) ||
261                 (entityName == fQuotIndex));
262     }
263
264     /**
265      * Resolve an entity.
266      * @see EntityResolver#resolveEntity
267      */

268     public InputSource JavaDoc resolveEntity(String JavaDoc publicId,
269                                      String JavaDoc systemId)
270         throws SAXException JavaDoc, IOException JavaDoc {
271
272         InputSource JavaDoc source = null;
273         if (fResolver != null) {
274             source = fResolver.resolveEntity(publicId, systemId);
275         }
276         fTracer.resolveEntity(publicId, systemId, source);
277         return source;
278     }
279
280     /**
281      * Handle start of document.
282      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startDocument
283      */

284     public void startDocument() throws Exception JavaDoc {
285         fTracer.startDocument();
286     }
287
288     /**
289      * Handle end document.
290      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#endDocument
291      */

292     public void endDocument() throws Exception JavaDoc {
293         fTracer.endDocument();
294     }
295
296     /**
297      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#xmlDecl
298      */

299     public void xmlDecl(int version, int encoding, int standalone) throws Exception JavaDoc {
300         fTracer.xmlDecl(version, encoding, standalone);
301         fDocBuilder.setXMLVersion(getString(version));
302         fDocBuilder.setEncoding(getString(encoding));
303     }
304
305     /**
306      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#textDecl
307      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#textDecl
308      */

309     public void textDecl(int version, int encoding) throws Exception JavaDoc {
310         fTracer.textDecl(version, encoding);
311     }
312
313     /**
314      * Handle start of a namespace declaration scope.
315      *
316      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startNamespaceDeclScope
317      */

318     public void startNamespaceDeclScope(int prefix,
319                                         int uri) throws Exception JavaDoc {
320         fTracer.startNamespaceDeclScope(prefix, uri);
321         // Nothing to do as URI is in QName
322
}
323
324     /**
325      * Handle end of a namespace declaration scope.
326      *
327      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startNamespaceDeclScope
328      */

329     public void endNamespaceDeclScope(int prefix) throws Exception JavaDoc {
330         fTracer.endNamespaceDeclScope(prefix);
331     }
332
333     /**
334      * Handle start of element.
335      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startElement
336      */

337     public void startElement(QName element,
338                              XMLAttrList attrList,
339                              int attrListHandle) throws Exception JavaDoc {
340         fTracer.startElement(element, attrList, attrListHandle);
341         fDocBuilder.startElement(getString(element.uri),
342                                  getString(element.rawname));
343
344         int attrIndex = attrListHandle;
345         while (attrIndex >= 0) {
346             if (attrList.isSpecified(attrIndex)) {
347                 fDocBuilder.addAttribute(getString(attrList.getAttrURI(attrIndex)),
348                                          getString(attrList.getAttrName(attrIndex)),
349                                          getString(attrList.getAttValue(attrIndex)));
350             }
351             attrIndex = attrList.getNextAttr(attrIndex);
352         }
353     }
354
355     /**
356      * Handle end element.
357      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#endElement
358      */

359     public void endElement(QName element) throws Exception JavaDoc {
360         fTracer.endElement(element);
361         fDocBuilder.finishElement();
362     }
363
364     /**
365      * Determine if an entity reference should be processed.
366      * The entity reference callbacks are called at the start and external DTD
367      * with a null name, ignore these.
368      * Also ignore calls when processing attribute value entities references, as
369      * these are called before the start of element.
370      */

371     private boolean shouldProcessEntityReference(int entityName,
372                                                  int entityContext) {
373         return ((entityName >= 0) && (fProcessingState == PROCESSING_DOCUMENT)
374                 && (entityContext != XMLEntityHandler.ENTITYREF_IN_ATTVALUE));
375     }
376
377     /**
378      * Handle the start of an entity reference. If it's is one of the
379      * standard character entity references, we don't push the create
380      * the node, we just let the child be appended directly in its place.
381      *
382      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startEntityReference
383      */

384     public void startEntityReference(int entityName,
385                                      int entityType,
386                                      int entityContext) throws Exception JavaDoc {
387         boolean shouldProcess
388             = shouldProcessEntityReference(entityName, entityContext);
389         fTracer.startEntityReference(entityName, entityType, entityContext,
390                                      shouldProcess);
391         if (shouldProcess && !isCharEntity(entityName)) {
392             fDocBuilder.startEntityReference(getString(entityName));
393         }
394     }
395
396     /**
397      * Handle the end of an entity reference.
398      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#endEntityReference
399      */

400     public void endEntityReference(int entityName,
401                                    int entityType,
402                                    int entityContext) throws Exception JavaDoc {
403         boolean shouldProcess
404             = shouldProcessEntityReference(entityName, entityContext);
405         fTracer.endEntityReference(entityName, entityType, entityContext, shouldProcess);
406
407         if (shouldProcess && !isCharEntity(entityName)) {
408             fDocBuilder.endEntityReference();
409         }
410     }
411
412     /**
413      * Not used.
414      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#characters
415      */

416     public void characters(int data) throws Exception JavaDoc {
417         throw new XMLCError("fatal error: method that should not be invoked called");
418     }
419
420     /**
421      * Not used.
422      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#ignorableWhitespace
423      */

424     public void ignorableWhitespace(int data) throws Exception JavaDoc {
425         throw new XMLCError("fatal error: method that should not be invoked called");
426     }
427
428     /**
429      * Handle start of CDATA section.
430      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#startCDATA
431      */

432     public void startCDATA() {
433         fTracer.startCDATA();
434         fProcessingCDATASection = true;
435     }
436
437     /**
438      * Handle for end of CDATA section.
439      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#endCDATA
440      */

441     public void endCDATA() {
442         fTracer.endCDATA();
443         fProcessingCDATASection = false;
444     }
445
446     /**
447      * Handle processing instruction.
448      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#processingInstruction
449      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#processingInstruction
450      */

451     public void processingInstruction(int target,
452                                       int data) throws Exception JavaDoc {
453         fTracer.processingInstruction(target, data);
454         if (fProcessingState == PROCESSING_DOCUMENT) {
455             fDocBuilder.addProcessingInstruction(getString(target),
456                                                  getString(data));
457         }
458     }
459
460     /**
461      * Handle a comment.
462      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#comment
463      */

464     public void comment(int comment) throws Exception JavaDoc {
465         fTracer.comment(comment);
466         if (fProcessingState == PROCESSING_DOCUMENT) {
467             fDocBuilder.addComment(getString(comment));
468         }
469     }
470
471     /**
472      * Handle characters.
473      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#characters
474      */

475     public void characters(char ch[],
476                            int start,
477                            int length) throws Exception JavaDoc {
478         fTracer.characters(ch, start, length);
479         if (fProcessingCDATASection) {
480             fDocBuilder.addCDATASection(new String JavaDoc(ch, start, length));
481         } else {
482             fDocBuilder.addTextNode(new String JavaDoc(ch, start, length));
483         }
484     }
485
486     /**
487      * Handle ignorable whitespace.
488      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler#ignorableWhitespace
489      */

490     public void ignorableWhitespace(char ch[],
491                                     int start,
492                                     int length) throws Exception JavaDoc {
493         fTracer.ignorableWhitespace(ch, start, length);
494         //FIXME: is this right, we ignore them.
495
}
496
497     /**
498      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#startDTD
499      */

500     public void startDTD(QName rootElement,
501                          int publicId,
502                          int systemId) {
503         fTracer.startDTD(rootElement, publicId, systemId);
504         if ((publicId < 0) && (systemId < 0)) {
505             fProcessingState = PROCESSING_INTERNAL_SUBSET;
506         } else {
507             fProcessingState = PROCESSING_EXTERNAL_SUBSET;
508         }
509         fDocBuilder.setDocumentTypeName(getString(rootElement.rawname));
510         fDocBuilder.setPublicId(getString(publicId));
511         fDocBuilder.setSystemId(getString(systemId));
512     }
513
514     /**
515      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#internalSubset
516      */

517     public void internalSubset(int internalSubset) {
518         fTracer.internalSubset(internalSubset);
519         fDocBuilder.setInternalSubset(getString(internalSubset));
520     }
521
522     /**
523      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#endDTD
524      */

525     public void endDTD() {
526         fTracer.endDTD();
527         fProcessingState = PROCESSING_DOCUMENT;
528     }
529
530     /**
531      * Recursively search for a #PCDATA leaf. The content spec object is
532      * passed to avoid reallocating. It's contents will be wipped out.
533      */

534     private boolean searchForPCData(int contentSpecIndex,
535                                     XMLContentSpec.Provider provider,
536                                     XMLContentSpec contentSpec) {
537         if (!provider.getContentSpec(contentSpecIndex, contentSpec)) {
538             return false;
539         }
540         int value = contentSpec.value;
541         int otherValue = contentSpec.otherValue;
542
543         switch (contentSpec.type) {
544         case XMLContentSpec.CONTENTSPECNODE_LEAF:
545             if ((value == -1) && (otherValue == -1)) {
546                 return true; // #PCDATA leaf
547
}
548             break;
549         case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE:
550         case XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE:
551         case XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE:
552             // search left side only
553
if (searchForPCData(value, provider, contentSpec)) {
554                 return true; // #PCDATA found below
555
}
556             break;
557         case XMLContentSpec.CONTENTSPECNODE_CHOICE:
558         case XMLContentSpec.CONTENTSPECNODE_SEQ:
559             // search left and right sides
560
if (searchForPCData(value, provider, contentSpec)) {
561                 return true; // #PCDATA found below
562
}
563             if (searchForPCData(otherValue, provider, contentSpec)) {
564                 return true; // #PCDATA found below
565
}
566             break;
567         case XMLContentSpec.CONTENTSPECNODE_ANY:
568         case XMLContentSpec.CONTENTSPECNODE_ANY_OTHER:
569         case XMLContentSpec.CONTENTSPECNODE_ANY_NS:
570         case XMLContentSpec.CONTENTSPECNODE_ALL:
571         case XMLContentSpec.CONTENTSPECNODE_ANY_LAX:
572         case XMLContentSpec.CONTENTSPECNODE_ANY_OTHER_LAX:
573         case XMLContentSpec.CONTENTSPECNODE_ANY_NS_LAX:
574         case XMLContentSpec.CONTENTSPECNODE_ANY_SKIP:
575         case XMLContentSpec.CONTENTSPECNODE_ANY_OTHER_SKIP:
576         case XMLContentSpec.CONTENTSPECNODE_ANY_NS_SKIP:
577         default:
578             // Don't recurse
579
break;
580         }
581         return false;
582     }
583
584     /**
585      * Determine if #PCDATA is part of the content spec. Logic for this method
586      * stolen from org.enhydra.apache.xerces.framework.XMLContentSpec.
587      */

588     private boolean hasPCData(int contentSpecIndex,
589                               XMLContentSpec.Provider contentSpecProvider) {
590         return searchForPCData(contentSpecIndex, contentSpecProvider,
591                                new XMLContentSpec());
592     }
593
594     /**
595      * <!ELEMENT Name contentspec>
596      *
597      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#elementDecl
598      */

599     public void elementDecl(QName elementDecl,
600                             int contentSpecType,
601                             int contentSpecIndex,
602                             XMLContentSpec.Provider contentSpecProvider) throws Exception JavaDoc {
603         fTracer.elementDecl(elementDecl, contentSpecType, contentSpecIndex,
604                             contentSpecProvider);
605         if (hasPCData(contentSpecIndex, contentSpecProvider)) {
606             fDocBuilder.addPCDataContentElement(getString(elementDecl.rawname));
607         }
608     }
609
610     /**
611      * <!ATTLIST Name AttDef>
612      *
613      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#attlistDecl
614      */

615     public void attlistDecl(QName elementDecl,
616                             QName attributeDecl,
617                             int attType,
618                             boolean attList,
619                             String JavaDoc enumString,
620                             int attDefaultType,
621                             int attDefaultValue) throws Exception JavaDoc {
622         fTracer.attlistDecl(elementDecl, attributeDecl, attType, attList,
623                             enumString, attDefaultType, attDefaultValue);
624
625         if (attType == XMLAttributeDecl.TYPE_ID) {
626             fDocBuilder.addIdAttribute(getString(elementDecl.localpart),
627                                        getString(attributeDecl.localpart));
628         }
629     }
630
631     /**
632      * <!ENTITY % Name EntityValue>
633      *
634      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#internalPEDecl
635      */

636     public void internalPEDecl(int entityName,
637                                int entityValue) {
638         fTracer.internalPEDecl(entityName, entityValue);
639     }
640
641     /**
642      * <!ENTITY % Name ExternalID>
643      *
644      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#externalPEDecl
645      */

646     public void externalPEDecl(int entityName,
647                                int publicId,
648                                int systemId) {
649         fTracer.externalPEDecl(entityName, publicId, systemId);
650     }
651
652     /**
653      * <!ENTITY Name EntityValue>
654      *
655      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#internalEntityDecl
656      */

657     public void internalEntityDecl(int entityName,
658                                    int entityValue) {
659         fTracer.internalEntityDecl(entityName, entityValue);
660     }
661
662     /**
663      * <!ENTITY Name ExternalID>
664      *
665      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#externalEntityDecl
666      */

667     public void externalEntityDecl(int entityName,
668                                    int publicId,
669                                    int systemId) {
670         fTracer.externalEntityDecl(entityName, publicId, systemId);
671     }
672
673     /**
674      * <!ENTITY Name ExternalID NDataDecl>
675      *
676      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#unparsedEntityDecl
677      */

678     public void unparsedEntityDecl(int entityName,
679                                    int publicId,
680                                    int systemId,
681                                    int notationName) {
682         fTracer.unparsedEntityDecl(entityName, publicId,
683                                    systemId, notationName);
684     }
685
686     /**
687      * <!NOTATION Name ExternalId>
688      *
689      * @see org.enhydra.apache.xerces.framework.XMLDocumentHandler.DTDHandler#notationDecl
690      */

691     public void notationDecl(int notationName,
692                              int publicId,
693                              int systemId) {
694         fTracer.notationDecl(notationName, publicId, systemId);
695     }
696 }
697
Popular Tags