imagine i have NSData object and i have 2 options to fill that up.
filling with:
1-HTML contents
2-XML contents
my question is that how can i detect that my NSData object is filled with HTML or XML contents?
Aside from this, guide me with any possible alternative solution.i use LibXml 2.2 in my project also.
thanks.
You could probably look at the first 4 bytes of the NSData. If the first 4 bytes are:
That indicates an XML doctype. Assuming consistency in your files, you can assume that anything without a XML doctype is HTML.