且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何解析由ANT一个XML

更新时间:2023-11-21 17:01:58

我用这个http://www.oopsconsultancy.com/software/xmltask/在过去的处理与ANT XML。我扔得到各个属性的共同快速的样品。

I've used this http://www.oopsconsultancy.com/software/xmltask/ in the past to process XML with ANT. I threw together a quick sample of getting each individual attribute.

    <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>
    <xmltask source="test.xml">
        <call path="psf/project">
            <param name="ref" path="@ref"/>
            <actions>
                <echo>ref = @{ref}</echo>
            </actions>
        </call>
    </xmltask>

不知道这是否会满足您的需求,但它的工作单独获得属性值。

Not sure if this will suit your needs, but it does work to get the attribute values individually.