How to emulate XSLT using JQuery from HTML source



I have the following XSLT which takes an XML file and generate some links based on occurrences.


XSLT:



<div class="justPad">
<a class="defaultLinks">
<xsl:attribute name="href">
<xsl:value-of select="QuickLink" />
</xsl:attribute>
<xsl:value-of select="Title" />
</a>
</div>


HTML source:



<span class="specLink">
<specialty><a title="Plastic Surgery" href="link2.aspx">Plastic Surgery</a></specialty>
</span>
<br />
<span class="specLink">
<specialty2><a title="Hand Surgery" href="link3.aspx">Hand Surgery</a></specialty2>
</span>


Displays:


enter image description here


How can I create a JQuery script which runs during page load to displays the same list taking from the HTML Source instead of generating using XSLT (For each specialty# get the link and add it inside the justPad div)?


E.g.:



<div class="justPad">
<a title="Plastic Surgery" href="link2.aspx" class="defaultLinks">Plastic Surgery</a>
</div>
<div class="justPad">
<a title="Hand Surgery" href="link3.aspx" class="defaultLinks">Hand Surgery</a>
</div>

No comments:

Post a Comment