Package org.openpreservation.format.xml
Interface ParseResult
- All Known Subinterfaces:
ValidationResult
public interface ParseResult
An interface defining the properties of XML document parsing results.
A
ParseResult
comprises various high level properties of the
parsed XML document, such as the root element name, namespace, etc.-
Method Summary
Modifier and TypeMethodDescriptionGet all of the declaredNamespace
s in the documentTheList
ofMessage
instances generated when parsing the document, which may be emptyGet the root elementAttribute
sgetRootAttributeValue
(String qName) Get the value of the root element attribute with the supplied qualified name.Get the unqualified name of the document's root elementGet theNamespace
associated with the document's root elementGet the root element namespace prefixGet all of the declaredNamespace
s in the documentboolean
isRootName
(String name) Establish whether the document's root element name matches the supplied nameboolean
Is the XML document well formed?
-
Method Details
-
isWellFormed
boolean isWellFormed()Is the XML document well formed?- Returns:
true
if the result is for a well formed XML document, otherwisefalse
-
getRootNamespace
Namespace getRootNamespace()Get theNamespace
associated with the document's root element- Returns:
- the
Namespace
of the document's root element
-
getDeclaredNamespaces
Get all of the declaredNamespace
s in the document- Returns:
- the
Set
of the document's namespaces
-
getUsedNamespaces
Get all of the declaredNamespace
s in the document- Returns:
- the
Set
of the document's namespaces
-
getRootPrefix
String getRootPrefix()Get the root element namespace prefix- Returns:
- The
String
namesapce prefix of the document's root element, or an emptyString
if there is no root element NS prefix
-
getRootName
String getRootName()Get the unqualified name of the document's root element- Returns:
- The
String
unqualified name of the document's root element, or an emptyString
if there is no root element name
-
isRootName
Establish whether the document's root element name matches the supplied name- Parameters:
name
- theString
name to compare with the document's root element name- Returns:
true
if the document's root element name matches the suppliedname
, otherwisefalse
-
getRootAttributes
Get the root elementAttribute
s- Returns:
- the
List
root elementAttribute
s
-
getRootAttributeValue
Get the value of the root element attribute with the supplied qualified name.- Parameters:
qName
- theString
qualified name of theAttribute
that the value is required of.
- Returns:
- the value of the
Attribute
, or
null
if theAttribute
does not exist
-
getMessages
TheList
ofMessage
instances generated when parsing the document, which may be empty- Returns:
- the
List
of document parsing messages
-