Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove_namespaces! corrupts attributes #396

Closed
flavorjones opened this issue Jan 13, 2011 · 2 comments
Closed

remove_namespaces! corrupts attributes #396

flavorjones opened this issue Jan 13, 2011 · 2 comments

Comments

@flavorjones
Copy link
Member

example code:

#! /usr/bin/env ruby

require "rubygems"
require "nokogiri"

xml = <<-EOXML
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
               <Supplement xsi:type="PerRoomSupplement" suppId="5" suppName="Resort
Fee" supptType="8" suppIsMandatory="true" suppChargeType="AtProperty"
price="35.00"/>
       </Body>
</Envelope>
EOXML

doc = Nokogiri::XML xml
puts doc
puts "---"
doc.remove_namespaces!
puts doc

output

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
               <Supplement xsi:type="PerRoomSupplement" suppId="5" suppName="Resort Fee" supptType="8" suppIsMandatory="true" suppChargeType="AtProperty" price="35.00"/>
       </s:Body>
</s:Envelope>

---
<?xml version="1.0" standalone="no"?>
<Envelope>
       <Body>
               <Supplement ����&�:type="PerRoomSupplement" suppId="5" suppName="Resort Fee" supptType="8" suppIsMandatory="true" suppChargeType="AtProperty" price="35.00"/>
       </Body>
</Envelope>
@flavorjones
Copy link
Member Author

closed by 8c2a112

@flavorjones
Copy link
Member Author

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant