diff options
author | harald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-01-10 15:17:22 +0000 |
---|---|---|
committer | harald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-01-10 15:17:22 +0000 |
commit | aec4ccc911516648497d5edcdfdebc228dd0b025 (patch) | |
tree | d74568d20019d9007cc1adfd6afef3eed7ba54a8 /common/src/at/gv | |
parent | 71fc9643626231aaa0478ed2483e24c5f5738f68 (diff) | |
download | moa-id-spss-aec4ccc911516648497d5edcdfdebc228dd0b025.tar.gz moa-id-spss-aec4ccc911516648497d5edcdfdebc228dd0b025.tar.bz2 moa-id-spss-aec4ccc911516648497d5edcdfdebc228dd0b025.zip |
Moved method removeXMLDeclaration (multiple occurrences) to StringUtils.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@761 d688527b-c9ab-4aba-bd8d-4036d912da1d
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; + } + } + } |