• 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
NSXMLParser trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSXMLParser trouble


  • Subject: NSXMLParser trouble
  • From: Alastair Houghton <email@hidden>
  • Date: Mon, 27 Jun 2005 18:07:23 +0100

Hi all,

I've been trying to use NSXMLParser to write a tool (similar to AppleGlot, which doesn't seem to be working properly for us) to merge localised strings into the resources of a Cocoa app. It's *mostly* working, but I've noticed that some strings aren't being read correctly from the XML. An example of something that doesn't seem to be working is:

  <TextItem>
  <Description>Some text: MORE TEXT (&lt;=100) </Description>
  <Position>MORE TEXT (&lt;=100)</Position>
  <TranslationSet>
    ...
  </TranslationSet>
  </TextItem>

(The format, for those that don't recognise it, is the same one that AppleGlot uses; this is intentional.)

The problem I'm seeing is that the "&lt;" isn't being converted into the character it represents. This would be OK, *if* the NSXMLParser left it in the data it passed to the delegate method - parser:foundCharacters:, but I'm seeing two calls to the delegate method, as follows:

  -parser:<NSXMLParser *> foundCharacters:@"Some text: MORE TEXT ("
  -parser:<NSXMLParser *> foundCharacters:@"=100)"

So when I hit the </Description> tag, the string I've been building up looks like this:

  "Some text: MORE TEXT (=100)"

instead of

  "Some text: MORE TEXT (<=100)"

Has anyone else seen this problem, or anything similar?

I notice that the equivalent functionality in Core Foundation is listed as "Currently not supported." Does this have any impact on the Foundation NSXMLParser class?

Kind regards,

Alastair.

--
http://www.alastairs-place.net


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [SOLVED] NSXMLParser trouble
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: getting the bounds as seen by the user
  • Next by Date: Re: Convert PICT to NSImage
  • Previous by thread: Re: getting the bounds as seen by the user
  • Next by thread: Re: [SOLVED] NSXMLParser trouble
  • Index(es):
    • Date
    • Thread