#1224 HTML Parsing Example

florin Tue 21 Sep 2010

Any example on parsing html or XParser does it?

Would Fantom work with libraries such as https://atmosphere.dev.java.net/ (comet, continuations)?

brian Tue 21 Sep 2010

Hi florin,

Any example on parsing html or XParser does it?

You can only use XParser to parse XML - assuming your HTML is real XML then it should work fine. It is simple to use:

C:\dev\skyspark\src>fansh
Fantom Shell v1.0.55 ('?' for help)
fansh> using xml
Add using: using xml
fansh> XParser("<a><b/></a>".in).parseDoc.write(Env.cur.out)
<?xml version='1.0' encoding='UTF-8'?>
<a>
 <b/>
</a>

Would Fantom work with libraries such as https://atmosphere.dev.java.net/ (comet, continuations)?

You would need to run Fantom on something like Grizzly I would expect to leverage that project. I believe there are some Fantom servlet plugins floating around.

Login or Signup to reply.