[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Debug/QC Stylesheets

Subject: Debug/QC Stylesheets
From: "Nic Gibson" <nicg@xxxxxxxxxx>
Date: Wed, 4 Jun 2008 16:00:10 +0100
 Debug/QC Stylesheets
Good afternoon

Quick intro: I'm new here, I'm nic, I abuse and manipulate data (often
in XML) for a living, right now I work for Penguin Books.

I have a debug stylesheet I use to give me a quick overview of xml we
get in from data converters. Right now, it dumps out  an html list
containing the large scale structure of the xml (it's a DocBook 5
variant) down to chapter level. Below that level it counts various
elements (paras, blockquotes, sections, etc). Our QC people use this
script too. This morning, one of them asked me if I could update it so
that, rather than outputting something like:

chapter:
   24 paragraphs
   3 sections
   2 tables

it could output something like:

   3 paragraphs
   1 section
        2 paragraphs
   1 table
   3 paragraphs

That is it would output the fact that the document contains 3 paras
then 1 section (which contains 2 paras) then 1 table then 3 more
paras.

Initially, I thought 'dead easy' then I had a bit more of a think and
realised that it probably isn't. Right now, I just use something like
count(descendant::para) get my output. Obviously, that no longer
works. Then, I thought that I could probably use following-sibling to
get the requested output. Then I realised that it's not that simple
either.

So, the question. Am I wandering down a path that might be easier to
traverse using DOM or SAX? If not, can anyone point me in the
direction of something similar or suggest an approach? I have a
suspicion that I'm missing something obvious.

cheers

nic
--
Nic Gibson
Director, Corbas Consulting
Editorial and Technical Consultancy
http://www.corbas.co.uk/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.