代码片段:
<ce:title id="123"
xmlns:ce="http://www..../dtd">Some sample content,
<ce:ref refid="redif1" id="111">
<ce:sup loc="post">*</ce:sup>
</ce:ref>
<ce:note id="id1">
<ce:label>*</ce:label>
<ce:para id="id123" view="all">Para Content,</ce:para>
</ce:note>Continuation of some sample content.
</ce:title>
细节:
根据上面的代码片段,我想按顺序提取内容。
预期的 O/P:
Some sample content, * * Para Content, Continuation of some sample content.
有没有办法从提供的 XML 中提取上述内容。
提前致谢
**XML Mapping:**
<segment name="header" xmlName="head" class="com.sample.Header" minOccurs="0">
<field name="title" xmlName="title" xmlNamespace="http://www.../dtd" minOccurs="0"/>
<segment name="titleModel" xmlName="title" xmlNamespace="http://www.../dtd" minOccurs="0" class="com.sample.TitleModel">
<segment name="titleRef" xmlName="ref" minOccurs="0" class="com.sample.TitleRef">
<field name="superScript" xmlName="sup" minOccurs="0"/>
</segment>
<segment name="note" xmlName="note" class="com.sample.Note" minOccurs="0">
<field name="label" xmlName="label" minOccurs="0"/>
<field name="para" xmlName="para" minOccurs="0"/>
</segment>
</segment>
.
.
.
</segment>