//System.err.println("Using PullSource(stream)");
ps.setSystemId(input.getSystemId());
if (validation == Validation.DEFAULT) {
return ps;
} else {
AugmentedSource as = AugmentedSource.makeAugmentedSource(ps);
as.setSchemaValidationMode(validation);
return as;
}
} else {
return input;
}
}
Reader reader = input.getReader();
if (reader != null) {
if (reader instanceof DotNetReader && !preferJaxp) {
XmlReader parser = new XmlTextReader(input.getSystemId(),
((DotNetReader)reader).getUnderlyingTextReader());
((XmlTextReader)parser).set_Normalization(true);
((XmlTextReader)parser).set_WhitespaceHandling(WhitespaceHandling.wrap(WhitespaceHandling.All));
if (pipe.getURIResolver() instanceof DotNetURIResolver) {
((XmlTextReader)parser).set_XmlResolver(
((DotNetURIResolver)pipe.getURIResolver()).getXmlResolver());
}
// Always need a validating parser, because that's the only way to get entity references expanded
parser = new XmlValidatingReader(parser);
if (dtdValidation) {
((XmlValidatingReader)parser).set_ValidationType(ValidationType.wrap(ValidationType.DTD));
} else {
((XmlValidatingReader)parser).set_ValidationType(ValidationType.wrap(ValidationType.None));
}
PullSource ps = new PullSource(new DotNetPullProvider(parser));
//System.err.println("Using PullSource(reader)");
ps.setSystemId(input.getSystemId());
if (validation == Validation.DEFAULT) {
return ps;
} else {
AugmentedSource as = AugmentedSource.makeAugmentedSource(ps);
as.setSchemaValidationMode(validation);
return as;
}
} else {
return input;
}
}
String uri = input.getSystemId();
if (uri != null) {
try {
Source r = pipe.getURIResolver().resolve(uri, null);
if (r == null) {
return input;
} else if (r instanceof AugmentedSource) {
Source r2 = ((AugmentedSource)r).getContainedSource();
if (r2 instanceof StreamSource) {
r2 = getParserSource(pipe, (StreamSource)r2, validation, dtdValidation, stripspace);
return r2;
} else {
return r2;
}
} else if (r instanceof StreamSource && r != input) {
Source r2 = getParserSource(pipe, (StreamSource)r, validation, dtdValidation, stripspace);
AugmentedSource as = AugmentedSource.makeAugmentedSource(r2);
as.setPleaseCloseAfterUse(true);
return as;
} else {
return r;
}
} catch (TransformerException err) {