ich versuche eine xml nach bestimmte wert auszulesen
Spoiler anzeigen
was ich brauche sind nur die:
<root-step>G</root-step>
uhd <kind text="7"
ergibt
G7
Mein Code bisher um die root-step zu lesen:
bekomme ich
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
in der Zeile Dim ChordName......
Ich komme nicht auf den Fehler.
Ein Tipp wäre willkommen
Danke im Voraus
toto
XML-Quellcode
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
- <score-partwise xmlns:tools="http://schemas.android.com/tools" version="2.0" tools:ignore="EnforceUTF8">
- <movement-title>Blue Bossa</movement-title>
- <identification>
- <creator type="composer">Kenny Dorham</creator>
- <creator type="lyricist">Bossa Nova</creator>
- <rights>Made with iReal Pro</rights>
- <encoding>
- <software>iReal Pro (Android)</software>
- <encoding-date>2016-11-26</encoding-date>
- <supports element="accidental" type="no"/>
- <supports element="transpose" type="no"/>
- <supports attribute="new-page" element="print" type="yes" value="yes"/>
- <supports attribute="new-system" element="print" type="yes" value="yes"/>
- </encoding>
- </identification>
- <defaults>
- <scaling>
- <millimeters>7</millimeters>
- <tenths>40</tenths>
- </scaling>
- <page-layout>
- <page-height>1700</page-height>
- <page-width>1200</page-width>
- <page-margins type="both">
- <left-margin>72</left-margin>
- <right-margin>72</right-margin>
- <top-margin>72</top-margin>
- <bottom-margin>72</bottom-margin>
- </page-margins>
- </page-layout>
- <system-layout>
- <system-margins>
- <left-margin>22</left-margin>
- <right-margin>0</right-margin>
- </system-margins>
- <system-distance>100</system-distance>
- <top-system-distance>73</top-system-distance>
- </system-layout>
- <?DoletiRealb StaffJustificationPercentage=65?>
- <appearance>
- <line-width type="beam">5</line-width>
- <line-width type="heavy barline">5</line-width>
- <line-width type="leger">1.5625</line-width>
- <line-width type="light barline">1.5625</line-width>
- <line-width type="slur middle">2.1875</line-width>
- <line-width type="slur tip">0.625</line-width>
- <line-width type="staff">0.9375</line-width>
- <line-width type="stem">0.9375</line-width>
- <line-width type="tie middle">2.1875</line-width>
- <line-width type="tie tip">0.625</line-width>
- <note-size type="grace">60</note-size>
- <note-size type="cue">75</note-size>
- </appearance>
- <music-font font-family="Opus,music"/>
- <word-font font-family="Times New Roman"/>
- </defaults>
- <part-list>
- <score-part id="P1">
- <part-name print-object="no">Lead sheet</part-name>
- </score-part>
- </part-list>
- <!--=========================================================-->
- <part id="P1">
- <measure number="1">
- <print>
- <system-layout>
- <top-system-distance>210</top-system-distance>
- </system-layout>
- </print>
- <attributes>
- <divisions>768</divisions>
- <key>
- <fifths>-3</fifths>
- <mode>minor</mode>
- </key>
- <time>
- <beats>4</beats>
- <beat-type>4</beat-type>
- </time>
- <clef>
- <sign>G</sign>
- <line>2</line>
- </clef>
- </attributes>
- <barline/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>C</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="2">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>C</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="3">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>F</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="4">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>F</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="5">
- <print new-system="yes"/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>D</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7" parentheses-degrees="yes">minor-seventh</kind>
- <degree>
- <degree-value>5</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>alter</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="6">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>G</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="7" parentheses-degrees="yes">dominant</kind>
- <degree>
- <degree-value>9</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>add</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="7">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>C</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="8">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>C</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="9">
- <print new-system="yes"/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>E</root-step>
- <root-alter>-1</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="10">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>A</root-step>
- <root-alter>-1</root-alter>
- </root>
- <kind text="7">dominant</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="11">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>D</root-step>
- <root-alter>-1</root-alter>
- </root>
- <kind text="maj7">major-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="12">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>D</root-step>
- <root-alter>-1</root-alter>
- </root>
- <kind text="maj7">major-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="13">
- <print new-system="yes"/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>D</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7" parentheses-degrees="yes">minor-seventh</kind>
- <degree>
- <degree-value>5</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>alter</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="14">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>G</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="7" parentheses-degrees="yes">dominant</kind>
- <degree>
- <degree-value>9</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>add</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="15">
- <print/>
- <attributes/>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>C</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7">minor-seventh</kind>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>3072</duration>
- <type>whole</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- <measure number="16">
- <print/>
- <attributes/>
- <barline location="right">
- <bar-style>light-heavy</bar-style>
- </barline>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>D</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="m7" parentheses-degrees="yes">minor-seventh</kind>
- <degree>
- <degree-value>5</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>alter</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>1536</duration>
- <type>half</type>
- <notehead>diamond</notehead>
- </note>
- <harmony print-frame="no" default-y="25" relative-x="10">
- <root>
- <root-step>G</root-step>
- <root-alter>0</root-alter>
- </root>
- <kind text="7" parentheses-degrees="yes">dominant</kind>
- <degree>
- <degree-value>9</degree-value>
- <degree-alter>-1</degree-alter>
- <degree-type>add</degree-type>
- </degree>
- </harmony>
- <note>
- <pitch>
- <step>B</step>
- <alter>-1</alter>
- <octave>4</octave>
- </pitch>
- <duration>1536</duration>
- <type>half</type>
- <notehead>diamond</notehead>
- </note>
- </measure>
- <!--=========================================================-->
- </part>
- </score-partwise>
was ich brauche sind nur die:
<root-step>G</root-step>
uhd <kind text="7"
ergibt
G7
Mein Code bisher um die root-step zu lesen:
VB.NET-Quellcode
- Dim file As String = Path_B & ListView1.FocusedItem.Text & ".xml"
- Dim doc As New XDocument
- doc = XDocument.Load(file)
- For Each element As XElement In doc.Element("score-partwise").Element("part") _
- .Element("measure").Element("harmony").Element("root").Elements()
- Dim ChordName As String = element.Element("root-step").Value
- Label1.Text = (ChordName)
- Next]
bekomme ich
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
in der Zeile Dim ChordName......
Ich komme nicht auf den Fehler.
Ein Tipp wäre willkommen
Danke im Voraus
toto
lg toto
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „VaporiZed“ ()