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

AW: Stylesheet for converting XHTML tables to CALS

Subject: AW: Stylesheet for converting XHTML tables to CALS
From: "Huditsch, Roman \(LNG-VIE\)" <Roman.Huditsch@xxxxxxxxxxxxx>
Date: Mon, 6 Mar 2006 14:22:54 +0100
tbody xhtml
Hi David,

Thanks a lot for your comments.
It seems as there is still a lot orf work to be done for me :)

best regards,
Roman

> -----Urspr|ngliche Nachricht-----
> Von: David Carlisle [mailto:davidc@xxxxxxxxx]
> Gesendet: Montag, 06. Mdrz 2006 13:03
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re:  Stylesheet for converting XHTML tables to CALS
>
>
> > I just finished my first attempt to transform XHTML tables
> into tables
> > conforming to the CALS table model.
> > Attached is my XSLT 2.0 stylesheet. Every feedback is
> heartily welcome
> > :)
>
> You appear to be generating elements in the xhtml namespace
> they should probably be in no-namespace or the new docbook 5
> namespace or something, seeing as <entry>  etc are not xhtml.
>
> <xsl:param name="border" select="if(starts-with(@border,
> '0')) then(xs:boolean(0)) else(xs:boolean(1))" as="xs:boolean"
> tunnel="yes"/>
>
> you are starting with a boolean value
> starts-with(@border,'0')
> then if it is true, taking an integer literal and coercing it
> to a boolean. If you need boolean values you can just use
> true() and false() but here you just need <xsl:param
> name="border" select="not(starts-with(@border,'0'))"/>
>
>
> <xsl:apply-templates
> select="xhtml:tr[not(parent::*[local-name()=('thead',
> 'tbody', 'tfoot')])] | xhtml:tbody/xhtml:tr"/>
>
> It's best not to use local-name() in such tests but just to
> use name tests (which are namespace aware) however in this
> case the current element is <table> so the parent of every
> element selected by xhtml:tr is table and so the filter
> testing on local-name is not doing anything.
> so it could be
>
> select="xhtml:tr| xhtml:tbody/xhtml:tr"/>
>
>
> In
>
>   <xsl:template match="xhtml:th | xhtml:td">
> 		<xsl:variable name="position"
>   select="count(preceding-sibling::*) + 1"/>
> 		<entry>
>   			<xsl:if test="@colspan &gt; 1">
> 				<xsl:attribute name="namest">
> 					<xsl:value-of
>   select="concat('col',$position)"/>
>
> don't you need to take account of any colspan attributes in
> earlier columns, and rowspan attributes in earlier rows in
> order to know which coulmn an entry in a table corresponds
> to? (This is the hardest part of switching between html and
> cals tables). In the above you are assuming that the second
> td entry in a row is corresponding to the second column, but
> this is not the case if the first entry spans columns, or if
> an entry in an earlier row spans into the first cell of this row.
>
> David
>
> ______________________________________________________________
> __________
> This e-mail has been scanned for all viruses by Star. The
> service is powered by MessageLabs. For more information on a
> proactive anti-virus service working around the clock, around
> the globe, visit:
> http://www.star.net.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.