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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:20+00:00 2026-05-27T17:23:20+00:00

Although I know that I can use &quote , I was wondering if there

  • 0

Although I know that I can use &quote, I was wondering if there was a less blunt and long way, such as \", or the like.
Here is an example of the XML:

<root name="test" type="Node" action="{puts :ROOT.to_s}">
    <leaf type="Node" decider="{print :VAL1.to_s; gets.chomp.to_i}" action="{puts :ONE.to_s}" />
    <leaf type="Node" decider="{print :VAL2.to_s; gets.chomp.to_i}" action="{puts :TWO.to_s}" />
    <branch type="Node" decider="{100}" action="{}">
        <leaf type="LikelihoodNode" decider="{100}" action="{puts :HI.to_s}" arg="0"/>
    </branch>
</root>

The attributes that need this are decider and action. Right now the embedded code is using a little :sym.to_s hack, but that is not a solution.

NOTE: Although the action attribute is only a block in brackets, the processing code pre-pends the lambda.

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

    A double quote inside an XML attribute is written as &quote; (or &#34; or &#x22;). You’ll have similar issues with single quotes too so you can’t use those. However, you can use % as-is in an XML attribute so %|...|, %Q|...|, and %q|...| are available and they’re as easy to read and type as quotes:

    <root name="test" type="Node" action="{puts %|ROOT|}">
        <leaf type="Node" decider="{print %|VAL1|; gets.chomp.to_i}" action="{puts %|ONE|}" />
        <!-- ... -->
    </root>
    

    Choose whichever delimiters you find the easiest to type and read.

    You can also use single quotes for your attributes in XML so you can have:

    <leaf type='Node' decider='{print "VAL1"; gets.chomp.to_i}' ...
    

    But then you’d have to use &apos; inside the attribute if you needed to include a single quote.

    Alternatively, you could switch to elements instead of attributes:

    <leaf type="Node">
        <decider><![CDATA[
            print "VAL1"
            gets.chomp.to_i
        ]]></decider>
        <action><![CDATA[
            puts "ONE"
        ]]></decider>
    </leaf>
    

    but that’s a bit verbose, ugly, and not as easy to work with as attributes (IMHO).

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

Sidebar

Related Questions

I know that there are a few questions like this on SOF, but I
Ok so I know that you can't have an abstract static method, although I
Although there are a lot of posts about .net config files, I believe that
I'm working on a little html/css framework that I can use for most of
One can easily define a function that accepts a 1d array argument like this:
How can I use a regular expression to match text that is between two
Although I know the basic concepts of binary representation, I have never really written
The following query hangs: (although subqueries perfomed separately are fine) I don't know how
Although obviously not all scenarios can be covered by a single design, is it
Although this is FAQ i still couldn't find a suitable solution. I'd like to

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.