0

I want to read xml file using java script, the xml contains below code.

<?xml version="1.0" encoding="UTF-8"?><?mso-infoPathSolution solutionVersion="1.0.0.386" productVersion="12.0.0" PIVersion="1.0.0.0" href="http://sites/Software_Release/DatastageReleaseRequests/Datastage%20Release%20Requests/Forms/template.xsn" name="urn:schemas-microsoft-com:office:infopath:Datastage-Release-Requests:-myXSD-2011-07-18T09-53-25" ?><?mso-application progid="InfoPath.Document"?><?mso-infoPath-file-attachment-present?><my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:s0="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-07-18T09:53:25" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-gb">
    <my:Project_Details>
        <my:Project_Title>Warranty </my:Project_Title>
        <my:Project_Code>xxxxx</my:Project_Code>

    </my:Project_Details>
    <my:Change_Details>
        <my:StartDateTime>2014-09-02T16:00:00</my:StartDateTime>
        <my:EndDateTime>2014-09-03T18:00:00</my:EndDateTime>
        <my:Change_Number>0000000</my:Change_Number>
        <my:TaskNumber></my:TaskNumber>
        <my:DryRunDate xsi:nil="true"></my:DryRunDate>
        <my:FirstLiveRunDate>2014-09-02</my:FirstLiveRunDate>
        <my:WarrantyEndDate>2014-09-03</my:WarrantyEndDate>
        <my:field8></my:field8>
    </my:Change_Details>
    <my:Release_Details>
        <my:HostGroup>
            <my:HostsTable>
                <my:Domain_and_Host>hostname</my:Domain_and_Host>
                <my:Project></my:Project>
            </my:HostsTable>
        </my:HostGroup>
        <my:DeployStartDateTime>2014-09-02T16:30:00</my:DeployStartDateTime>
    </my:Release_Details>
    <my:Header>
        <my:RequestID>sd2914</my:RequestID>
        <my:RequestNumber>2914</my:RequestNumber>
        <my:RequestHeader>sd</my:RequestHeader>
    </my:Header>
    <my:Release_Section>

I want to retrieve values of my:Project_Title, my:Project_Code, my:Change_Number and my:Domain_and_Host. I am very new to scripting, please help.

Thanks

7
  • I want to use javascript to read from the xml file and provide the output as I mentioned in the question, as I said I am beginner to scripting it would be very helpful if I get a script for the above question. Commented Nov 30, 2015 at 12:03
  • Are you using a browser? Did you read the question I linked? Commented Nov 30, 2015 at 12:05
  • I went through the link you have given, but I am reading a file which is stored in windows directory. Commented Nov 30, 2015 at 13:18
  • I am looking something like var file = filenanme.xml then the script will read file and provide the output. Commented Nov 30, 2015 at 13:21
  • Try that in combination with this question: stackoverflow.com/questions/14446447/… Commented Nov 30, 2015 at 13:47

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.