SimpleFramework Xml解析

时间:2016-07-15 15:54:12

标签: java xml parsing simple-framework

我们必须解析XML字符串

<GetTimetableEntriesResponse Result="Success">
    <TimetableEntries>
        <TimetableEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" order="1" TimetableEntryId="7645" TimetableEntryGroupId="1739" Name="Alm_04.jpg" Duration="7000">
            <Template xsi:type="XmlImageTemplate" duration="7000">
                <VerticalScroll>false</VerticalScroll>
                <HorizontalScroll>false</HorizontalScroll>
                <ScrollSpeed>50</ScrollSpeed>
                <ScrollSpeedBack>100</ScrollSpeedBack>
                <ScrollStartDelay>0</ScrollStartDelay>
                <MediaItem id="6629" x="0" y="0" zIndex="0" type="jpg">
                    <width xsi:nil="true" />
                    <height xsi:nil="true" />
                    <rotation xsi:nil="true" />
                    <rotationcenterx xsi:nil="true" />
                    <rotationcentery xsi:nil="true" />
                    <alpha xsi:nil="true" />
                    <VerticalScroll xsi:nil="true" />
                    <HorizontalScroll xsi:nil="true" />
                    <ScrollSpeed xsi:nil="true" />
                    <ScrollSpeedBack xsi:nil="true" />
                    <ScrollStartDelay xsi:nil="true" />
                    <Loop xsi:nil="true" />
                </MediaItem>
                <Effect xsi:type="XmlFade" start="0" from="0" to="1" duration="500" />
                <Effect xsi:type="XmlFade" start="6500" from="1" to="0" duration="500" />
                <TemplateSource xsi:nil="true" />
            </Template>
        </TimetableEntry>
      </GetTimetableEntriesResponse>

<TimetableEntry>直接在其中没有<Template>,以编程方式在名为<TimetableData>的子类中处理<TimetableEntry>

这意味着我们在java中处理它:

<TimetableEntry> 
    <TimetableData>
        <Template></Template>
    </TimetableData>
</TimetableEntry>

我们不知道如何在对象中解析它。

0 个答案:

没有答案