From bae8d55bf22e2581c09be72548cadf7ddc8f1838 Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Thu, 23 Feb 2023 12:13:45 +0100 Subject: [PATCH] - minor improvements --- .../dps/repository/plugin/SLUBXmlFormatValidationPlugin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/org/slub/rosetta/dps/repository/plugin/SLUBXmlFormatValidationPlugin.java b/java/org/slub/rosetta/dps/repository/plugin/SLUBXmlFormatValidationPlugin.java index d6bf65e..bcf7805 100644 --- a/java/org/slub/rosetta/dps/repository/plugin/SLUBXmlFormatValidationPlugin.java +++ b/java/org/slub/rosetta/dps/repository/plugin/SLUBXmlFormatValidationPlugin.java @@ -67,7 +67,8 @@ public class SLUBXmlFormatValidationPlugin implements FormatValidationPlugin { Document doc = db.parse(new File(namespaceSchemaMapFile)); Element de = doc.getDocumentElement(); NodeList nodes = de.getElementsByTagName("entry"); - for (int i = 0; i < nodes.getLength(); i++) { + var nodesize = nodes.getLength(); + for (int i = 0; i < nodesize; i++) { Node n = nodes.item(i); NamedNodeMap attributes = n.getAttributes(); List<String> attr_strings = List.of(new String[]{"schematype", "namespace", "schemaurl"}); @@ -279,7 +280,7 @@ public class SLUBXmlFormatValidationPlugin implements FormatValidationPlugin { return result; } - private boolean checkIfWellformed(Document doc) throws ParserConfigurationException, IOException, SAXException { + private boolean checkIfWellformed(Document doc) { /* detect XML type via NS */ boolean isWellformedXml = false; XmlInfoRecord info = getXMLinfo(doc); -- GitLab