Modifier and Type | Field and Description |
---|---|
URL |
baseURL
The URL against which a relative system ID of the DTD should be
resolved.
|
String |
documentTypeName
The document type name.
|
String |
publicId
The public ID of the DTD, if any.
|
String |
systemId
The system ID of the DTD.
|
Constructor and Description |
---|
DTDSpec(String documentTypeName,
String publicId,
String systemId,
URL baseURL)
Constructs an empty DTD specification containing no declarations at
all.
|
DTDSpec(String documentTypeName,
String publicId,
String systemId,
URL baseURL,
Decl[] externalSubsetDecls)
Constructs DTD specification containing specified external subset.
|
Modifier and Type | Method and Description |
---|---|
AttributeDecl |
attributeDecl(String eName,
String aName,
String type,
String mode,
String value,
boolean fromExternalSubset)
Adds specified attribute declaration to this DTD specification.
|
ElementDecl |
elementDecl(String name,
String model,
boolean fromExternalSubset)
Adds specified element declaration to this DTD specification.
|
boolean |
externalSubsetIsGrammar()
Returns
true if the external subset of this DTD is a
grammar (contains declarations of elements and not just declarations of
entities); otherwise returns false . |
Decl[] |
getExternalSubsetDecls()
Returns the (possibly empty) array containing all declarations found in
the external subset of this DTD.
|
URL |
getExternalSubsetURL()
Returns the fully resolved, possibly using XML catalogs, URL of the
external subset of this DTD.
|
Decl[] |
getInternalSubsetDecls()
Returns the (possibly empty) array containing all declarations found in
the internal subset of this DTD.
|
byte |
getInternalSubsetFlag()
Not for public use: returns the internal subset flag.
|
boolean |
internalSubsetIsGrammar()
Returns
true if the internal subset of this DTD is a
grammar (contains declarations of elements and not just declarations of
entities); otherwise returns false . |
boolean |
isGrammar()
Returns
true if this DTD is a grammar (contains
declarations of elements and not just declarations of entities);
otherwise returns false . |
NotationDecl |
notationDecl(String name,
String publicId,
String systemId,
URL baseURL,
boolean fromExternalSubset)
Adds specified notation declaration to this DTD specification.
|
void |
setInternalSubsetFlag(int internalSubsetFlag)
Not for public use: specifies the internal subset flag.
|
public final String documentTypeName
public final String publicId
null
.public final String systemId
baseURL
.public DTDSpec(String documentTypeName, String publicId, String systemId, URL baseURL)
elementDecl(java.lang.String, java.lang.String, boolean)
, elementDecl(java.lang.String, java.lang.String, boolean)
, notationDecl(java.lang.String, java.lang.String, java.lang.String, java.net.URL, boolean)
.documentTypeName
- The document type name.publicId
- The public ID of the DTD, if any. May be
null
.systemId
- The system ID of the DTD.baseURL
- The URL against which a relative system ID of the DTD
should be resolved.public DTDSpec(String documentTypeName, String publicId, String systemId, URL baseURL, Decl[] externalSubsetDecls)
documentTypeName
- The document type name.publicId
- The public ID of the DTD, if any. May be
null
.systemId
- The system ID of the DTD.baseURL
- The URL against which a relative system ID of the DTD
should be resolved.externalSubsetDecls
- Declarations found in the external subset of
this DTD.public ElementDecl elementDecl(String name, String model, boolean fromExternalSubset)
name
- Qualified name of the element.model
- Content model of the element (as found in the DTD).fromExternalSubset
- If true
, this declaration
is found in the external subset.
If false
, this declaration is found in the
internal subset.public AttributeDecl attributeDecl(String eName, String aName, String type, String mode, String value, boolean fromExternalSubset)
eName
- Qualified name of the elemen having the attribute.aName
- Qualified name of the attribute.type
- Type of the attribute: CDATA, ID,
IDREF, etc.mode
- Mode of the attribute: #IMPLIED,
#REQUIRED, #FIXED.value
- Value of the attribute. Enumerated values are separated by
character '|'.fromExternalSubset
- If true
, this declaration
is found in the external subset.
If false
, this declaration is found in the
internal subset.public NotationDecl notationDecl(String name, String publicId, String systemId, URL baseURL, boolean fromExternalSubset)
name
- The name of the notation.publicId
- The public ID of the notation, if any. May be
null
.systemId
- The system ID of the notation.baseURL
- The URL against which a relative system ID of the
notation should be resolved.fromExternalSubset
- If true
, this declaration
is found in the external subset.
If false
, this declaration is found in the
internal subset.public void setInternalSubsetFlag(int internalSubsetFlag)
internalSubsetFlag
- -1=not set, 0=declarations not influenced by
the presence of an internal subset, 1=declarations possibly influenced
by the presence of an internal subset.public byte getInternalSubsetFlag()
public Decl[] getInternalSubsetDecls()
public Decl[] getExternalSubsetDecls()
public boolean isGrammar()
true
if this DTD is a grammar (contains
declarations of elements and not just declarations of entities);
otherwise returns false
.public boolean externalSubsetIsGrammar()
true
if the external subset of this DTD is a
grammar (contains declarations of elements and not just declarations of
entities); otherwise returns false
.public boolean internalSubsetIsGrammar()
true
if the internal subset of this DTD is a
grammar (contains declarations of elements and not just declarations of
entities); otherwise returns false
.public URL getExternalSubsetURL()
null
if this URL is
unknown or malformed.