4
使用此代碼:可以使用Groovy MarkupBuilder生成XML,該Groovy MarkupBuilder中包含雙引號?
xml = new groovy.xml.MarkupBuilder()
xmldata = xml.Plugins(nextid: '10') {
Target(name: 'default.auth') {
Port(protocol: 'https') {
mkp.yield 8080
}
}
}
生成的輸出:
<Plugins nextid='10'>
<Target name='default.auth'>
<Port protocol='https'>8083</Port>
</Target>
</Plugins>
但是,有沒有辦法來產生這樣的輸出,用雙引號?
<Plugins nextid="10">
<Target name="default.auth">
<Port protocol="https">8083</Port>
</Target>
</Plugins>
+1由12秒打我給它;) – hvgotcodes 2011-06-15 19:59:42
鏈接不起作用 – buildingagent 2018-01-17 00:59:52
@buildingagent固定鏈接並複製方法定義 – 2018-01-17 04:01:37