Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:03:44+00:00 2026-06-08T06:03:44+00:00

Using the Gem libxml-ruby, when we parse XML like so: document = LibXML::XML::Parser.string( xmlData

  • 0

Using the Gem libxml-ruby, when we parse XML like so:

document = LibXML::XML::Parser.string( xmlData ).parse
for n in document.root.children
  # Do something
end

What we actually get is something like this:

root
-node empty
-node with data
-node empty 

Same thing with attributes, there’s a blank one padding between those we actually care about. What we end up needing to use is :options => LibXML::XML::Parser::Options::NOBLANKS

Why? 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:03:45+00:00Added an answer on June 8, 2026 at 6:03 am

    (Not necessarily an answer, but need formatting.)

    What does the XML look like?

    This XML:

    <baz>
      <plugh>ohai</plugh>
    </baz>
    

    may contain whitespace text nodes for the CR/LF and indentation between the <baz> and <plugh> opening tags, and the same for between the closing tags. This may or may not be significant whitespace depending on the nature of the XML. Structurally, it’s different than:

    <baz><plugh>ohai</plugh></baz>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using libxml-ruby gem to read a xml string. I am unable to
When I download something using gem I'd like to be able to just download
I'm using gem bundler (v.0.9.6) and Rails 2.3.5, rubygems 1.3.6 and ruby 1.8.7 (On
I recently installed a ruby based tooling using gem, and when I try to
I'm using gem 1.3.7 , Ruby 1.9.2, and Rails 3.0.7. Suddenly, when I try
When trying to install the ruby gem libxml-ruby on my windows computer I get
I have already installed Ruby 1.9.3,gem 1.8.24, using RVM in ubantu 12.04. But when
I am using gem 1.3.7, rails 2.3.5 and ruby 1.8.7 (2008-08-11 patchlevel 72). While
I found my gem location using gem env , and it's outside the root
I've installed ruby on rails using gem install rails and got the message that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.