# HG changeset patch # User Bjoern Ricks # Date 1345728462 0 # Node ID 3a8884e06aaa44c377f3192c2081bd82f466f10f # Parent 0de0ef04bcdc38d65be21135315d9d4254a32858 Avoid using XPath queries for getting attributes of a node flys-client/trunk@5241 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0de0ef04bcdc -r 3a8884e06aaa flys-client/ChangeLog --- a/flys-client/ChangeLog Wed Aug 22 12:29:33 2012 +0000 +++ b/flys-client/ChangeLog Thu Aug 23 13:27:42 2012 +0000 @@ -1,3 +1,8 @@ +2012-08-23 Björn Ricks + + * src/main/java/de/intevation/flys/client/server/UserServiceImpl.java: + Avoid using XPath queries for getting attributes of a node. + 2012-08-22 Christian Lins * src/main/java/de/intevation/flys/client/client/FLYS.java, diff -r 0de0ef04bcdc -r 3a8884e06aaa flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java Wed Aug 22 12:29:33 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/UserServiceImpl.java Thu Aug 23 13:27:42 2012 +0000 @@ -3,7 +3,7 @@ import javax.xml.xpath.XPathConstants; import org.w3c.dom.Document; -import org.w3c.dom.Node; +import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.apache.log4j.Logger; @@ -54,12 +54,12 @@ ArtifactNamespaceContext.INSTANCE); if (theUsers != null && theUsers.getLength() > 0) { - Node user = theUsers.item(0); + Element user = (Element)theUsers.item(0); - String uuid = XMLUtils.xpathString( - user, "@art:uuid", ArtifactNamespaceContext.INSTANCE); - String name = XMLUtils.xpathString( - user, "@art:name", ArtifactNamespaceContext.INSTANCE); + String uuid = user.getAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, "uuid"); + String name = user.getAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, "name"); return new DefaultUser(uuid, name); }