OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps]GSoC 2013 idea: Using client-side XSLT

Some notes on my experience with the XSLT 2.0 docbook stylesheets and Saxon-CE (based on memory - this was a while ago):
1. Firstly, there were a few XSLT files that required DTD references - these won't work in the browser so I performed an identity transform on these to just get the resolved entities in the XML
2. After the first step, the XSLT compiled ok but took about 16 seconds compared to the 6 seconds on my desktop. I realized that even getting the compile time down to  approach this would be nowhere near good enough, but I decided to persist just out of interest.
3. After sorting XSLT files by size, I realized that the largest file sizes were associated with Docbook foreign language features which weren't required. Removing the dependencies on these reduced compile-time down to about 10 seconds, but this is where I stopped because I can't imagine someone clicking a documentation link being prepared to wait this length of time.

My instinct now would be to use the Saxon documentation code at: https://github.com/Saxonica/Saxon-CE/tree/master/user-doc as a starting point. The schema uses (HTML5 with sections and articles) isn't too different from Docbook.

The important point about the XSLT used for the Saxon-CE documentation is that it was designed from the outset to be sympathetic to the constraints imposed by a web client. But, perhaps more importantly, to take advantage of the benefits the web client brings. 

For example Saxon-CE lets you bind XSLT templates to user or system events, so all sections are only rendered when required, whilst the containing articles are  downloaded in advance, so they're available when the reader moves to a new section. The TOC works the same way when shown in the tree-view, only those nodes in view are added to the HTML DOM, another example is that relative references in hyperlinks are only resolved to their absolute equivalents when they're clicked.

It would be interesting to see a Docbook client XSLT 2.0 implementation take this approach.

(Note: I did work with Saxonica on this for a while but I'm no longer associated with the project - if you want more Saxon-CE help I would suggest visiting https://saxonica.plan.io/projects/saxon-ce/boards)

Phil Fearon.

On Mon, Apr 8, 2013 at 5:18 PM, Jirka Kosek <jirka@kosek.cz> wrote:
On 7.4.2013 23:06, DImuthu Upeksha wrote:

> 1. In saxon-ce, it transforms xstl 2.0 style sheets at client side. Even I
> used customized style sheets it is needed to load all docbook style sheets
> to the browser. It takes a lot of time and in some cases browser crashes.
> So I think using existing  2.0 stylesheets are not going to work for this
> project.

It's quite likely that


is too much for browser base XSLT engine. However most of documents use
just small number of templates. So one of things you could do is either:

- strip down parts of stylesheets which are not necessary

- create some metastylesheets which will compose stylesheet on demand
based on elements used in your document

Also if there is some crash it would be nice to debug it in order to see
where the problem is.

> 2. In my opinion it is need to write a light weight style sheet from the
> beginning instead of that large chunk of files, that can be passed to
> Saxon-CE. But it is like re writing docbook style sheets. It is better if
> it be single style sheet without set of "includes or imports" so that we
> can improve the performance.

I don't think that rewrite is good approach. I think that by stripping
down existing XSLT 2.0 stylesheets you should get workable solution.

> So now I'm stuck at this point. Do you have any idea better than this to
> get an approach to this project.

You should do more investigations first. Are crashes caused by browser,
JS engine, Saxon-CE, ...? Are performance issues caused by size of
stylesheet or number of stylesheet modules that are loaded? You need to
know where the bottleneck is before you will try to remove it.


  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    Bringing you XML Prague conference    http://xmlprague.cz

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]