0

I have a xml response in which the node is imx:IMX, when I use jquery to get some attribs of this tag i get the below error

Syntax error, unrecognized expression: IMX
[Break On This Error] throw new Error( "Syntax error, unrecognized expression: " + msg );  in jquery_v1.7.1.js (line 4179)

My XML

<client>
    <product>
        <nodemetadata>
            <imx:IMX xmlns:imx="http://com.abc.imx" >
                <domainservice:GatewayNodeConfig imx:id="U:pgwr9B9HEeGgJbC99YpLSQ" consolePort="21963" consoleShutdownPort="21613" domainName="D_1158162131" nodeName="N_1158162131" dbConnectivity="ID_1">
                    <address imx:id="ID_2" xsi:type="common:NodeAddress" host="panther" httpPort="21961" port="21962"/>
                    <portals>
                    <NodeRef imx:id="ID_3" xsi:type="common:NodeRef" address="ID_2" nodeName="N_1158162131"/>
                    </portals>
                </domainservice:GatewayNodeConfig>
                <domainservice:DBConnectivity imx:id="ID_1" dbEncryptedPassword="AfaFnEtrQMxkOEWRSFCQAQ%3D%3D" dbHost="fortnox" dbName="ORCL" dbPort="1521" dbType="ORACLE" dbUsername="mangla"/>
            </imx:IMX>
        </nodemetadata>
    </product>
</client>

My code

$(xml).find('product').each(function(){ 
    $(this).children('nodemetadata').each(function(){ 
        $(this).children('imx:IMX').each(function(){ 
            $(this).children('domainservice:GatewayNodeConfig').each(function(){ 
                alert($(this).attr('domainName'));
            });
        });
    });
});
AabinGunz
  • 12,109
  • 54
  • 146
  • 218
  • 1
    possible duplicate of [jQuery XML parsing with namespaces](http://stackoverflow.com/questions/853740/jquery-xml-parsing-with-namespaces) – Felix Kling Dec 08 '11 at 11:07

1 Answers1

0

As Felix Kling has already pointed.. use \\ as your escaping character

eg:

$(this).children('imx\\:IMX').each(function(){