• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How do I Allow empty attributes when parsing with XMLParseDataRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I Allow empty attributes when parsing with XMLParseDataRef


  • Subject: How do I Allow empty attributes when parsing with XMLParseDataRef
  • From: Pontus Hulin <email@hidden>
  • Date: Wed, 11 Jun 2008 11:07:56 +0200

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


  • Follow-Ups:
    • Re: How do I Allow empty attributes when parsing with XMLParseDataRef
      • From: Keary Suska <email@hidden>
    • Re: How do I Allow empty attributes when parsing with XMLParseDataRef
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: John Engelhart <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: John Engelhart <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: John Engelhart <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: "Hamish Allan" <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: "Hamish Allan" <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Charles Srstka <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: John Engelhart <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Garbage collector vs variable lifetime
  • Next by Date: Re: Using a Core Data relationship binded to an NSTokenField
  • Previous by thread: Re: Garbage collector vs variable lifetime
  • Next by thread: Re: How do I Allow empty attributes when parsing with XMLParseDataRef
  • Index(es):
    • Date
    • Thread