Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing XML with jQuery
    text
    copied!<p>I'm having trouble parsing this xml file using jquery:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:BOT-Memos:-myXSD-2011-07-13T14-29-57" solutionVersion="1.0.0.27" productVersion="14.0.0.0" PIVersion="1.0.0.0" href="http://sharept03sb1/BOT/BOT%20Memos/Forms/template.xsn"?&gt; &lt;?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.3"?&gt; &lt;my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2011-07-13T14:29:57" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-US"&gt; &lt;my:content&gt; &lt;my:title&gt;Hello&lt;/my:title&gt; &lt;my:description&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve"&gt;&lt;div&gt;How are you?&lt;/div&gt;&lt;/html&gt;&lt;/my:description&gt; &lt;my:memo xsi:nil="true"&gt;&lt;/my:memo&gt; &lt;my:group&gt; &lt;pc:Person xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls"&gt;&lt;pc:DisplayName&gt;Johnny Doe&lt;/pc:DisplayName&gt;&lt;pc:AccountId&gt;ADMIN\fakeadminuser&lt;/pc:AccountId&gt;&lt;pc:AccountType&gt;User&lt;/pc:AccountType&gt;&lt;/pc:Person&gt;&lt;/my:group&gt; &lt;my:meetingDate&gt;&lt;/my:meetingDate&gt; &lt;my:addAttachments&gt; &lt;my:attachments&gt; &lt;my:attachment xsi:nil="true"&gt;&lt;/my:attachment&gt; &lt;/my:attachments&gt; &lt;/my:addAttachments&gt; &lt;my:upload&gt;&lt;/my:upload&gt; &lt;/my:content&gt; &lt;/my:myFields&gt; </code></pre> <p>I'm trying to read the <code>my:title</code> node, but that I'm having no luck. This is the particular line I'm using to parse it.</p> <pre><code>$.get('target.xml', function(data){ alert($(data).find("my:memo").text()); }); </code></pre> <p>Any ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload