aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/test/xmerl_sax_SUITE.erl
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2017-01-12 16:49:40 +0100
committerLars Thorsen <[email protected]>2017-02-22 10:00:18 +0100
commit00294041cd3c6f66598a50b57abf27e6a35e277f (patch)
treea479e0f3668179943324df40a1f012faec8fd07e /lib/xmerl/test/xmerl_sax_SUITE.erl
parent4f56fb3e9120e92ff7b0700402707ad032114311 (diff)
downloadotp-00294041cd3c6f66598a50b57abf27e6a35e277f.tar.gz
otp-00294041cd3c6f66598a50b57abf27e6a35e277f.tar.bz2
otp-00294041cd3c6f66598a50b57abf27e6a35e277f.zip
[xmerl] Correct bug handling multiple documents on a stream
Change how to interpret end of document to comply with Tim Brays comment on the standard. This makes it possible to handle more than one doc on a stream, the standard makes it impossible to know when the document is ended without waiting for the next document (and not always even that). Tim Brays comment about the trailing "Misc" rule: The fact that you're allowed some trailing junk after the root element, I decided (but unfortunately too late) is a real design error in XML. If I'm writing a network client, I'm probably going to close the link as soon as a I see the root element end-tag, and not depend on the other end closing it down properly. Furthermore, if I want to send a succession of XML documents over a network link, if I find a processing instruction after a root element, is it a trailer on the previous document, or part of the prolog of the next?
Diffstat (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl')
-rw-r--r--lib/xmerl/test/xmerl_sax_SUITE.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl
index f5c0a783c4..7d1a70905c 100644
--- a/lib/xmerl/test/xmerl_sax_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_SUITE.erl
@@ -85,17 +85,17 @@ ticket_11551(_Config) ->
<a>hej</a>
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<a>hej</a>">>,
- {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream1, []),
+ {ok, undefined, <<"\n<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream1, []),
Stream2= <<"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<a>hej</a>
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<a>hej</a>">>,
- {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream2, []),
+ {ok, undefined, <<"\n\n\n<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream2, []),
Stream3= <<"<a>hej</a>
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<a>hej</a>">>,
- {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream3, []),
+ {ok, undefined, <<"\n\n<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream3, []),
ok.