Bear with me, I'm new to manipulating XML using jQuery.
Say I have an XML document that looks something like this:
<sitemap>
<products name="products" url="/products.html">
<shirts name="women's shirts" url="/womens-shirts.html">
<shoes name="women's shoe" url="/womens-shoes.html">
<pants....>
</products>
<services>
<shopping>
<consultation>
</services>
</sitemap>
etc., where each child node of has both a name and a URL (I'm populating a breadcrumb based on window.location.pathname). I want to search for a specific URL (it should match whatever page you're on), which can be in any node, either parent or child. How do I do this without specif开发者_运维百科ying the node I am searching under?
Thanks!
To specify any element name, use an asterisk:
*[url='/products.html']
精彩评论