Mercurial > hg > openjdk > jdk6 > jaxp
changeset 121:6c2627e1bef3
8130078: Document better processing
Reviewed-by: dfuchs, lancea, ahgross
author | aefimov |
---|---|
date | Tue, 27 Oct 2015 04:53:10 +0000 |
parents | 94f63e065244 |
children | 888dd6818731 |
files | drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java |
diffstat | 3 files changed, 34 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java Tue Oct 27 04:44:49 2015 +0000 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java Tue Oct 27 04:53:10 2015 +0000 @@ -375,6 +375,26 @@ } // scanDTDInternalSubset(boolean,boolean,boolean):boolean + /** + * Skip the DTD if javax.xml.stream.supportDTD is false. + * + * @param supportDTD The value of the property javax.xml.stream.supportDTD. + * @return true if DTD is skipped, false otherwise. + * @throws java.io.IOException if i/o error occurs + */ + @Override + public boolean skipDTD(boolean supportDTD) throws IOException { + if (!supportDTD) { + fStringBuffer.clear(); + if (!fEntityScanner.scanData("]", fStringBuffer)) { + fEntityScanner.fCurrentEntity.position--; + } + + return true; + } + return false; + } + // // XMLComponent methods //
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java Tue Oct 27 04:44:49 2015 +0000 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java Tue Oct 27 04:53:10 2015 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. */ /* @@ -1113,11 +1113,14 @@ again = false; switch (fScannerState) { case SCANNER_STATE_DTD_INTERNAL_DECLS: { + boolean moreToScan = false; + if (!fDTDScanner.skipDTD(fSupportDTD)) { // REVISIT: Should there be a feature for // the "complete" parameter? boolean completeDTD = true; - boolean moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD); + moreToScan = fDTDScanner.scanDTDInternalSubset(completeDTD, fStandalone, fHasExternalDTD && fLoadExternalDTD); + } Entity entity = fEntityScanner.getCurrentEntity(); if(entity instanceof Entity.ScannedEntity){ fEndPos=((Entity.ScannedEntity)entity).position;
--- a/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java Tue Oct 27 04:44:49 2015 +0000 +++ b/drop_included/jaxp_src/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java Tue Oct 27 04:53:10 2015 +0000 @@ -96,5 +96,14 @@ public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException; + /** + * Skip the DTD if javax.xml.stream.supportDTD is false. + * @param supportDTD The value of the property javax.xml.stream.supportDTD. + * @return true if DTD is skipped, false otherwise. + * @throws java.io.IOException if i/o error occurs + */ + public boolean skipDTD(boolean supportDTD) + throws IOException; + public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer); } // interface XMLDTDScanner