diff -r b42bfc9e9983 -r 75ee588d5d9e src/main/java/de/unixwork/uwproj/Util.java --- a/src/main/java/de/unixwork/uwproj/Util.java Wed Sep 06 22:55:42 2023 +0200 +++ b/src/main/java/de/unixwork/uwproj/Util.java Sun Sep 10 12:52:10 2023 +0200 @@ -16,7 +16,8 @@ for (int i = 0; i < nodes.getLength(); i++) { var node = nodes.item(i); if (node.getNodeType() == Node.TEXT_NODE) { - return node.getTextContent(); + final var v = node.getNodeValue(); + return v == null ? "" : v; } } return ""; @@ -29,4 +30,18 @@ public static boolean isNotNullOrBlank(String s) { return s != null && !s.isBlank(); } + + /** + * Creates an identifier from the given string that can be used as an identifier in a POSIX shell script. + *

+ * If the given string does not contain any character that is illegal in a POSIX shell variable or function name, + * the string is returned unmodified. + * + * @param s the input string + * @return the sanitized string + */ + public static String shId(String s) { + // TODO: implement + return s; + } }