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 TypeMethodDescriptionTheList
ofMessage
instances generated when parsing the document, which may be emptyGet all of the declaredNamespace
s in the documentGet 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 prefixboolean
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
-
getNamespaces
Get all of the declaredNamespace
s in the document- Returns:
- the
List
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
-