Re: How to add a DOCTYPE declaration to an NSXMLDocument?
Re: How to add a DOCTYPE declaration to an NSXMLDocument?
- Subject: Re: How to add a DOCTYPE declaration to an NSXMLDocument?
- From: Bruce Sharpe <email@hidden>
- Date: Wed, 31 Mar 2010 11:29:55 -0700
Good advice, Matt. Comments below.
* Read the documentation properly. For example, a class has a superclass,
> which may contain the methods you're looking for (probably why setName: was
> missed).
>
No, setName was missed because it is a rather non-obvious name (IMHO) for a
method to set the doctype, and googling for terms like doctype, doctype
declaration, etc. didn't surface it.
Short rant: Apple's developer documentation, while good in many respects,
would really benefit from having small code samples for everything.
Pointing to a 2,000 line program isn't a substitute, and there isn't full
coverage even then. Microsoft's documentation gets it right and it is much
easier to dive into and get going quickly.
> * Be rigorous with XML.
>
Absolutely. There is a handy online validator
here<http://validator.w3.org/>and I recommend that anyone creating XML
use it.
Why declare an NSXMLDTD and alloc it as a different class?
>
That was a typo. It is in fact harmless, but it makes the code less
readable, which is a bad thing.
> * Test rigorously.
Well, yeah. It is still not clear to me why seemingly equivalent code
doesn't give the same result, but (as described in the previous message)
I've now got some very clean code that works, so I'll move forward from
there.
Bruce
_______________________________________________
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