Alternative to NSXMLDocument on the iPhone for XSLT purposes - iphone

I know it's been asked before (like here), but is there way to natively use XSLT on the iPhone? If not, and I need to use libxslt, is there any documentation/tutorial of how to use it on the iPhone?
EDIT:
I've decided to use libxslt. What files are necessary to include? I haven't found any tutorials of examples of use on the iPhone, and I'm unsure of how to approach it. Any help would be appreciated.
Thanks in advance.

Cannot use libXSLT on iPhone. Not as of today. App will be rejected. libXSLT is built into the iOS andd COULD be called - but this is a private API of the iPhone and will cause rejection. If you compile the libxslt library yourself and statically link it to your app, you will still get rejected. Many people have reported this bug in the app review process but nothing has yet changed.

It depends how you want to use XSLT; not sure what you mean by "natively". If you're just embedding a browser, MobileSafari will interpret XSLT for you.
If you're just converting one XML document into another for processing, libxslt is not a bad choice. There's no difference using libxslt on the iPhone from any other platform. Given Apple doesn't include headers for it, it is likely they don't want you using the bundled copy. You are better off compiling a copy into your application instead, against the provided libxml2 library.
If you want a more specific answer you may wish to pose a more specific question. :-)

Related

Using XML-RPC in iPhone apps

Is it possible to use XML-RPC calls in iPhone application (what approaches are the best)?
Are there any constraints with XML-RPC?
Thank you,
Paul
I have recently come across this library, take a look at the description at the end.
Hope you find it useful.
https://github.com/eczarny/xmlrpc
You might be interested in the WordPress for iOS app. It's completely open source and uses an XML-RPC library.
http://ios.wordpress.org/

New iPhone Dev policy...how does Apple enforce this?

Apple doesn't want anyone to create iPhone apps outside of the Xcode/Objective-C environment. How can they actually enforce this?
If the non Xcode IDE, for example Unity, compiles to an iPhone executable, how will Apple know which dev environment you used to create the app? Can they have Xcode compile some sort of signature into the executable that no one knows about?
For tools such as unity, corona, flash, and other platforms used to 'generate' iphone apps, Apple may be able to 'decompile' and examine your app (look at patterns of generated functions, etc). From this, they might be able to guess that your app was generated with such a tool.
In the limit, this is impossible. Consider the following: I write some script code to generate a bunch of objective-c code. Then I manually import the objective-c files into xcode and build the app. How would apple be able to distinguish the script-generated code from human-written code? Maybe I just tend to write code that happens to look machine-generated. There's no way for apple to determine whether the code was "originally written in objective-c, c, c++ or javascript" or not, yet this would still, technically, violate the agreement. That's why the 3.3.1 part of the agreement is nonsense.
Most automated systems do things a particular way, which isn't hard to detect. If you've ever looked at the PHP or JavaScript code Adobe Dreamweaver generates, for example, you know how easy it is to find stuff like this.
Apple is doing this to prevent people from using Adobe's Flash development framework. It should also be noted that Apple's decision to limit Application Frameworks like this is causing the DOJ/FTC or some government agency to start an informal inquiry into monopolistic practices.
From this article:
"According to the Post's Hollywood source, Apple's ban of Adobe's Flash technology on the iPhone and iPad is what prompted the government to poke around. "
They really don't have an issue up until now with other frameworks because Adobe didn't have one based with the Flash environment. Now that there is one, Apple is going to restrict anything that talks/looks/smells/acts like an Adobe Flash app on the iPhone. In my opinion, they won't do anything to other frameworks, but they'll enforce the rule just for Adobe. Which brings up the whole monopolistic practices thing.
I believe that many of these translator tools have some kind of common runtime function library which take care of the portions that could not be translated 1:1. Those function could then be pretty constant regardless of your application. That way there would be no real need to decompile the app. but instead just look for usage of those function signatures.
FWIW I find the whole idea of limiting user's choice of tools is a bad move.

Examples of interpreters embedded in iPhone Applications?

