src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java

Print this page




 991         if(fStaxEntityResolver != null){
 992             staxInputSource = fStaxEntityResolver.resolveEntity(ri);
 993             if(staxInputSource != null) {
 994                 fISCreatedByResolver = true;
 995             }
 996         }
 997 
 998         if(fEntityResolver != null){
 999             xmlInputSource = fEntityResolver.resolveEntity(ri);
1000             if(xmlInputSource != null) {
1001                 fISCreatedByResolver = true;
1002             }
1003         }
1004 
1005         if(xmlInputSource != null){
1006             //wrap this XMLInputSource to StaxInputSource
1007             staxInputSource = new StaxXMLInputSource(xmlInputSource, fISCreatedByResolver);
1008         }
1009 
1010         // do default resolution
1011         //this works for both stax & Xerces, if staxInputSource is null, it means parser need to revert to default resolution

1012         if (staxInputSource == null) {
1013             // REVISIT: when systemId is null, I think we should return null.
1014             //          is this the right solution? -SG
1015             //if (systemId != null)
1016             staxInputSource = new StaxXMLInputSource(new XMLInputSource(publicId, literalSystemId, baseSystemId));

1017         }else if(staxInputSource.hasXMLStreamOrXMLEventReader()){
1018             //Waiting for the clarification from EG. - nb
1019         }
1020 
1021         if (DEBUG_RESOLVER) {
1022             System.err.println("XMLEntityManager.resolveEntity(" + publicId + ")");
1023             System.err.println(" = " + xmlInputSource);
1024         }
1025 
1026         return staxInputSource;
1027 
1028     }
1029 
1030     /**
1031      * Resolves the specified public and system identifiers. This
1032      * method first attempts to resolve the entity based on the
1033      * EntityResolver registered by the application. If no entity
1034      * resolver is registered or if the registered entity handler
1035      * is unable to resolve the entity, then default entity
1036      * resolution will occur.




 991         if(fStaxEntityResolver != null){
 992             staxInputSource = fStaxEntityResolver.resolveEntity(ri);
 993             if(staxInputSource != null) {
 994                 fISCreatedByResolver = true;
 995             }
 996         }
 997 
 998         if(fEntityResolver != null){
 999             xmlInputSource = fEntityResolver.resolveEntity(ri);
1000             if(xmlInputSource != null) {
1001                 fISCreatedByResolver = true;
1002             }
1003         }
1004 
1005         if(xmlInputSource != null){
1006             //wrap this XMLInputSource to StaxInputSource
1007             staxInputSource = new StaxXMLInputSource(xmlInputSource, fISCreatedByResolver);
1008         }
1009 
1010         // do default resolution
1011         //this works for both stax & Xerces, if staxInputSource is null,
1012         //it means parser need to revert to default resolution
1013         if (staxInputSource == null) {
1014             // REVISIT: when systemId is null, I think we should return null.
1015             //          is this the right solution? -SG
1016             //if (systemId != null)
1017             staxInputSource = new StaxXMLInputSource(
1018                     new XMLInputSource(publicId, literalSystemId, baseSystemId), false);
1019         }else if(staxInputSource.hasXMLStreamOrXMLEventReader()){
1020             //Waiting for the clarification from EG. - nb
1021         }
1022 
1023         if (DEBUG_RESOLVER) {
1024             System.err.println("XMLEntityManager.resolveEntity(" + publicId + ")");
1025             System.err.println(" = " + xmlInputSource);
1026         }
1027 
1028         return staxInputSource;
1029 
1030     }
1031 
1032     /**
1033      * Resolves the specified public and system identifiers. This
1034      * method first attempts to resolve the entity based on the
1035      * EntityResolver registered by the application. If no entity
1036      * resolver is registered or if the registered entity handler
1037      * is unable to resolve the entity, then default entity
1038      * resolution will occur.