From 45be217e696d6ce9fd5f1bfd5b4c9ed98d31fc72 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sat, 23 Jul 2022 23:55:50 +0500 Subject: [PATCH] ns: Add a note about rules for closing tags Co-authored-by: Daniel Alley --- src/reader/mod.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/reader/mod.rs b/src/reader/mod.rs index 8ad6df61..0ad1d90a 100644 --- a/src/reader/mod.rs +++ b/src/reader/mod.rs @@ -65,7 +65,7 @@ macro_rules! configure_methods { /// If true the emitted [`End`] event is stripped of trailing whitespace after the markup name. /// /// Note that if set to `false` and `check_end_names` is true the comparison of markup names is - /// going to fail erronously if a closing tag contains trailing whitespaces. + /// going to fail erroneously if a closing tag contains trailing whitespaces. /// /// (`true` by default) /// @@ -77,6 +77,19 @@ macro_rules! configure_methods { /// Changes whether mismatched closing tag names should be detected. /// + /// Note, that start and end tags [should match literally][spec], they cannot + /// have different prefixes even if both prefixes resolve to the same namespace. + /// The XML + /// + /// ```xml + /// + /// + /// ``` + /// + /// is not valid, even though semantically the start tag is the same as the + /// end tag. The reason is that namespaces are an extension of the original + /// XML specification (without namespaces) and it should be backward-compatible. + /// /// When set to `false`, it won't check if a closing tag matches the corresponding opening tag. /// For example, `` will be permitted. /// @@ -91,6 +104,7 @@ macro_rules! configure_methods { /// /// (`true` by default) /// + /// [spec]: https://www.w3.org/TR/xml11/#dt-etag /// [`End`]: Event::End pub fn check_end_names(&mut self, val: bool) -> &mut Self { self $(.$holder)? .check_end_names = val;