Parsing XML and getting Info to use later

14 views
Skip to first unread message

deepak t.s

unread,
Nov 10, 2018, 7:00:09 AM11/10/18
to Jenkins Users

deepak t.s deepa...@gmail.com

2:53 PM (2 hours ago)
to jenkinsci-users
Hi  team i am tring to use the following utis from  Phoenix AutoTest Plugin
I have writen a grrovy script which i load in scripts block
Comand can be found here :
Ex : 
def extractinfo{
  def xml = readXml xmlFile 'setup.xml'
  // how to parse setup.xml to extract infomation
 // tried xml.products this did not work got null object esxception
 // how to get attribute of a tage upgrade
}

Sample setup.xml
<?xml version="1.0" encoding="UTF-8"?>
<setup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="setup.xsd">
<products>
<vcs>
<vc>
<type>someName</type>
<skip_install>true</skip_install>
<install_type>vcsa</install_type>
<upgrade migrate="false">true</upgrade>
<create_inventory>false</create_inventory>
<hostname>Ip</hostname>
<build_number>12232</build_number>

<os>linux</os>
<setup>
<parent_server>parent</parent_server>
<datastore>df-01</datastore>
<sandbox>false</sandbox>
<!-- <membory_gb>2</membory_gb> <cpu>2</cpu> <cores_per_socket>2</cores_per_socket> -->
<network_adaptor connectto_network_name="soe" name="dsfds" operation=""wrere />
</setup>
<network>
<gateway>somegatewayIp</gateway>
<dns>downwe</dns>
<netmask>sdsrfe</netmask>
</network>
<database>
<type>embedded</type>
<ip>ere454/ip>
</database>
</vc>
</vcs>
</products>
</setup>

Reply all
Reply to author
Forward
0 new messages