My favorites | Sign in
Project Logo
                
Search
for
Updated Jun 01, 2009 by jwight
Labels: Featured
TouchXML  

Introduction

TouchXML is a lightweight replacement for Cocoa's NSXML cluster of classes. It is based on the commonly available Open Source libxml2 library.

License

TouchXML is released under the MIT license.

Goals

The goal is to create a lightweight NSXML style XML api that can used in environments without NSXML (e.g. iPhone).

Currently implemented

Roadmap

Short Term

Medium Term

Long Term/Never


Comment by joost.ko...@gmail.com, Apr 20, 2009

Thanks for these additions, I hope they can help me (Still having some problems with parsing my HTML Data, will have to check some code over and over again I suppose. NSXML was working fine.)

I noticed a problem when tidying using CXMLDocumentTidyHTML, since the enum has not been defined properly, it should be something like:

enum {
	CXMLDocumentTidyHTML = (1 << 0), // Based on NSXMLDocumentTidyHTML
	CXMLDocumentTidyXML = (1 << 1), // Based on NSXMLDocumentTidyXML
};

At the moment, CXMLDocumentTidyHTML equals 0 so it's not possible to compare bitwise.

Comment by joost.ko...@gmail.com, Apr 20, 2009

Oh, before I forget to mention: I have changed the CTidy instance methods to be class methods, just because it's not needed to have an instance of the class.

Comment by martinkim.pham, Apr 22, 2009

Will someone give me some help for including the tidy source code?

I have downloaded the tidy04aug00.tar and expanded it. This is what I get:

/Users/q231950/Downloads/tidy4aug00/release-notes.html /Users/q231950/Downloads/tidy4aug00/pprint.c /Users/q231950/Downloads/tidy4aug00/man_page.txt /Users/q231950/Downloads/tidy4aug00/Makefile /Users/q231950/Downloads/tidy4aug00/parser.c /Users/q231950/Downloads/tidy4aug00/Overview.html /Users/q231950/Downloads/tidy4aug00/tidy.gif /Users/q231950/Downloads/tidy4aug00/tidy.c /Users/q231950/Downloads/tidy4aug00/grid.gif /Users/q231950/Downloads/tidy4aug00/entities.c /Users/q231950/Downloads/tidy4aug00/platform.h /Users/q231950/Downloads/tidy4aug00/pending.html /Users/q231950/Downloads/tidy4aug00/lexer.c /Users/q231950/Downloads/tidy4aug00/attrs.c /Users/q231950/Downloads/tidy4aug00/tags.c /Users/q231950/Downloads/tidy4aug00/tab2space.c /Users/q231950/Downloads/tidy4aug00/istack.c /Users/q231950/Downloads/tidy4aug00/clean.c /Users/q231950/Downloads/tidy4aug00/config.c /Users/q231950/Downloads/tidy4aug00/localize.c /Users/q231950/Downloads/tidy4aug00/html.h

How to proceed?

Thanks in advance & have a nice day, Martin Pham

Comment by joost.ko...@gmail.com, Apr 22, 2009

Then you already get more out of the .tar file than what I got, I was stuck in a loop of archive files.

The tidylib files are actually in the SVN checkout and you have to add the files from the tidylib/src and tidylib/include folder to your project. Then it should work fine.

Comment by martinkim.pham, Apr 24, 2009

Thanks Joost!

The CVS checkout is obligatory since the repository's content is completely different compared to the files in the tidy04aug00.tar.

Comment by yurypetrov007, May 01, 2009

I don't know if this is relevant or not, but NSXML ignores open-ended tags, like <a name="">, while CXML doesn't. This was the main difference I noticed when parsing using XPath. The other was that parsing a NSString with non-Latin characters converts them to something else, i.e. there is some encoding mixup in the pipeline, which is a real bummer for me. NSXML doesn't have this problem.

Comment by jwight, Apr 18, 2009

I've created TouchCode? Dev Google Group. This is now the preferred forum for TouchCode? related development questions: http://groups.google.com/group/touchcode-dev

Comment by dannynip, Jul 18, 2008

Is it me or is TouchXML.h file missing from the SVN Checkout?

Comment by squeegyx, Jul 21, 2008

Yeah, maybe this is why importing CXMLDocument.h results in 254 build errors about missing files and constants.

Comment by smith288, Jul 21, 2008

Just make one with this:


#import "CXMLDocument.h"
#import "CXMLElement.h"
#import "CXMLNode.h"
Comment by smith288, Jul 21, 2008

sorry:


#import "CXMLDocument.h"
#import "CXMLElement.h"
#import "CXMLNode.h"
#import "CXMLNode_XPathExtensions.h"
Comment by sahilofdesai, Aug 08, 2008

Where exactly do we add those 2 configuration lines?

Comment by moirastuart1, Aug 09, 2008

Project Info -> Build Tab -> Set "Other linker flags" to -lxml2 and Set "Header Search Paths" to /usr/include/libxml2

Comment by phil.swenson, Aug 12, 2008

are there any examples? I can't find any decent docs or examples...

Comment by qslack, Aug 20, 2008

You need to add the Header Search Path in both Edit Project Settings and Edit Active Target "YourApp?", by the way.

Comment by Bergetun, Aug 29, 2008

First of all, thank you very much for doing this. It looks great :)

Do anyone know of any examples ?

What is inOption ?

Comment by avocade, Sep 04, 2008

Great stuff.

Comment by grijalva, Oct 03, 2008

