Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery XML Parser Format help
    primarykey
    data
    text
    <p>I am in need of a technical expertise inorder to format XML and render in below html format. i have been using JQuery XML parser and i need help in constructing the html portion alone.</p> <p>Data.xml</p> <pre><code>&lt;xml&gt; &lt;rs:data&gt; &lt;z:row Category="Sales " URLMenu="http://www.abc.com, Sales.com" /&gt; &lt;z:row Category="Products" URLMenu="http://www.google.com, Products.com" /&gt; &lt;z:row Category="Sales "URLMenu="http://www.abc.com/services, Services.com" /&gt; &lt;z:row Category="Products" URLMenu="http://www.citigroup.net, Financial.com" /&gt; &lt;z:row Category="Products" SubCategory="International" URLMenu="http://www.google.com, United States" /&gt; &lt;z:row Category="Products" SubCategory="International" URLMenu="http://www.googe.com, Australia" /&gt; &lt;/rs:data&gt;&lt;/xml&gt; </code></pre> <p>JQuery function</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { var thisHtml = ''; var url = 'xml/Data.xml'; $.get(url, function (d) { $(d).find('z\\:row').each(function () { thisHtml += '&lt;ul&gt;'; { thisHtml += '&lt;li&gt;&lt;a href=""&gt;' + $(this).attr("Category") + '&lt;/a&gt;&lt;/li&gt;'; } thisHtml += '&lt;/ul&gt;'; }); $('bd').append($(thisHtml)); }); }); &lt;/script&gt; </code></pre> <p>Below is the HTML Snippet that needs to be dynamically created</p> <pre><code>&lt;ul&gt; &lt;li&gt;Sales &lt;ul&gt; &lt;li&gt;&lt;a&gt;Sales.com&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;Products.com&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Products &lt;ul&gt; &lt;li&gt;&lt;a&gt;Services.com&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;Financial.com&lt;/a&gt;&lt;/li&gt; &lt;li&gt;International &lt;ul&gt; &lt;li&gt;&lt;a&gt;United States&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;Australia&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre> <p></p> <p>The required html groups all categories under same name and URLMenu listed as separate. Since i am new to JQuery could you please help me in looping and rendering?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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