Project

General

Profile

Bug #5956 » rexml_sample.rb

m-hiramatsu (Miho Hiramatsu), 02/01/2012 03:47 PM

 
#!/usr/bin/ruby

require "rexml/document"
require "rexml/parseexception"

xmldata = <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<nppns:NetworkPortProfile xmlns:nppns="http://schemas.dmtf.org/ovf/networkportprofile/1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
xmlns:epasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPortAllocationSettingData">
<epasd:NetworkPortProfileID>
http://www.dmtf.org/networkportporfiles
</epasd:NetworkPortProfileID>
<epasd:NetworkPortProfileIDType>2</epasd:NetworkPortProfileIDType>
</nppns:NetworkPortProfile>
EOF

doc = REXML::Document.new(xmldata)
    (1-1/1)