如何解析像“drools:version”这样的XML属性?

时间:2014-05-24 12:39:23

标签: xml actionscript-3 actionscript xml-parsing e4x

我有下一个xml元素:

<bpmn2:process id="Process_1" drools:version="1" drools:packageName="defaultPackage" drools:adHoc="false" name="MyNewProcess" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1" name="Start1">
  <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1" drools:priority="1" name="SF1" sourceRef="StartEvent_1" targetRef="Task_1"/>
<bpmn2:endEvent id="EndEvent_1" name="End1">
  <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
</bpmn2:endEvent>

我正在使用ActionScript3.0解析它,如何获得&#39; drools:version&#39;属性值?

我可以获取id myXML.child(0)。@ id但我无法获取myXML.child(0)。@ drools:version !!! 我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

我没有测试能力,但您尝试使用方括号吗?

myXML.child(0)['drools:version']

继续本answer

中的示例