I'm trying to find examples of interpreted languages ported to the iPhone, with source code available to show how to embed it, without Jailbreaking the device:
I've found:
Ruby: http://www.cocos2d-iphone.org/forum/topic/1163
Lua: http://www.mobileorchard.com/announcing-iphone-wax-native-uikit-iphone-apps-written-in-lua/
and I'd like to see what else is out there. I know that Apple may or may not allow usage of an interpreter in an app (or downloading new code to run in the interpeter), but I'm ok with that, as I want this mostly to simplify development.
Are there any other examples out there?
There's Nu.
Nu is a Lisp-on-ObjC-runtime thing. The link above is to information on iPhone embedding. The language homepage is here.
PHP, Python, Tcl.
iPhone Frotz is an interpreter for the Z-Machine and is open source.
How about C#?
And soon also Flash..
The Processing environment has been adapted for the iPhone. I believe that it comes from ProcessingJs which translates the Processing code to Javascript.
Processing for IOS (if the link doesn't work, search for it)
http://itunes.apple.com/sg/artist/boyd-rotgans/id492576046
or a commercial version that allows you to import/export scripts
http://itunes.apple.com/app/pr0c0d1n6/id493549542?mt=8
There is also a tool to convert ProcessingJs scripts to native iPhone Apps.
http://luckybite.com/iprocessing/

iPhone - does TouchXML use an undocumented APIs?

Recently I've heard that Apple is using tools to search for references to undocumented APIs and are rejecting iPhone apps from the App Store because of it.
The popular Three20 framework is causing people to get rejected.
I also just saw that the KissXML library has also caused rejection.
I'm looking for an Objective C DOM-based XML parser and am now considering TouchXML.
Can anyone confirm that TouchXML does not reference any undocumented APIs? I don't want to risk an app rejection based on this.
I can confirm that I've included no private frameworks in several projects that use TouchXML that have all become apps in the App Store. I would ask the question at the google code site to make sure, but John Wight who wrote the library writes very clean and tight code. It would surprise me if he used any undocumented APIs.
Also, I wouldn't worry about it too much. Build your app and submit it and if it gets rejected, fix it then. Apple will even tell you what API you're referencing that you're not supposed to if that is the case. If you have to go through their bureaucracy anyhow, you might as well benefit from it by making them tell you what's wrong. Also, keep in mind that probably everyone gets rejected at least once--especially if it's your first app. ;-)
Tidy does. My app was just rejected from the app store on that basis.
"3.3.1 Applications may only use Documented APIs in the manner prescribed
by Apple and must not use or call any private APIs."
The following non-public APIs are included in your application:
tidyBufAlloc
tidyBufFree
tidyBufInit
tidyCleanAndRepair
tidyCreate
tidyOptSetBool
tidyParseBuffer
tidyParseString
tidyRelease
tidySaveBuffer
tidySaveString
tidySetCharEncoding
tidySetErrorBuffer
tidySetOutCharEncoding"
I know that there is at least one app on appstore which uses TouchXML. But during development process I found some bugs there, so I try to find some alternative now.
Consider using libxml2. It has a steeper learning curve, but the speed and flexibility are worth it.
I've just had an app rejected precisely because it uses touchXML

Does iPhone support XML-RPC?

Does iPhone support XML-RPC, Is their any open source framework which I can use?
Checkout the source for the wordpress app. They might be using XML-RPC. :)
http://iphone.wordpress.org/
"Airsource Ltd" is really really incredibly wrong about that document. That document is specific to Mac OS X and NOT the iPhone. In fact (almost) all Apple iPhone documentation is hidden away behind a login page and a licence agreement. Most of the technologies that document refer to (e.g. AppleScript) do not even exist on the iPhone.
Amit, you'll have Zero luck if you follow Airsource's advice. You will however do ok if you do as "Lounges" says and go grab the wordpress source code. It looks like they rolled their own XMLRPC library for use on the iPhone.
As for SOAP - you're on your own. You might be able to find an opensource SOAP library built on top of libxml2 though. Good luck.
Yes iPhone support XML-RPC and wordpress opensource application is best example of it,
but from performance aspect I must say JSON is better to use with iPhone application,
from here https://github.com/stig/json-framework/ u can download JSON parser.