⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (847 Bytes)
Bug #2423
» rexml_test.rb
modified rexml test -
tenderlovemaking (Aaron Patterson)
, 12/03/2009 12:20 PM
require
'nokogiri'
require
'rexml/document'
docstring
=
<<
EOS
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE x SYSTEM "licenseOut.xsd">
<a>
<c>A bigger than B</c>
</a>
EOS
nd
=
Nokogiri
::
XML
.
parse
(
docstring
)
noko_value
=
nd
.
xpath
(
"//c"
).
text
puts
(
"noko_value:
#{
noko_value
}
"
)
xml_doc
=
REXML
::
Document
.
new
(
docstring
)
return_string
=
xml_doc
.
root
.
elements
[
"//c"
].
text
puts
(
"return_string:
#{
return_string
}
"
)
########################################################
docstring
=
<<
EOS
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE x SYSTEM "licenseOut.xsd">
<a>
<c>A > B</c>
</a>
EOS
nd
=
Nokogiri
::
XML
.
parse
(
docstring
)
noko_value
=
nd
.
xpath
(
"//c"
).
text
puts
(
"noko_value:
#{
noko_value
}
"
)
xml_doc
=
REXML
::
Document
.
new
(
docstring
)
return_string
=
xml_doc
.
root
.
elements
[
"//c"
].
text
puts
(
"return_string:
#{
return_string
}
"
)
« Previous
1
2
Next »
(2-2/2)
Loading...