Project

General

Profile

Bug #5956 » rexml_sample.rb

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

 
1
#!/usr/bin/ruby
2

    
3
require "rexml/document"
4
require "rexml/parseexception"
5

    
6
xmldata = <<EOF
7
<?xml version="1.0" encoding="UTF-8"?>
8
<nppns:NetworkPortProfile xmlns:nppns="http://schemas.dmtf.org/ovf/networkportprofile/1"
9
xmlns:xs="http://www.w3.org/2001/XMLSchema"
10
xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common"
11
xmlns:xml="http://www.w3.org/XML/1998/namespace"
12
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
13
xmlns:epasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPortAllocationSettingData">
14
        <epasd:NetworkPortProfileID>
15
                http://www.dmtf.org/networkportporfiles
16
        </epasd:NetworkPortProfileID>
17
        <epasd:NetworkPortProfileIDType>2</epasd:NetworkPortProfileIDType>
18
</nppns:NetworkPortProfile>
19
EOF
20

    
21
doc = REXML::Document.new(xmldata)