web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to read key in XML web resource into HTML

(0) ShareShare
ReportReport
Posted on by 2,003

I have a key, which is in XML web resource. Now i have to read that key into one of the other java script in html web resource. 

Suppose i have key like in XML webresource

<!-- Key for Partner Source URL-->
<add key="Partner site URL" value="http://www.google.com" encrypted="false"/>

Now i have a Html web resource here i need to read the XML key

<html>
<head></head>
<body onload="OpenPartnerSiteUrl()">
<script>
function OpenPartnerSiteUrl() {
//Open an url in a new window
window.open("");
}
</script>
</body>
</html>

Thanks

Abhishek

*This post is locked for comments

I have the same question (0)
  • Rajkumar Rajaraman Profile Picture
    on at

    Refer this:

    crmdm.blogspot.in/.../reading-xml-file-in-ms-dynamics-crm.html

  • Mahendar Pal Profile Picture
    45,095 on at

    Hi Abhishek,

    Did you check our post: http://himbap.com/blog/?p=853

    Thanks

  • Abhishek Gupta Profile Picture
    2,003 on at

    Hi Rajkumar,

    I have checked the URL but my both the files are in different web resource file. So XML gets an error while loading in DOM.

    Thanks

    Abhishek

  • Abhishek Gupta Profile Picture
    2,003 on at

    Hi Mahen,

    The particular XML file gives an error while loading in DOM. As it is Key base format

    <?xml version="1.0"?>

    <configuration>

     <appSettings>

     <add key="Partner site URL" value="http://www.google.com&quot; encrypted="false"/>

     </appSettings>

    </configuration>

    Thanks

    Abhishek

  • Community Member Profile Picture
    on at

    Hi Abhishek

    Why not use JSON object instead of xml file

    and you can use a simple JS Framework to parse JSON like http://underscorejs.org/

    Thinks

    Youssef

  • Verified answer
    NatrajY Profile Picture
    3,040 on at

    Assuming you want to use jQuery, you can have a look at how this can be done here -> https://jsfiddle.net/yvfL5rbm/2/

    If you are going to have multiple add nodes, you also have to add a root element. Otherwise it would be invalid xml.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans