musicxml-dom 0.1.0

experimental musicxml parsing library
Documentation
pub struct LinkAttributes {
    href: String,
    role: Option<String>,
    title: Option<String>,
    show: String,
    actuate: String,
}

pub struct Work {
    work_number: Option<String>,
    work_title: Option<String>,
    opus: Option<LinkAttributes>,
}

pub struct TypedText {
    content: String,
    // keyword
    type_: Option<String>,
}

pub struct Supports {
    type_: bool,
    element: String,
    attribute: Option<String>,
    value: Option<String>,
}

pub enum Encoding {
    EncodingDate(String),
    Encoder(TypedText),
    Software(String),
    EncodingDescription(String),
    Supports(Supports),
}

pub struct Miscellaneous {
    name: String,
    value: String,
}

/**
 * encoding and miscellaneous don't exactly represent the source blocks.  If the encoding or
 * miscellaneous tags exist, but they don't have any contents, they will still be empty vectors.
 * I don't think this is an issue.  I can't think of a reason a parser would want to pay attention
 * to that.
 */
pub struct Identification {
    creator: Vec<TypedText>,
    rights: Vec<TypedText>,
    encoding: Vec<Encoding>,
    source: Option<String>,
    relation: Vec<TypedText>,
    miscellaneous: Vec<Miscellaneous>,
}

pub struct ScoreHeader {
    work: Option<Work>,
    movement_number: Option<String>,
    movement_title: Option<String>,
    identification: Option<Identification>,
}

pub struct ScorePartwise {
    version: String,
    score_header: ScoreHeader,
}

pub enum Document {
    ScorePartwise(ScorePartwise),
    //ScoreTimewise(ScoreTimewise),
}

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
}