Re: XmlTextWriter Encodes HTML Entities?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I kept following links and finally found the arcane documentation: an
XmlWriterSettings.CheckCharacters Property [1]. So it seems to me ASP.NET
developers don't have to fool around with Regular Expressions to validate
and replace text characters that would be illegal when the document is saved
as XML, i.e. RSS feeds for example.

I understand what W3C documents say but XML and HTML derive from SGML and
there are some semantic ambiguities in this context in the W3C documents.
Most of us and most documentation including W3C documentation define &
as an HTML character entity. When we get to the W3C page(s) for XML they
drop the verbiage "HTML" when describing character entities.

As I'm sure you'll have to agree reading the EBNF, the DTDs indicate we're
talking about the same thing using context specific nomenclature.
So we really don't need to quibble about semantics. All I want to do is
write code that will generate valid XML RSS feeds that will be parsed by the
greatest number of aggregators which in itself requires a personal
relationship with all the blessings of Heaven because everybody has been so
FUBAR in their respective implementations.

<%= Clinton Gallagher

[1]
http://msdn2.microsoft.com/en-us/library/system.xml.xmlwritersettings.checkcharacters(VS.80).aspx


"Martin Honnen" <mahotrash@xxxxxxxx> wrote in message
news:eqqbG%23goHHA.5052@xxxxxxxxxxxxxxxxxxxxxxx
clintonG wrote:
Thanks for confirming that the XmlTextWriter methods escapes and encodes
specific text characters as HTML character entities. The HTML character
entity naming conventions you attempt to clarify are defined by W3C
(24.4.1 The list of characters, Special characters for HTML [1]). My
question should have asked if the method escape and encode "text
characters" as HTML entities. Nitpicker ;-)

XML defines its own entities and what XmlWriter does is based on the XML
specification and _not_ on the HTML specification.
See <http://www.w3.org/TR/REC-xml/#sec-predefined-ent>.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


.



Relevant Pages

  • Re: XmlTextWriter Encodes HTML Entities?
    ... Most of us and most documentation including W3C documentation define & ... drop the verbiage "HTML" when describing character entities. ... XML but not part of HTML, while ö is part of HTML but not of XML; ... use of the language. ...
    (microsoft.public.dotnet.xml)
  • Re: XmlDocument Escaping - and I Dont Want It To
    ... valid HTML file with all the special characters recognized. ... automatically escape the character using a _numeric_ character entity, ... whatever is in it is valid XML. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XmlDocument Escaping - and I Dont Want It To
    ... valid HTML file with all the special characters recognized. ... automatically escape the character using a _numeric_ character entity, ... whatever is in it is valid XML. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XmlDocument Escaping - and I Dont Want It To
    ... valid HTML file with all the special characters recognized. ... browser will ignore spaces unless they are explicitly indicated using ... whatever is in it is valid XML. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: XmlTextWriter Encodes HTML Entities?
    ... Most of us and most documentation including W3C documentation define & ... drop the verbiage "HTML" when describing character entities. ... XML but not part of HTML, while ö is part of HTML but not of XML; ... if you speak about those in HTML you refer to hundreds of them. ...
    (microsoft.public.dotnet.xml)