0
我有下面的代碼運行良好,並基於前一個請求的響應構建請求。我現在需要做的就是在條件允許的情況下構建節點,如果問題存在。有異常是真的。 爲真。 如何在下面的代碼中包含if條件以僅包含標記設置爲true的節點?SoapUI -Groovy XML.Markupbuilder如果條件
root = new XmlSlurper().parseText(xml)
def sw = new StringWriter()
def request = new groovy.xml.MarkupBuilder(sw)
request.UpdateTargetGroupList{
root.Body.GetQualityIndicatorsResponse.GetQualityIndicatorsOutput.QIDetails.GroupList.Group.each{group->
//Group{
ID(group.ID)
RowVersion(group.RowVersion)
QuestionList{
group.QuestionList.Question.each{question->
Question(){
ID(question.ID)
RowVersion(question.RowVersion)
QuestionType(question.QuestionType)
TargetValue(question.TargetValue)
}
}
}
}
}
}
log.info sw
你有機會看看解決方案嗎? – Rao