Hi Vincent,
I am coding to handle the pictures in office document which need replace
<img> to {image}. And remove some conflict between html content and xwiki
syntax, such as <p>[somthing not link]</p>. At first, I want to use regular
expression to replace those tokens. Then I think it should be better if I
use a xhtml parser. So I try the new WikiModelXHTMLParser.
So I think I just use regular expression to handle the html. Or any
suggestion?
Thanks.
On Thu, Jul 3, 2008 at 6:36 AM, Vincent Massol <vincent(a)massol.net> wrote:
Hi Wang,
On Jul 2, 2008, at 7:39 PM, Wang Ning wrote:
Hi Vincent,
I just tried the new rendering class. My test xhtml is:
<html>
<head>
<title>title of this page</title>
</head>
<body>
<div>
<p>first paragraph, really.</p>
<p>second paragraph for test.</p>
</div>
</body>
</html>
I use WikiModelXHTMLParser to parse it and use XWikiSyntaxRenderer
to write
the result to a file.
The output is :
page
paragraph really.
test.
I have tried add a <a href="">link</a> to the input which bring a
parser
exception.
Just tell you what I find and I'll drill into the code to see what's
wrong.
Any suggestion?
This is probably related to
http://code.google.com/p/wikimodel/issues/detail?id=21
I already have a small battery of tests for the XHTML parser in the
rendering component. They are in xwiki-rendering-tests, you can check
the WikiModelXHTMLParserTest class. Uncomment the code and run it.
Right now it's commented because there are bugs in wikimodel which I'm
reporting in
http://code.google.com/p/wikimodel/issues/list
For example:
http://code.google.com/p/wikimodel/issues/detail?id=22
http://code.google.com/p/wikimodel/issues/detail?id=21
Now the next step is to fix the wikimodel XHTML parser...Note that
Mikhail (the author of wikimodel) is currently working on fixing some
of those but he's (of course) interested in getting our help.
For the link syntax it's not implemented yet. I'm going to work on
this real soon but I need to find how to do it first.
If you're interested in helping there are 2 areas you could help:
* provide patches for the rendering module
* provide patches for wikimodel
However right now try focusing as much as possible on the office
import work since Mikhail and myself are working on the XHTML parser
and we'll eventually get it working.
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs