2011-12-20 2 views

답변

5

통화 속성을 포함하고, 아래와 같이 다음 remove('attr name') 전화 소자에 attributes()에게.

attributes().remove('attr name') 

자세한 내용은 여기를 참조하십시오.

+0

아, 문서에서 attributes() 메소드를 볼 수 없습니다. 포인터 주셔서 감사 드리며 내가 생각해 낸 마지막 방법을 살펴보십시오. –

2
/** 
* Remove all attributes from the root body tag 
*/ 
def removeBodyAttributes() { 
    def attributeNames = bodyXml.attributes().collect {it.key} 
    println attributeNames 
    println bodyXml.attributes() 
    attributeNames.each {bodyXml.attributes().remove(it)} 
    println bodyXml.attributes() 
} 
관련 문제