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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:03:14+00:00 2026-05-29T16:03:14+00:00

I wrote a small script, which parses a XML-file, deletes some redundant elements and

  • 0

I wrote a small script, which parses a XML-file, deletes some redundant elements and writes the rest back to a new XML-file using $xml->print_to_file();.

Everything works fine, except that double quotes inside the tag’s text, which have been escaped with " are normal double quotes now. I didn’t find a config similar to escape_gt to prevent this behaviour. Is there such a config or an other way to keep double quotes escaped?

My twig config looks like this:

my $xml = XML::Twig->new(
    twig_handlers => {
        label => \&purge_file
    },
    pretty_print => 'indented',
    output_encoding => 'utf-8',
    escape_gt => 1
);
  • 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-29T16:03:15+00:00Added an answer on May 29, 2026 at 4:03 pm

    There’s no reason to escape quotes in XML text. Double-quotes only need to be escaped in attribute values quoted with double-quotes, and I’m sure you’ll find that XML::Twig escapes those.


    …but it is possible by mucking with XML::Twig’s guts:

    XML::Twig::Elt::set_replaced_ents(qq{&<>"});  # "&" needs to be first.
    

    I recommend against this.

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

Sidebar

Related Questions

I wrote a small script which copies the billing address to the delivery address
I'm trying to write a small script which parses and executes Brainfuck code, to
I just started playing with Clojure, and I wrote a small script to help
We wrote a small Windows class library that implements extension methods for some standard
I wrote some small apps using .NET 3.5 but now I am stuck with
Some thing ago, I write small script using Text::DeDupe to remove duplicates of blog
I have a small script we're using to read in a CSV file containing
I have written this short script (which I've stripped away some minor detail for
I wrote a small script. It's designed to search the python directory for all
I've written a small python script to create a file and calculate times. I've

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.