0
My xmlファイル。xmlファイルから複合型(選択肢)の要素の名前を取得する
<?xml version="1.0" encoding="UTF-8"?>
<tns:military xmlns:tns="Military.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="Military.xsd Military.xsd ">
<personel sicilNo="0" title="Bay">
<militaryP>
<class>
<erbas>
<ad>aaa</ad>
<soyad>bbb</soyad>
<telefon>5556667788</telefon>
<yas>30</yas>
<rankErbas>Uzman</rankErbas>
</erbas>
</class>
<department>tabur</department>
</militaryP>
</personel>
</tns:military>
xmlスキーマに基づく。
<complexType name="tClass">
<choice>
<element name="erbas" type="tns:tErbas"></element>
<element name="astSubay" type="tns:tAstsubay"></element>
<element name="subay" type="tns:tSubay"></element>
<element name="general" type="tns:tGeneral"></element>
</choice>
</complexType>
私はクラス要素の名前を取得したいと思いますが、どのように処理できますか?私はそれを取得した後、私はswitch/caseステートメントでそれを使用します。 (私の例では、私は "erbas" を取得したい)
switch(class)
case(erbas) ....
case(astsubay) ...