JQuery Selector in XML

Zen

New Member
I am attempting to get a set of elements from an XSD document. I have downloaded and I am using the latest version of jQuery (1.7.2). The xsd referenced is a local copy of http://www.w3.org/2001/XMLSchema.xsd the code I am using is as follows:\[code\]var xml;$(function(){ $.ajax({ type:"GET", url:"http://www.w3.org/2001/XMLSchema.xsd",//"xml/XMLSchema.xsd", dataType: 'xml', success:function(result){ xml = $(result); } });});\[/code\]This enables me to load the xsd into the "xml" variable as expected however when I go to query it I end up with some confusing results. Using:\[code\]$('complexType[name=simpleType]', xml).attr("name")$('complexType[name="simpleType"]', xml).attr("name")\[/code\]return "undefined" however the starts with, ends with and start and ends with return the correct result:\[code\]$('complexType[name^="simpleType"]', xml).attr("name")$('complexType[name$="simpleType"]', xml).attr("name")$('complexType[name$="simpleType"][name^="simpleType"]', xml).attr("name")\[/code\]Which is the name "simpleType". Is there a reason why the ='s does not work?Thanks in advance
 
Back
Top