mastodon.cardina1.red は、数々の独立したMastodonサーバーのうちのひとつです。サーバーに登録してFediverseのコミュニティに加わってみませんか。

サーバーの情報

3
人のアクティブユーザー

らりお・ザ・何らかの🈗然㊌ソムリエ

XML の有識者に聞きたいんですが、
w3.org/TR/REC-xml/#NT-CharData
[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
が [2] Char で定義されていない (Char ではない制御文字等も使えるかのように読める) のは意図してのもの? それとも [^<&] は単に Char - ('<' | '&') として解釈するべき?

www.w3.orgExtensible Markup Language (XML) 1.0 (Fifth Edition)

nya.lemonade.moe/@lemon/102802

[2] Char の制約が要求されるのは tag とか comment とか PI とか CDATA section みたいな特殊な文脈内であって、そういう特殊な文脈以外で出現するプレーンなテキストはもっと制約がユルいという解釈でいけそう

nya.lemonade.moe小柠檬 (@lemon@nya.lemonade.moe)小柠檬

@lo48576

I only found the reference of [14]CharData at [43]content.

And [2]Char occurs at markup elements.

I think those disallowed characters like the surrogate blocks in [2]Char are allowed in [14]CharData.

@lemon
So [2]Char is used in some special contexts (inside PI, tag, comment, CDATA section...), and naked texts are not so restricted...
Makes sense. Thank you 🙏

@lemon Finally I got the correct answer: non-`Char` characters are prohibited at any place in an XML document (even if they are escaped).

github.com/sparklemotion/nokog

EBNF itself used in the spec requires matched characters to also match `Char`, so any production rules implicitly uses only `Char` characters.
(BTW it seems `Char` is defined recursively lol)

github.comXML parsing fails at vertical tab characters in attributes · Issue #1581 · sparklemotion/nokogiriNokogiri has difficulties if the XML input contains vertical tab characters (&quot;\v&quot;) within attribute values. It appears to abort element parsing and treat all following text, up to the nex...