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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:56:53+00:00 2026-06-05T05:56:53+00:00

I am not quite sure, and haven’t been able to find anything. Using stringByEvaluatingJavascriptFromString:,

  • 0

I am not quite sure, and haven’t been able to find anything.

Using stringByEvaluatingJavascriptFromString:, I have been able to manipulate javascript in my page from objective-c. However, I now want to populate form fields by passing raw xml data from the iOS UIWebView into the html file (which is local to the app), and then using the parsed data.

Looking over the W3C document, it seems I need to do something like:

parser = new DOMParser();
xmlString = parser.parseFromString(txt, "text/xml");

Which should return a DOM object from the XML (which here is represented by the string txt). I should then be able to access the properties of this DOM object from

xmlString.getElementsByTagName("from")[0].childNodes[0].nodeValue;

Assuming we have an XML node such as:

<from>Sender</from>

However, this doesn’t seem to work. Setting that nodeValue into a string and returning it returns nil. Likewise, form fields are not populated.

My question, then, is whether the embedded browser in an app can utilize the DOM Parser – and if it can, what syntax I might use to access values from it?

  • 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-05T05:56:55+00:00Added an answer on June 5, 2026 at 5:56 am

    Solved, unfortunately very fast. It seems that when setting form fields you need to specify VALUE instead of innerhtml.

    so I did:

    document.getElementById("FIELDID").value = 
                xmlString.getElementsByTagName("from")[0].childNodes[0].nodeValue;
    

    Also, I had the parameters passed to the DOM parser wrong – it is “text/xml” for the second parameter.

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

Sidebar

Related Questions

Quite a simple question, but I haven't been able to find any useful resources
i have been looking around and haven't quite found anything on doing this and
I'm not quite sure how to do this. Let's say I have 2 associative
Ok, a few things I'm not quite sure about. For starters: I have a
I haven't done any xml projects, so I'm not quite sure what to do
This is my first question that I haven't been able to find an answer
I have been quite successfully using CMake to perform builds using the ExternalProject_Add function,
I couldn't quite find something like this, hence the question. I have a page\blarg
Not quite sure how to explain it, so showing some codes will definitely help
Not quite sure how to word this question. I am wondering if there is

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.