OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Error and Fatal Error


At 7/18/2011 01:14 PM, Stephen D Green wrote:
>The problem is that there are tags in the strings - it is XML.
>System.Security.SecurityElement.Escape and HtmlEncode
>would change the angle brackets in the tags too.

I suggest that you've failed to accept what many have been telling 
you: The presence of angle brackets around sequences of certain 
characters might create "tags", but that does not make it XML.  "XML" 
is a well-defined language.  Claiming that text such as;
    <elem attr="<"&<Bob"/>
is XML doesn't make it so.  There are explicit rules in the 
definition of the language XML that prohibit attribute values 
containing <, &, and the quoting character itself unless they are 
properly "escaped".  Violation of those rules means that the text 
doesn't meet the definition of XML.  Would you, for example, expect a 
C processor to process this text properly:
    switch (flag] { ... )
even though the right square bracket was pretty "obviously" supposed 
to be a right parenthesis and the right parenthesis a right curly 
brace?  I haven't encountered a C processor that would make those 
corrections -- they all seem to report syntax errors and expect me to 
make the corrections.  I don't find that unreasonable.

I'm no longer a software developer (although I was for many, many 
years), and yet I've been able to write fairly simple code in a 
couple of different languages that pseudo-parses input text that 
claims to be XML, locates certain aberrations that my application 
typically produces (e.g., & and < in what were intended to be 
attribute values, -- in what were intended to be comments), and 
corrects those specific errors (e.g., replacement with character 
references and insertion of a space between the hyphens).  Full 
parsing is rarely needed, depending on the precise errors that you 
intend to fix.  I'm sure that you can do the same without significant 

Hope this helps,

Jim Melton --- Editor of ISO/IEC 9075-* (SQL)     Phone: +1.801.942.0144
   Chair, ISO/IEC JTC1/SC32 and W3C XML Query WG    Fax : +1.801.942.3345
Oracle Corporation        Oracle Email: jim dot melton at oracle dot com
1930 Viscounti Drive      Alternate email: jim dot melton at acm dot org
Sandy, UT 84093-1063 USA  Personal email: SheltieJim at xmission dot com
=  Facts are facts.   But any opinions expressed are the opinions      =
=  only of myself and may or may not reflect the opinions of anybody   =
=  else with whom I may or may not have discussed the issues at hand.  =

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS