Re: How do I Allow empty attributes when parsing with XMLParseDataRef
Re: How do I Allow empty attributes when parsing with XMLParseDataRef
- Subject: Re: How do I Allow empty attributes when parsing with XMLParseDataRef
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 11 Jun 2008 12:44:59 +0200
I wasn't even aware of this XML parser.
As we are on a Cocoa list I suggest you to have a look at
NSXMLParser. Else this question is completly off topic.
Le 11 juin 08 à 11:07, Pontus Hulin a écrit :
Im using
XMLParseDataRef
to parse xml, but the parse does not accept empty attributes:
My code look like this:
sXMLStartElementUPP =
(StartElementHandlerUPP
)NewStartElementHandlerUPP(StartElementHandler);
sXMLEndElementUPP =
(EndElementHandlerUPP)NewEndElementHandlerUPP(EndElementHandler);
sXMLCharHandlerUPP =
(CharDataHandlerUPP)NewCharDataHandlerUPP(CharHandler);
err = OpenADefaultComponent(xmlParseComponentType,
xmlParseComponentSubType, &xmlParser);
if (err == noErr) {
XMLParseSetEventParseRefCon(xmlParser, (long) rec);
XMLParseSetStartElementHandler(xmlParser,
sXMLStartElementUPP);
XMLParseSetCharDataHandler(xmlParser, sXMLCharHandlerUPP);
XMLParseSetEndElementHandler(xmlParser, sXMLEndElementUPP);
err = XMLParseDataRef(xmlParser, hdataref,
HandleDataHandlerSubType, xmlParseFlagEventParseOnly |
xmlParseFlagAllowUnquotedAttributeValues, NULL);
I get the error - 2158, when parsing this:
<page-status default="">
<name>Proofreading</name>
How do I tell the parser that is is ok with empty attribute strings?
Is there a "parseflag" for this or do I need to use another parser?
Best regards
/ Pontus hulin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden