Discussion:
Need Example usage of readXml
deepak t.s
2018-11-10 09:23:40 UTC
Permalink
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 :
https://jenkins.io/doc/pipeline/steps/phoenix-autotest/#readxml-readxmlstep
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
--
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-users+***@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.
Jan Monterrubio
2018-11-10 16:28:03 UTC
Permalink
I think it’s

def xml = readXml(‘setup.xml’)
Post by deepak t.s
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
https://jenkins.io/doc/pipeline/steps/phoenix-autotest/#readxml-readxmlstep
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
--
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
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
<https://groups.google.com/d/msgid/jenkinsci-users/CANgX4PrH38JnzS-SHE%3Djv9-ksKP9Cgo5v%2B%2BK%3DVbJMkxqCKcRqw%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9JxiQMrykMXMt9WMHH_-2_8b-cxCUrDn_BVUSA3%2Bj4vpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...