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

  • Home
  • SEARCH
  • 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 8505191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:14:57+00:00 2026-06-11T02:14:57+00:00

How can I remove an element when parsing XML with Ox? Ox has an

  • 0

How can I remove an element when parsing XML with Ox?

Ox has an append method - (Object) <<(node) but doesn’t seem to have a - (Element) remove method. Nokogiri has a remove function, does Ox have an equivalent?

http://www.ohler.com/ox/Ox/Element.html

  • 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-11T02:14:59+00:00Added an answer on June 11, 2026 at 2:14 am

    Consider this document:

    doc = Ox::Document.new(:version => '1.0')
    top = Ox::Element.new('top')
    top[:name] = 'sample'
    doc << top
    

    Now you can observe:

    doc.nodes.class => Array
    

    Your nodes are just a regular ruby array.
    And thus you have all the Enumerable functionality combined with the Array facilities of Ruby.

    To delete the element we’ve created above, you can do this:

    doc.nodes.delete top
    

    Or an index-based removal if that’s what you need:

    doc.nodes.delete_at 0
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a <ul> element. How can remove all the <li> elements inside it,
Can i remove an element while enumerating through a Properties object ?
$target.remove() can remove the element,but now I want the process to be down with
How can I remove an element but not the content inside that element? <a
How can I remove the closing tag of element c in a XML document?
How can you remove a wpf element by some kind of name? So sth
How can I remove some specific elements from a numpy array? Say I have
we can remove formula from one cell by cell.setCellFormula(null) . but if i want
How can remove similar element(ul) in class .makhzan after click on one of 111
Possible Duplicate: PHP: How to remove specific element from an array? How can i

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.