• 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
Event-Driven XML Parsing and Entity References
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Event-Driven XML Parsing and Entity References


  • Subject: Event-Driven XML Parsing and Entity References
  • From: "Carter R. Harrison" <email@hidden>
  • Date: Sun, 27 Jul 2008 14:52:25 -0400

There's been some discussion on this topic previously, but I haven't been able to find the solution that I'm looking for. I'm using the event-driven XML parser (CFXMLParser). Apparently it does not support the replacement of entity references (&amp, &lt, &gt, etc..).
So assume I'm trying to parse the following XML tag:


<title>Planes, Trains, &amp Automobiles</title>

When the parser enters the <title> node, it calls the createStructure callback function three times. Each time it has the following data within the node that is passed in:

Call #1: "Planes, Trains, "
Call #2: "&amp"
Call #3: " Automobiles"

A similar thing happens in the addChild callback function.

I understand that I need to do manual replacement of the &amp with a "&" in this case, but I still don't understand how I'm supposed to maintain the state in between the three calls to createStructure and addChild so that I can successfully concatenate all three text segments together to form the original string (which is what I want to store). I hope this makes sense - it's terribly frustrating.

As always, thanks in advance.
_______________________________________________

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: Event-Driven XML Parsing and Entity References
      • From: Nathan Kinsinger <email@hidden>
    • Re: Event-Driven XML Parsing and Entity References
      • From: Martijn <email@hidden>
  • Prev by Date: Re: Web View silently fails
  • Next by Date: Re: NSGraphicsContext restore crashes my xtension
  • Previous by thread: PDF services
  • Next by thread: Re: Event-Driven XML Parsing and Entity References
  • Index(es):
    • Date
    • Thread