01: /*
02: * @(#)XmlChars.java 1.1 00/08/05
03: *
04: * Copyright (c) 1998 Sun Microsystems, Inc. All Rights Reserved.
05: */
06:
07: package com.sun.xml.dtdparser;
08:
09: import org.xml.sax.EntityResolver;
10: import org.xml.sax.InputSource;
11: import org.xml.sax.SAXException;
12:
13: import java.io.IOException;
14: import java.net.URL;
15:
16: final class ExternalEntity extends EntityDecl {
17: String systemId; // resolved URI (not relative)
18: String publicId; // "-//xyz//....//en"
19: String notation;
20:
21: public ExternalEntity(InputEntity in) {
22: }
23:
24: public InputSource getInputSource(EntityResolver r)
25: throws IOException, SAXException {
26:
27: InputSource retval;
28:
29: retval = r.resolveEntity(publicId, systemId);
30: // SAX sez if null is returned, use the URI directly
31: if (retval == null)
32: retval = Resolver.createInputSource(new URL(systemId),
33: false);
34: return retval;
35: }
36: }
|