Reading XML using Groovy's XmlSlurper

阅读更多
Reading XML using Groovy's XmlSlurper

http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlSlurper

example is :

    PolicyCombiningAlgId="urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:permit-overrides"
    xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os" >
   
       
.......

class Mygroovy {

    static main(args) {
        def id = new XmlSlurper().parse(new File('D:/policies/role/boss-policy.xml'))[email protected]()
        print id
    }

}


output : org.talend.xacml.permissions.role.boss

你可能感兴趣的:(Reading XML using Groovy's XmlSlurper)