-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
219 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin$1.class
Binary file not shown.
Binary file modified
BIN
+1.08 KB
(110%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin$2.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin$3.class
Binary file not shown.
Binary file added
BIN
+630 Bytes
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin$fhrsAuthority.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin$oldAndNewValues.class
Binary file not shown.
Binary file modified
BIN
+4.29 KB
(140%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/FHRSPlugin.class
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+175 Bytes
(110%)
...gin/build/org/openstreetmap/josm/plugins/fhrs/mergeTagsDialog$CustomTableCellEditor.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/mergeTagsDialog$osmTagsTableModel.class
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
fhrsPlugin/build/org/openstreetmap/josm/plugins/fhrs/mergeTagsDialog.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"java.project.referencedLibraries": [ | ||
"lib/**/*.jar", | ||
"d:\\_dev\\osm\\josm\\josm\\core\\dist\\josm-custom.jar", | ||
"d:\\_dev\\osm\\josm\\josm\\plugins\\fhrs\\lib\\gson-2.8.6.jar" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
fhrsPlugin/src/org/openstreetmap/josm/plugins/fhrs/XmlHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.openstreetmap.josm.plugins.fhrs; | ||
|
||
import java.io.StringReader; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import javax.xml.parsers.DocumentBuilder; | ||
import javax.xml.parsers.DocumentBuilderFactory; | ||
import javax.xml.xpath.XPath; | ||
import javax.xml.xpath.XPathConstants; | ||
import javax.xml.xpath.XPathExpression; | ||
import javax.xml.xpath.XPathExpressionException; | ||
import javax.xml.xpath.XPathFactory; | ||
|
||
import org.w3c.dom.Document; | ||
import org.w3c.dom.NodeList; | ||
import org.xml.sax.InputSource; | ||
|
||
public class XmlHelper { | ||
public static List<String> evaluateXPath(Document document, String xpathExpression) throws Exception | ||
{ | ||
XPathFactory xpathFactory = XPathFactory.newInstance(); | ||
XPath xpath = xpathFactory.newXPath(); | ||
List<String> values = new ArrayList<>(); | ||
try | ||
{ | ||
XPathExpression expr = xpath.compile(xpathExpression); | ||
NodeList nodes = (NodeList) expr.evaluate(document, XPathConstants.NODESET); | ||
for (int i = 0; i < nodes.getLength(); i++) { | ||
values.add(nodes.item(i).getNodeValue()); | ||
} | ||
} catch (XPathExpressionException e) { | ||
e.printStackTrace(); | ||
} | ||
return values; | ||
} | ||
|
||
public static Document convertStringToXMLDocument(String xmlString) | ||
{ | ||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); | ||
DocumentBuilder builder = null; | ||
try | ||
{ | ||
builder = factory.newDocumentBuilder(); | ||
Document doc = builder.parse(new InputSource(new StringReader(xmlString))); | ||
return doc; | ||
} | ||
catch (Exception e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters