Re: NSXMLParser failing w/o quotes?
Re: NSXMLParser failing w/o quotes?
- Subject: Re: NSXMLParser failing w/o quotes?
- From: Prachi Gauriar <email@hidden>
- Date: Tue, 28 Oct 2003 02:57:49 -0600
On Oct 28, 2003, at 1:11 AM, Roarke Lynch wrote:
I am playing around with NSXMLParser and a little HTML, I have come
across an error that seems odd to me. It looks like it will crash with
and internal error (code 1) if an attribute value isn't placed within
quotes. Has anyone else noticed this or am I over looking something?
if i try to parse:
<HTML>
<HEAD>
</HEAD>
<BODY>
a little <A href="someurl.html"> text </A>
<TABLE border=0>
</TABLE>
</BODY>
</HTML>
i get an NSXMLParserErrorDomain error (which is code 1 and in the
header is an internal error). but if i place quotes around the 0 (i.e
"0") it works just fine.
Looking at the all the messages passed to the delegate, it ends the
area tag, and then crashes after finding whitespace characters. It
never tells the delegate that it is starting the table element.
However, the whitespace is not issue, it is encountered previously
without causing an error.
Based on the XML grammar at <
http://www.w3.org/TR/REC-xml>:
Attribute ::= Name Eq AttValue
AttValue ::= '"' ([^<&"] | Reference)* '"'
| "'" ([^<&'] | Reference)* "'"
In other words, attribute values must be surrounded by single- or
double-quotes. I'm not quite sure this corresponds to an
NSXMLParserInternalError, but the above XML is malformed and should
result in some type of error during parsing.
-Prachi
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.