From: SourceForge.net <no...@so...> - 2012-06-19 15:21:44
|
Bugs item #3536354, was opened at 2012-06-19 08:21 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=3536354&group_id=23187 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Java 1.3 Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: xpath fails by default ns Initial Comment: If you have a default ns in XML like: <Schema Namespace="RefScenario" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"> then the XPath expression "/Schema" fails with element not found. XPathEngine is configured as shown in code below: private void initializeXmlUnit() { HashMap<String, String> m = new HashMap<String, String>(); m.put("m", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"); m.put("d", "http://schemas.microsoft.com/ado/2007/08/dataservices"); m.put("edmx", "http://schemas.microsoft.com/ado/2007/06/edmx"); m.put("", "http://schemas.microsoft.com/ado/2008/09/edm"); NamespaceContext ctx = new SimpleNamespaceContext(m); XMLUnit.setXpathNamespaceContext(ctx); XpathEngine engine = XMLUnit.newXpathEngine(); engine.setNamespaceContext(ctx); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=377768&aid=3536354&group_id=23187 |