• 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
Re: NSXML encoding question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSXML encoding question...


  • Subject: Re: NSXML encoding question...
  • From: James Bucanek <email@hidden>
  • Date: Sun, 26 Aug 2007 09:24:34 -0700

Martin Linklater <mailto:email@hidden> wrote (Sunday, August 26, 2007 5:05 AM +0100):
<code>
addr = *PC + ( *(PC + 1) &lt&lt 8);
</code>

As others have pointed out, it's '&lt;'. XML entities have the general form '&' <entity description> ';', where the description can be the name of a named entity or a literal constant (i.e. '&#60;').


However, if you want to encode literal data that may, or may not, contain reserved XML characters it's easier to use a CDATA block:

<code>
<![CDATA[
addr = *PC + ( *(PC + 1) << 8); // & other <code>crazy</code> stuff!
]]>
</code>


Everything between '<![CDATA[' and ']]>' is read as a literal string of characters and is not interpreted as XML.

--
James Bucanek

_______________________________________________

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: NSXML encoding question...
      • From: "John Stiles" <email@hidden>
References: 
 >NSXML encoding question... (From: Martin Linklater <email@hidden>)

  • Prev by Date: Re: NSXML encoding question...
  • Next by Date: Re: NSXML encoding question...
  • Previous by thread: Re: NSXML encoding question...
  • Next by thread: RE: NSXML encoding question...
  • Index(es):
    • Date
    • Thread