我对XML及其功能完全陌生。
我有一个文件叫xyz.xml。它包含如下内容:
<system-config>
<business-model>
<agent-category key="operator">
<singular-name>Operator</singular-name>
<plural-name>Operators</plural-name>
<attribute>agent-attribute.reference</attribute>
</agent-category>接下来我要说的是
<agent-attribute id="agent-attribute.reference">
<name>Reference</name>
< description>A unique identifier for this agent, typically an MSISDN.</description>
<mandatory>true< /mandatory>
<editable>false< /editable>
<deletable>false< /deletable>
<sensitive>false< /sensitive>
<system-generated>false< /system-generated>
<input-method xsi:type="AgentReferenceInputMethod"></input-method>
<storage-location xsi:type="AgentRefStorage" field="reference"></storage-location>
</agent-attribute>
</business-model>
现在,我希望将代理属性分发到名为agentAttr.xml的不同文件中。
有没有可能做到这一点(请注意,<agent-attribute>是在<system-config><business-model>下),如果是的话,是如何做到的?
发布于 2013-01-21 17:02:16
因此,您希望提取代理属性部分?你可以通过简单的XSLT转换来做到这一点(例如使用Xalan )。另一种选择是jsoup,使用DOM或手动解析它。
https://stackoverflow.com/questions/14435023
复制相似问题