001 package com.thaiopensource.xml.sax;
002
003 import org.xml.sax.DTDHandler;
004 import org.xml.sax.SAXException;
005
006 public class ForkDTDHandler implements DTDHandler {
007 private final DTDHandler dh1;
008 private final DTDHandler dh2;
009
010 public ForkDTDHandler(DTDHandler dh1, DTDHandler dh2) {
011 this.dh1 = dh1;
012 this.dh2 = dh2;
013 }
014
015 public void notationDecl(String name,
016 String publicId,
017 String systemId)
018 throws SAXException {
019 dh1.notationDecl(name, publicId, systemId);
020 dh2.notationDecl(name, publicId, systemId);
021 }
022
023 public void unparsedEntityDecl(String name,
024 String publicId,
025 String systemId,
026 String notationName)
027 throws SAXException {
028 dh1.unparsedEntityDecl(name, publicId, systemId, notationName);
029 dh2.unparsedEntityDecl(name, publicId, systemId, notationName);
030 }
031 }