1 //import groovy.xml.StreamingMarkupBuilder
2 import groovy.xml.MarkupBuilder
3 import groovy.xml.XmlUtil
14 return String.format('%02d', counter)
20 def writer = new StringWriter()
21 xmlDoc = new MarkupBuilder(writer)
22 xmlDoc.setDoubleQuotes(true)
23 xmlDoc.getMkp().xmlDeclaration(version:'1.0', encoding: 'UTF-8')
26 // mkp.xmlDeclaration()
27 // network(xmlns: 'urn:opendaylight:controller:network') {
28 dataFile = new File(args[0])
30 // xmlDoc.network(xmlns: 'urn:opendaylight:controller:network') {
33 // 'topology-id'('topId_'+cnt.get())
37 // 'node-id'('nodeId_'+cnt.get())
38 // 'supporting-ne'('networkId_'+cnt.get())
39 // 'termination-points' {
40 // 'termination-point' {
41 // 'tp-id'('tpId_'+cnt.get())
46 // 'node-id'('nodeId_'+cnt.get())
47 // 'supporting-ne'('networkId_'+cnt.get())
48 // 'termination-points' {
49 // 'termination-point' {
50 // 'tp-id'('tpId_'+cnt.get())
55 // 'node-id'('nodeId_'+cnt.get())
56 // 'supporting-ne'('networkId_'+cnt.get())
57 // 'termination-points' {
58 // 'termination-point' {
59 // 'tp-id'('tpId_'+cnt.get())
61 // 'termination-point' {
62 // 'tp-id'('tpId_'+cnt.get())
69 // 'link-id'('linkId_'+cnt.get())
71 // 'source-node'('nodeId_'+cnt.get())
72 // 'source-tp'('tpId_'+cnt.get(false))
75 // 'dest-node'('nodeId_'+cnt.get())
76 // 'dest-tp'('tpId_'+cnt.get(false))
80 // 'link-id'('linkId_'+cnt.get())
82 // 'source-node'('nodeId_'+cnt.get())
83 // 'source-tp'('tpId_'+cnt.get(false))
86 // 'dest-node'('nodeId_'+cnt.get())
87 // 'dest-tp'('tpId_'+cnt.get(false))
93 // 'network-elements' {
94 // 'network-element' {
95 // 'element-id'('ntElementId_'+cnt.get())
97 // 'network-element' {
98 // 'element-id'('ntElementId_'+cnt.get())
106 // def xmlDoc = new StreamingMarkupBuilder()
107 // xmlDoc.encoding = 'UTF'
108 //println XmlUtil.serialize(xmlDoc.bind(data))