Bergetun: The api mirrors NSXML pretty closely. Look at Apple's (non-iphone) documentation on NSXML for example of how to use this. You'll just need to replace the NS with C in the classnames.

Comment by speakermouth, Oct 22, 2008

A good starting point in the 'Core Library' docs would be "Introduction to Tree-Based XML Programming Guide for Cocoa". Just search for it - but make sure your search query is set to 'Full text' and not 'API'.

Comment by jwight, Apr 18, 2009
Comment by jwight, Apr 18, 2009

I've created TouchCode? Dev Google Group. This is now the preferred forum for TouchCode? related development questions: http://groups.google.com/group/touchcode-dev

Comment by sagarbeec, May 05, 2009

I got 32 errors following the described method.

All errors are coming in CTidy.h & CTidy.m file.

1) tidy.h: no such file or directory. 2) buffio.h: no such file or directory. 3) 'TidyDoc?' undeclared (first use in this function) .... .... ....

Comment by jimhpkuo, May 06, 2009

It seems you now also need to add the files from TouchXML/Externals/tidy/include, but I still got 14 errors during build, a lot of these...

-tidyData:inputFormat:outputFormat:diagnostics:error:? in CTidy.o
Comment by shigmas, May 17, 2009

Those would just be the headers. If you add the TouchXML/Externals/tidy/src, it should work.

Comment by danmorgz, May 27, 2009

I'm getting the same errors as sagarbeec

"I got 32 errors following the described method.

All errors are coming in CTidy.h & CTidy.m file.

1) tidy.h: no such file or directory. 2) buffio.h: no such file or directory. 3) 'TidyDoc??' undeclared (first use in this function) .... .... ...."

Comment by danmorgz, May 27, 2009

I did this:

Those would just be the headers. If you add the TouchXML/Externals/tidy/src, it should work.

And got 3123 erros :-)

Comment by jag...@mostworks.de, Jun 08, 2009

Hi All,

i solve the problem with this: adding: "TouchXML/Externals/tidy/include" AND "TouchXML/Externals/tidy/src"

this works for me at the moment

Comment by Paolo.Ottana, Jun 09, 2009

I managed to compile, my problem is that parsing an HTML page gives several errors in console like:

Entity: line 8: parser error : Opening and ending tag mismatch: INPUT line 7 and FORM </FORM>

The very same html page was parsed correctly by equivalent NSXMLDocument and NSXMLElement...

Comment by Paolo.Ottana, Jun 09, 2009

...the result is that an xpath query gives no results using CXMLDocument while gives expected results using NSXMLDocument

Comment by yaghiyah.brenner, Jul 01 (4 days ago)

Can someone please help me understand something?

Is it possible to compile the touchxml code as a library to use in a project instead of putting all the source files in a common directory for every project this would yield a neater code structure.

There is a nuke file that contains the following lines of code. I dont understand how this is used but i take it these are the steps to follow ?

;; ;; Nukefile for TouchXML ;; ;; Commands: ;; nuke - builds TouchXML as a framework ;; nuke test - runs the unit tests in the NuTests? directory ;; nuke install - installs TouchXML in /Library/Frameworks ;; nuke clean - removes build artifacts ;; nuke clobber - removes build artifacts and TouchXML.framework ;; ;; The "nuke" build tool is installed with Nu (http://programming.nu) ;;

Thanks in advance.

Comment by dgro...@ulocate.com, Mar 08, 2008

You rock.

Comment by ernest.surudo, Apr 13, 2008

This will be super helpful. I can't believe this isn't part of the framework...

Comment by tynorton, Apr 14, 2008

Thank you so much! I cannot believe they didn't include web services core...

Comment by nicktulip, Jul 11, 2008

how about some sample code for win32 developers?

Comment by jwight, Jul 11, 2008

@nicktulip The code is based on a subset of NSXMLDocument, You can see apple's documentation for NSXMLDocument here: http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSXMLDocument_Class/Reference/Reference.html

There's a bit of info here too:

http://code.google.com/p/touchcode/wiki/TouchXMLImplementation

Comment by roland.hu, Jul 15, 2008

It's very useful, thanks.

Comment by boulette42, Aug 27, 2008

Where can i download the TouchXML framework?

Comment by bulbous, Aug 29, 2008

you can check it out using: svn checkout http://touchcode.googlecode.com/svn/trunk/ touchcode-read-only

Comment by fgrios, Jan 06, 2009

Does touchXML implement the xmlXPathRegisterNs method and allow the user to do an XPath Search using namespace prefixes?

Comment by Kendall....@kigisoftware.com, Feb 22, 2009

License question, how do you interpret the MIT license clause "include a copy of the license with your distribution" on the iPhone? Do we need to provide the MIT license in an About page, or is it needed at all?

Comment by jjsqueeze, Apr 14, 2009

Has someone successfully integrated libtidy with TouchXML ? The URL I want to analyse gives me lots of parser errors and cannot be analysed with TouchXML.

Comment by jwight, Apr 18, 2009

I have integrated libtidy with TouchXML. I'll look at adding it.

Comment by jwight, Apr 18, 2009

I've created TouchCode? Dev Google Group. This is now the preferred forum for TouchCode? related development questions: http://groups.google.com/group/touchcode-dev

Comment by marcusrodrigues2005, May 14, 2009

Please, what is the new address for the SVN checkout? I had this one, and it is not working...

svn checkout http://touchcode.googlecode.com/svn/trunk/ touchcode-read-only Thx in advance for any help!

Comment by smith288, May 25, 2009

they use mercurial now (for some odd reason...)


Sign in to add a comment
Hosted by Google Code