diff options
Diffstat (limited to 'common/src/at/gv')
-rw-r--r-- | common/src/at/gv/egovernment/moa/util/StringUtils.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/src/at/gv/egovernment/moa/util/StringUtils.java b/common/src/at/gv/egovernment/moa/util/StringUtils.java index 0ad5c515c..61b1a18ea 100644 --- a/common/src/at/gv/egovernment/moa/util/StringUtils.java +++ b/common/src/at/gv/egovernment/moa/util/StringUtils.java @@ -145,4 +145,20 @@ public class StringUtils { return retString ; } + /** + * Removes the XML declaration from an XML expression. + * + * @param xmlString XML expression as String + * + * @return XML expression, XML declaration removed + */ + public static String removeXMLDeclaration(String xmlString) { + if (xmlString.startsWith("<?xml")) { + int firstElement = xmlString.indexOf("<", 1); + return xmlString.substring(firstElement); + } else { + return xmlString; + } + } + } |