Got more questions? Find advice on: ASP | SQL | XML | Windows
Welcome to RegexAdvice Sign in | Join | Help

Splitting concatenated XML Strings

  •  02-20-2007, 4:27 AM

    Splitting concatenated XML Strings

    Hi, Iam looking for a good expression to separate multiple XML Strings that are combined into a single string like this:

    <?xml version="1.0" encoding="UTF-8"?><ICMessage IC_DATE="20070216" IC_TA_TYPE="910" IC_TIME="154708"/><?xml version="1.0" encoding="UTF-8"?><ICMessage IC_DATE="20070216" IC_TA_TYPE="910" IC_TIME="154708"/><?xml version="1.0" encoding="UTF-8"?><ICMessage IC_DATE="20070216" IC_PROCESSING_CODE="1" IC_TA_TYPE="910" IC_TIME="154708"/><?xml version="1.0" encoding="UTF-8"?><ICMessage IC_AUTHORIZATION="0" IC_TERMINAL_ID=" 91236123" IC_TIME="154708" IC_TRACENR="127"/>

    The applications uses Java on Windows and Unix machines. Currently I'am using this expression: \<\?[^/]*\/> but it will fail as soon as there is a slash within any of the XML attributes. What I need is a better expression to split the XML Strings to:

    <?xml version="1.0" encoding="UTF-8"?><ICMessage IC_DATE="20070216" IC_TA_TYPE="910" IC_TIME="154708"/>

    <?xml version="1.0" encoding="UTF-8"?><ICMessage IC_DATE="20070216" IC_TA_TYPE="910" IC_TIME="154708"/>

    and so on.. Thanks 

    and so on.. Thanks 

     

    Filed under:
View Complete Thread