XML to HTML with asciidoctor help

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XML to HTML with asciidoctor help

Stefan Miklosovic
Hi,

I have xml and I need to transform it to html. I am about to use xslt transformation so all what I need is to write xslt template and run it via some transformer.

Is here any way how asciidoctor could be useful here or do I need to write that xslt?
Reply | Threaded
Open this post in threaded view
|

Re: XML to HTML with asciidoctor help

asotobu
I am not pretty sure but I think that sadly you will need to write a transformer. I said that because Asciidoctor accepts asciidoc format and convert this format to another format, but the input should be asciidoc.
Reply | Threaded
Open this post in threaded view
|

Re: XML to HTML with asciidoctor help

mojavelinux
Administrator

Correct, XML transformation is not something Asciidoctor does.

However, I don't recommend using XSLT. Personally I think it's a bad use of time to use that technology. There are so many good transformation tools based on real programming languages that you should tap into them first.

Transformation is a very straightforward process. You kick off a recursive walk of the tree and delegate to callback methods to handle each node type. I recommend looking at the Groovy ecosystem since the language has the right level of expressiveness for this task.

-Dan

On Feb 26, 2014 11:07 AM, "asotobu [via Asciidoctor :: Discussion]" <[hidden email]> wrote:
I am not pretty sure but I think that sadly you will need to write a transformer. I said that because Asciidoctor accepts asciidoc format and convert this format to another format, but the input should be asciidoc.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/XML-to-HTML-with-asciidoctor-help-tp1544p1545.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: XML to HTML with asciidoctor help

Stefan Miklosovic
Well ...

I am coding this extension to Arquillian (1). There is "reporter extension" project (2). Here is unfinished README for it (3).

That extension is listening to all important Arquillian lifecycle events and there is underlying model (4) annotated via JAXB stuff using jaxb implementation from eclipse link which gets filled as test is proceeding.

The output of that extension is something like this (5) for XML and this (6) for JSON. I get these formats "for free" because JAXB provider can automatically marshall that model to XML and JSON instantly. (7)

So, I am willing to use XSLT and for that I need XSLT template obviously. I can not use Groovy since it is overkill and it is java based project. I am just looking for a way how to marshall that JAXB model to HTML, more or less programmatically, so I am looking for existing options.

Dan said that it is needed to just recursively walk throught that model tree and have some callbacks, that is interesting idea but I do not know if it is not too complicated and cumbersome to deal with that manually.

(1) arquillian-unified-recorder
(2) arquillian-recorder-reporter
(3) readme gist
(4) JAXB model
(5) xml output
(6) json output
(7) exporters