99c99 < /** Indicator of whether we are in a DTD */ --- > /** Indicator of whether we are in the DocType */ 101a102,104 > /** Indicator of whether we are in the internal subset */ > protected boolean inInternalSubset = false; > 294a298,299 > if (!inInternalSubset) return; > 309c314 < --- > 312c317 < * This handles an attribute declaration in a DTD --- > * This handles an attribute declaration in the internal subset 323a329,330 > if (!inInternalSubset) > return; 344c351 < buffer.append(">\n"); --- > buffer.append(">\n"); 355a363,366 > > if (!inInternalSubset) > return; > 372,378c383,397 < throws SAXException { < < buffer.append(" \n"); --- > throws SAXException { > //skip entities that come from the dtd > if (!inInternalSubset) > return; > > buffer.append(" if (name.startsWith("%")) { > buffer.append("% ").append(name.substring(1)); > } else { > buffer.append(name); > } > > buffer.append(" \"") > .append(value) > .append("\">\n"); 702a722 > inInternalSubset = !expand; 712a733 > inInternalSubset = false; 724a746,749 > if (inDTD) { > inInternalSubset = false; > return; > } 741,742c766,778 < EntityRef entity = factory.entityRef(name, pub, sys); < getCurrentElement().addContent(entity); --- > /** > * if stack is empty, this entity belongs to an attribute > * in these cases, it is an error on the part of the parser to call startEntity > * but this will help in some cases. > * See org/xml/sax/ext/LexicalHandler.html#startEntity(java.lang.String) > * for more information > */ > if (!(atRoot || stack.isEmpty())) { > EntityRef entity = factory.entityRef(name, pub, sys); > > //no way to tell if the entity was from an attribute or element so just assume element > getCurrentElement().addContent(entity); > } 754a791,792 > if (inDTD) > inInternalSubset = !expand; 797c835 < if (inDTD) { --- > if (inDTD && inInternalSubset) { 826a865,867 > if (!inInternalSubset) > return; > 828,831c869,881 < .append(name) < .append(" \"") < .append(systemID) < .append("\">\n"); --- > .append(name); > if (publicID != null) { > buffer.append(" PUBLIC \"") > .append(publicID) > .append("\" "); > } > if (systemID != null) { > if (publicID == null) > buffer.append(" SYSTEM"); > buffer.append(" \"") > .append(systemID) > .append("\">\n"); > } 846a897,899 > > if (!inInternalSubset) > return;