Need Example usage of readXml

155 views
Skip to first unread message

deepak t.s

unread,
Nov 10, 2018, 4:35:17 AM11/10/18
to jenkins...@googlegroups.com
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>

Thanks

Jan Monterrubio

unread,
Nov 10, 2018, 11:28:26 AM11/10/18
to jenkins...@googlegroups.com
I think it’s 

def xml = readXml(‘setup.xml’)

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANgX4PrH38JnzS-SHE%3Djv9-ksKP9Cgo5v%2B%2BK%3DVbJMkxqCKcRqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages