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 3851942
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:14:26+00:00 2026-05-19T17:14:26+00:00

I have sample HTML that I have marked up with some special tags that

  • 0

I have sample HTML that I have marked up with some special tags that will be used by a different program, an example of the html is below. You should note the <START:organization>..<END> elements.

<html>
<head/>
<body>
  <ul>
    <li> <START:organization> Advanced Integrated Pest Management <END> </li>
    <li> <START:organization> American Bakers Association <END> </li>
  </ul>
</body>
</html>

I wanted to use Nokogiri to preprocess the HTML to easily remove irrelevant tags like <script>. I created the following extension to the Nokogiri Document class:

module Nokogiri
  module HTML
    class Document
      def prepare_html
        xpath("//script").remove
        to_html.remove_new_lines
      end
    end
  end
end

The problem is that Nokogiri is changing the <START:organization> element to <organization>.

Is there anyway that I can preserve the HTML to maintain my custom markup tags?

  • 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-05-19T17:14:27+00:00Added an answer on May 19, 2026 at 5:14 pm

    like the other two said, if your input is not standard XML nor HTML you cant really expect a parser designed for that to work.

    nevertheless you could do one of the following:

    1. hack up Nokogiri to work for this
      case
    2. alter other program you are
      using ( curious what it is ) to
      follow standards
    3. write a separate
      parser for the DSL you are using
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are some HTML based games (ie bootleggers.us) that have a simple login form
I have some anchors in HTML that have a class of attrs: <a href=#
I have a simple HTML (as HTA) application that shows strange behavior on Windows
I have a site that has a simple HTML button in a form. All
I have found that my HTML is, to be honest, very clunky. Small, simple
I have a simple form with some plain html input like bellow using ASP.NET
I have a process that is going to create a piece of STATIC html
I have a javascript routine that dynamically creates an HTML page, complete with it's
I have the following sample HTML code: http://pastebin.com/Mya6tPc6 And here is the jQuery code
I have a simple HTML. I am using the JQuery for AJAX purpose. Now,

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.