-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issue with parse result from vCD #2
Comments
Further info... here is the XML that came back in string_or_io ����Testb Organization� ���Testb Organization� |
Sorry closed by mistake... still an issue. |
Ok managed to put a band aid round the problem it seems that the ParseOptions set to STRICT break it, by changing this to default_xml, this resolved the issue. Can you recommend how to fix this longer term via the vcloud gem rather than me changing the happymapper.rb...many thanks #xml = Nokogiri::XML(xml, nil, nil, Nokogiri::XML::ParseOptions::STRICT) #OLD LINE |
Couple questions.
|
Thanks for responseŠ
From: Zach Robinson [email protected] Couple questions.
‹ |
looks like it has to do with the unicode chars on these lines: <Description>Testb Organization</Description>
<FullName>Testb Organization</FullName> Those chars are html escaped and need to be html unescaped, for example using CGI.unescapeHTML(xml_stuff) before being fed to nokogiri for parsing. Looking at the best way to do that in the vcloud gem (maybe a restclient option or something). |
I pushed up a new branch called 'unicode' that I think will fix your issue. If you get a chance to give it a try and let me know then I'll push it into the gem if all is good. |
HI again,
All connected, and returning the list of orgs. Next to create an org object, where it fails. Using your example code I cannot get it to work, any help much appreciated.
There is only one org called testorg at the moment.
@session.get_org_references.each do |org_ref|
@org_name = org_ref.name
puts @org_name
end
@org = @session.get_org_from_name(@org_name)
/Users/
'/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml/document.rb:55:in/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml.rb:33:inread_memory': xmlParseCharRef: invalid xmlChar value 1 (Nokogiri::XML::SyntaxError) from /Users/~/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.5/lib/nokogiri/xml/document.rb:55:in
parse'from /Users/
XML' from /Users/~/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/nokogiri-happymapper-0.5.5/lib/happymapper.rb:261:in
parse'from /Users/
/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/nokogiri-happymapper-0.5.5/lib/happymapper.rb:666:in/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/vcloud-0.0.1.1/lib/vcloud/rest_api.rb:88:inparse' from /Users/~/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/vcloud-0.0.1.1/lib/vcloud/parses_xml.rb:30:in
parse_xml'from /Users/
parse_response' from /Users/~/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/vcloud-0.0.1.1/lib/vcloud/rest_api.rb:9:in
refresh'from /Users/
/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/vcloud-0.0.1.1/lib/vcloud/base_vcloud_entity.rb:30:in/NetBeansProjects/vCloud Director/lib/main.rb:19:in `from_reference' from /Users/~/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/gems/1.9.1/gems/vcloud-0.0.1.1/lib/vcloud/client.rb:76:in
get_org_from_name'from /Users/
The text was updated successfully, but these errors were encountered: