RE: Some XSLT hacks for xmlspec documents

That rings some bells:

I'm working on four xmlspec docs in parallel at the moment and this
started to do my head in, rather rapidly. Since it seems that any
document needs a slight tweak to the "standard" XSLT to allow you to do
what you want.

As a result, I did a couple of edits to try to rationalise this, and
have a single XSLT and not have to do any post-processing of HTML. 

The first edit is to allow the linking of an additional CSS file. The
current xslt allows you to pass literal CSS as a paramter, but that
didn't really help much.

I'd have much preferred to provide for the literal inclusion of CSS from
an additional file but haven't figured out how to do this simply
[document(), no; unparsed-text(), no; xinclude, needs two passes ...].

The second edit is to include an additional xsl file to allow for
over-riding aspects of the default template's behavior.

I made a couple of other fixes to the standard XSLT but the one that
probably needs doing the most that I haven't done is that a list inside
a paragraph in xmlspec generates invalid XHTML. It's easy enough to
avoid, which is why I haven't fixed it.

For completeness, other tweaks are: 
- make the revisiondesc actually generate something
- make the subtitle actually generate something
- make editor's drafts use the editors draft CSS
- provide for mouse-over pop-ups on <kw>s
- include the value of the role attribute on emph elements as a class=
in the output
- change the behaviour of termdef
- make editors notes behave differently
...

Oh and also a separate uprev.xsl to update the date, current and
previous links when preparing a new editor's draft.

Hope of some interest.

Jo




> -----Original Message-----
> From: spec-prod-request@w3.org [mailto:spec-prod-request@w3.org] On
Behalf
> Of Thomas Roessler
> Sent: 24 October 2007 19:01
> To: spec-prod@w3.org
> Subject: Some XSLT hacks for xmlspec documents
> 
> 
> Hello,
> 
> I thought it might be time to share some XSLT hacks that I've been
> using with xmlspec.
> 
> - http://www.w3.org/2006/WSC/drafts/rec/bibsort.xsl
> 
>   Sort the blist alphabetically, by key.
> 
> - http://www.w3.org/2006/WSC/drafts/rec/fix-style.xsl
> 
>   * Some additional style information, to make anchor names visible
>     upon hover; stolen from Mark Nottingham's Web site.
>   * Adding navigation links (inpsired by Norm Walsh's blog post
>     about the XProc drafts; I didn't see him link to any code)
>   * Mark broken specprod references (which end up as an <a
>     href="#">...) in nasty red.
>   * Turn headings into links to themselves, to make copy & paste of
>     anchors easier.
>   * Different mark-up and formatting for "<note>" elements.
>   * <phrase role="sqbrackets"> in xmlspec now causes optically
>     highlighted square brackets in the spec text; useful for
>     contentious material
> 
> Hope these are useful.
> 
> Regards,
> --
> Thomas Roessler, W3C  <tlr@w3.org>

Received on Wednesday, 24 October 2007 18:41:07 UTC