var xmlFrag = document.getElementById(“12345”);In the code sample above I'm searching xml with namespaces. My namespace prefix is f. I know the Id of the root node from an event (code not shown). I'm using plain old javascript getElementById to quickly grab that dom node and create a fragment. Then passing just that fragment of xml into jQuery for further processing.
$(“f\\:user > f\\:name”,xmlFrag);
<f:user xmlns:f="user.xsd"><f:name></f:name></f:user>
No comments:
Post a Comment