首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >分发XML文件

分发XML文件
EN

Stack Overflow用户
提问于 2013-01-21 16:43:02
回答 1查看 54关注 0票数 1

我对XML及其功能完全陌生。

我有一个文件叫xyz.xml。它包含如下内容:

代码语言:javascript
复制
<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>

接下来我要说的是

代码语言:javascript
复制
  <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>下),如果是的话,是如何做到的?

EN

回答 1

Stack Overflow用户

发布于 2013-01-21 17:02:16

因此,您希望提取代理属性部分?你可以通过简单的XSLT转换来做到这一点(例如使用Xalan )。另一种选择是jsoup,使用DOM或手动解析它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14435023

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档