How to parse a xml by ANT

后端 未结 1 568
眼角桃花
眼角桃花 2020-12-10 17:01

trying to build a project set file and checkout these projects:


  
  

        
相关标签:
1条回答
  • 2020-12-10 17:48

    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.

    0 讨论(0)
提交回复
热议问题