commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Singh, Rupinder" <Rupinder.Si...@softwareag.com>
Subject [jxpath] Syntax with @name
Date Fri, 15 Feb 2013 17:51:07 GMT
I have a jxpath expression question. 

 

Map m = new HashMap();

    Map[] dd = new HashMap[2];

    dd[0] = new HashMap();

    dd[0].put("tag", "10");

    dd[0].put("score", "100");

    dd[1] = new HashMap();

    dd[1].put("tag", "11");

    dd[1].put("score", "90");

    Map ddk = new HashMap();

    ddk.put("dataDescription", dd);

    m.put("Values", ddk);

    

    JXPathContext xpathContext = IDataJXPathContext.newContext(m);

    Object works  =
xpathContext.getValue("//dataDescription[tag='10']");   //This returns
the correct data as expected

    Object doesntWork  =
xpathContext.getValue("//.[@name='dataDescription'][tag='10']"); // This
does not bring up anything

 

 

I have to use @name as the actual names have special characters in them.
Can anybody help with what the correct syntax for this should be ?

 

Thanks

 

Rupinder

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message