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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:56:48+00:00 2026-06-01T04:56:48+00:00

Take an xml like this: <?xml version=1.0?> <events> <event> <start></start> <duration></duration> <begin>{somecallback}</begin> <complete>{someclass.someproperty =

  • 0

Take an xml like this:

<?xml version="1.0"?>
<events>
    <event>
        <start></start>
        <duration></duration>
        <begin>{somecallback}</begin>
        <complete>{someclass.someproperty = somevalue;}</complete>
    </event>
</events>
  • I need to be able to parse the xml and execute the string versions of javascript code. I know javascript has an eval function, but I need to know if eval can act on the above begin and complete or if there is an easier way to do this.

Both begin and complete need to either directly access a callback (without parameters), or directly set a value to a property belonging to a class. I’m sure I can eval() a callback, but I am unsure how to proceed with directly setting property values in this manner.

  • 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-01T04:56:49+00:00Added an answer on June 1, 2026 at 4:56 am

    eval will operate on objects that are in scope as expected:

    js> var o = {}
    js> eval('o.p = 1')
    1
    js> o.p
    1
    

    What you should consider is if you need the flexibility of eval for what you are doing. Can somecallback be a property of an object? If so, you can call o[fn]() where fn is “somecallback,” for instance. This is much safer than using eval. Your <complete> section is too vague for me to recommend a way to avoid eval in the second case however.

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

Sidebar

Related Questions

Take a simple XML file formatted like this: <Lists> <List> <Note/> ... <Note/> </List>
I have code like this: // Take the xml message and turn it into
Here is my ultimate goal... to take this xml file.. <?xml version=1.0?> <Songs> <Song>
sed 's/^\(\h*\)\(.*\)$/\1<!-- \2 -->/' web.xml I think that this should take this xml: <a>
take this linq into consideration: list.Where(sil => sil.XML.Element(ticket) != null && sil.XML.Element(ticket).Attribute(id).Value == smsRequestIn.TicketID)
Suppose my Tomcat webapps directory looks like this: webapps/ webapps/fooapp/ webapps/fooapp/WEB-INF/ webapps/fooapp/WEB-INF/web.xml webapps/fooapp/bardir/ When
This is my XML document <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:v="urn:schemas-microsoft-com:vml"> <w:body> <w:p>
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag
I have an xml file like: <?xml version=1.0 encoding=UTF-8 standalone=yes?> <legends> <legend> <number>1</number> <legendString><ul><li>1.across:a
I want to take an XML file and replace an element's value. For example

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.