MusicXmlDocument class

Internal representation of a MusicXML Document. Represents the top level object which holds the MusicXML document Responsible for loading the .xml or .mxl file using the _get_score method If the file is .mxl, this class uncompresses it After the file is loaded, this class then parses the document into memory using the parse method.

Constructors

MusicXmlDocument(String title, XmlDocument score, Map<String, ScorePart> scoreParts, List<Part> parts, double totalTimeSecs)
MusicXmlDocument.fromXml(XmlDocument score)
factory
MusicXmlDocument.parse(String input)
Parse the uncompressed MusicXML document.
factory

Properties

attributes List<XmlAttribute>
Return the attribute nodes of this node in document order.
no setterinherited
childElements Iterable<XmlElement>
Return an Iterable over the XmlElement children of this node.
no setterinherited
children → XmlNodeList<XmlNode>
Return the direct children of this node in document order.
finalinherited
declaration → XmlDeclaration?
Return the XmlDeclaration element, or null if not defined.
no setterinherited
doctypeElement → XmlDoctype?
Return the XmlDoctype element, or null if not defined.
no setterinherited
firstChild → XmlNode?
Return the first child of this node, or null if there are no children.
no setterinherited
firstElementChild → XmlElement?
Return the first child XmlElement, or null if there are none.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasParent bool
Test whether the node has a parent or not.
no setterinherited
lastChild → XmlNode?
Return the last child of this node, or null if there are no children.
no setterinherited
lastElementChild → XmlElement?
Return the last child XmlElement, or null if there are none.
no setterinherited
nodeType → XmlNodeType
Return the node type of this node.
no setterinherited
parent → XmlNode?
Return the parent node of this node, or null if there is none.
no setterinherited
parts List<Part>
final
rootElement → XmlElement
Return the root XmlElement of the document, or throw a StateError if the document has no such element.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
score → XmlDocument
final
scoreParts Map<String, ScorePart>
ScoreParts indexed by id.
final
text String
Returns the concatenated text of this node or its descendants, for text, CDATA, and comment nodes return the textual value of the node.
no setterinherited
title String
final
totalTimeSecs double
Total time in seconds
final
value String?
Returns the value of the node, or null.
no setterinherited

Methods

accept(XmlVisitor visitor) → void
Dispatch the invocation depending on this type to the visitor.
inherited
attachParent(covariant XmlNode parent) → void
Internal helper to attach a child to this parent, do not call directly.
inherited
copy() → XmlDocument
Return a copy of this node and all its children.
inherited
detachParent(covariant XmlNode parent) → void
Internal helper to detach a child from its parent, do not call directly.
inherited
getAttribute(String name, {String? namespace}) String?
Return the attribute value with the given name, or null.
inherited
getAttributeNode(String name, {String? namespace}) → XmlAttribute?
Return the attribute node with the given name, or null.
inherited
getElement(String name, {String? namespace}) → XmlElement?
Return the first child element with the given name, or null.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String name, {String? namespace}) → void
Removes the attribute value with the given fully qualified name.
inherited
setAttribute(String name, String? value, {String? namespace}) → void
Set the attribute value with the given fully qualified name to value. If an attribute with the name already exist, its value is updated. If the value is null, the attribute is removed.
inherited
toString() String
A string representation of this object.
inherited
toXmlString({bool pretty = false, XmlEntityMapping? entityMapping, int? level, String? indent, String? newLine, Predicate<XmlNode>? preserveWhitespace, Predicate<XmlAttribute>? indentAttribute, Comparator<XmlAttribute>? sortAttributes, Predicate<XmlNode>? spaceBeforeSelfClose}) String
Return an XML string of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited