From 33e15e0a9ad2724de5f43db178f2f181ddef26ad Mon Sep 17 00:00:00 2001 From: cvanlith Date: Wed, 9 Nov 2016 17:56:10 +0100 Subject: [PATCH] code verbeterd zodat vervanging van de prefix ook plaatsvindt als xsd-schema de default namespace is --- .../nl/b3p/ogc/utils/WFSDescribeFeatureTypeResponse.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/nl/b3p/ogc/utils/WFSDescribeFeatureTypeResponse.java b/src/main/java/nl/b3p/ogc/utils/WFSDescribeFeatureTypeResponse.java index 85dbe1169..c2035bd7b 100644 --- a/src/main/java/nl/b3p/ogc/utils/WFSDescribeFeatureTypeResponse.java +++ b/src/main/java/nl/b3p/ogc/utils/WFSDescribeFeatureTypeResponse.java @@ -73,16 +73,12 @@ public String getResponseBody(List layers, OGCRequest ogcrequest private void rebuildNodeWithNameReplace(Node currentNode, String spAbbr) throws Exception { String prefix = getNameSpacePrefix("http://www.w3.org/2001/XMLSchema", true); - String elementLabel = ""; String parentPath = "/"; if (prefix != null && prefix.length() > 0) { parentPath += prefix; - elementLabel += prefix; parentPath += ":"; - elementLabel += ":"; } parentPath += "schema"; - elementLabel += "element"; Node parentNode = null; NodeList parentNodes = getNodeListFromXPath(currentNode, parentPath); @@ -91,8 +87,8 @@ private void rebuildNodeWithNameReplace(Node currentNode, String spAbbr) throws NodeList nodes = parentNode.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node n = nodes.item(i); - String nodeName = n.getNodeName(); - if (nodeName==null || !nodeName.equals(elementLabel)) { + if (!"element".equals(n.getLocalName()) + || !"http://www.w3.org/2001/XMLSchema".equals(n.getNamespaceURI())) { continue; } NamedNodeMap nnm = n.getAttributes();