Skip to content

Instantly share code, notes, and snippets.

@doxavore
Created October 19, 2012 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doxavore/3920696 to your computer and use it in GitHub Desktop.
Save doxavore/3920696 to your computer and use it in GitHub Desktop.
Nokogiri 1.5.5: CRuby vs JRuby
<?xml version="1.0"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<D:href>some url one</D:href>
</D:response>
<D:response>
<D:href>some url two</D:href>
</D:response>
</D:multistatus>
<?xml version="1.0"?>
<D:multistatus xmlns:D="DAV:">
<D:response>
<href>some url one</href>
</D:response>
<response>
<href>some url two</href>
</response>
</D:multistatus>
require 'nokogiri'
doc = Nokogiri::XML::Builder.new do |xml_base|
xml_base.send('multistatus', 'xmlns:D' => 'DAV:') do
xml_base.parent.namespace = xml_base.parent.namespace_definitions.first
xml = xml_base['D']
xml.response do
xml.href "some url one"
end
xml.response do
xml.href "some url two"
end
end
end
puts doc.to_xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment