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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:13:46+00:00 2026-05-17T19:13:46+00:00

Despite the fact that XML attributs can be defined using single or double quotes,

  • 0

Despite the fact that XML attributs can be defined using single or double quotes, my user is trying to integrate my software with another one that will not accept single quoted attribut values.

I user REXML to generate my XMLs.

Is there a way to REXML generate double quoted attribute values?
If not, is there a way for me to convert it easily?

Thanks

  • 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-17T19:13:47+00:00Added an answer on May 17, 2026 at 7:13 pm

    As of Feb 2007 there’s a supported way of determining the quoting character. The changes were merged into Ruby sources on Jul 2007 and should be available on all versions since 1.8.6-p110:

    require 'rexml/document'
    
    doc = REXML::Document.new
    doc.context[:attribute_quote] = :quote  # <-- Set double-quote as the attribute value delimiter
    
    root = doc.add_element('root')
    root.add_attribute('val', '123')
    
    doc.write(STDOUT)
    

    Running that yields:

    $ ruby test.rb
    <root val="123"/>
    $
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many array methods return a single index despite the fact that the array is
I'm trying to execute a query using C#. The problem is that, despite the
Still fighting with templates. In this example, despite the fact that is copied straight
Why are there no LINQ extension methods on RepeaterItemCollection despite the fact that it
Quicksort is often described as an in situ (in-place) algorithm, despite the fact that
Okay, I've already asked 2 questions about my problem and despite the fact that
Despite the fact that this is not good coding practice, I want a macro
This article states that Despite the fact that the Mersenne Twister is an extremely
I am getting this error when my form is completed, despite the fact that
My understanding has been that, despite the fact that XSLT's node-sets are called sets,

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.