Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2006, 04:29 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to franklinclinton
Default very urgent:cals table to indesign table using xsl

Friend,

If anybody knows how to convert cals table into indesign table using xsl please help me.

Ex:Cals xml
<Table Id="ch03table1">
    <Legend>
        <Legendnum>Table 3</Legendnum>

        <Legendtext>
            <Smalltext>
            <br/>
            <Emphasis Type="Bold">Antidepressants</Emphasis>
            </Smalltext>
        </Legendtext>
    </Legend>
    <Tgroup Cols="3" Colsep="0" Rowsep="0" Align="LEFT">
    <Colspec Colnum="1" Colname="c1" Colwidth="200"/>
    <Colspec Colnum="2" Colname="c2" Colwidth="150"/>
    <Colspec Colnum="3" Colname="c3" Colwidth="150"/>
    <Thead>
        <Row Rowsep="1">
            <Entry Valign="BOTTOM" Align="LEFT">
                <Smalltext>
                <Emphasis Type="Italic">Type of antidepressant</Emphasis>
                </Smalltext> </Entry>
            <Entry Valign="BOTTOM">
                <Smalltext>
                <Emphasis Type="Italic">Generic name</Emphasis> </Smalltext>
            </Entry>
            <Entry Valign="BOTTOM">
                <Smalltext>
                <Emphasis Type="Italic">Usual brand name</Emphasis> </Smalltext>
            </Entry>
        </Row>
    </Thead> <Tbody>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Selective serotonin reuptake inhibitors (SSRIs)</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>citalopram<br/>escitalopram<br/>fluoxetine<br/>fluvoxamine<br/>paroxetine<br/>sertraline</Smalltext> </Entry>
            <Entry Valign="TOP"> <Smalltext>Celexa<br/>Lexapro<br/>Prozac<br/>Luvox<br/>Paxil<br/>Zoloft</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Other #x201C;modern#x201D; antidepressants</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>bupropion<br/>duloxetine<br/>mirtazapine<br/>venlafaxine<br/></Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Wellbutrin<br/>Cymbalta<br/>Remeron<br/>Effexor</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Tricyclic antidepressants (TCAs)</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>amitriptyline<br/>clomipramine<br/>desipramine<br/>doxepin<br/>imipramine<br/>maprotiline<br/>nortriptyline<br/>protriptyline<br/>trimipramine</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Elavil<br/>Anafranil<br/>Norpramin<br/>Sinequan<br/>Tofranil<br/>Ludiomil<br/>Pamelor<br/>Vivactil<br/>Surmontil</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Monoamine oxidase inhibitors (MAOIs)*</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>isocarboxazid<br/>phenelzine<br/>tranylcypromine</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Marplan<br/>Nardil<br/>Parnate</Smalltext>
            </Entry>
        </Row>
    </Tbody>
    </Tgroup>
    <Tfoot>
        <Smalltext>*rarely prescribed for young people because of the strict dietary limitations that MAOIs require</Smalltext> </Tfoot>
</Table>

i want to convert the above xml into indesign-compliant xml.I want xslt for that.

Ex:Indesign-Compliant XML

<Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:tcols="4" aid:trows="3">
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130" aid:cstyle="italics">Table header 1</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="59">Table header 2</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table header 3</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table header 4</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">A</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">B
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">C
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">D
</Cell>
<!--<Cell aid:table="cell" aid:crows="1" aid:ccols="2">E straddles two columns</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">F
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">G
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">H
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">I
</Cell>
<Cell aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="130">J straddles two rows</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">K
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">L
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">M
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">N
</Cell>-->
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 1</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="59">Table footer 2</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 3</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 4</Cell>
</Table>

if i load the above indesign-compliant xml in Adobe InDesign CS2,it will get converted in a table format.

I want to convert the cals xml into indesign-compliant xml.

It is very very very urgent.Please help me.I have to submit tomorrow(June 2,2006)
 
Old December 16th, 2009, 03:48 PM
Registered User
 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by franklinclinton View Post
Friend,

If anybody knows how to convert cals table into indesign table using xsl please help me.

Ex:Cals xml
<Table Id="ch03table1">
    <Legend>
        <Legendnum>Table 3</Legendnum>

        <Legendtext>
            <Smalltext>
            <br/>
            <Emphasis Type="Bold">Antidepressants</Emphasis>
            </Smalltext>
        </Legendtext>
    </Legend>
    <Tgroup Cols="3" Colsep="0" Rowsep="0" Align="LEFT">
    <Colspec Colnum="1" Colname="c1" Colwidth="200"/>
    <Colspec Colnum="2" Colname="c2" Colwidth="150"/>
    <Colspec Colnum="3" Colname="c3" Colwidth="150"/>
    <Thead>
        <Row Rowsep="1">
            <Entry Valign="BOTTOM" Align="LEFT">
                <Smalltext>
                <Emphasis Type="Italic">Type of antidepressant</Emphasis>
                </Smalltext> </Entry>
            <Entry Valign="BOTTOM">
                <Smalltext>
                <Emphasis Type="Italic">Generic name</Emphasis> </Smalltext>
            </Entry>
            <Entry Valign="BOTTOM">
                <Smalltext>
                <Emphasis Type="Italic">Usual brand name</Emphasis> </Smalltext>
            </Entry>
        </Row>
    </Thead> <Tbody>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Selective serotonin reuptake inhibitors (SSRIs)</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>citalopram<br/>escitalopram<br/>fluoxetine<br/>fluvoxamine<br/>paroxetine<br/>sertraline</Smalltext> </Entry>
            <Entry Valign="TOP"> <Smalltext>Celexa<br/>Lexapro<br/>Prozac<br/>Luvox<br/>Paxil<br/>Zoloft</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Other #x201C;modern#x201D; antidepressants</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>bupropion<br/>duloxetine<br/>mirtazapine<br/>venlafaxine<br/></Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Wellbutrin<br/>Cymbalta<br/>Remeron<br/>Effexor</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Tricyclic antidepressants (TCAs)</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>amitriptyline<br/>clomipramine<br/>desipramine<br/>doxepin<br/>imipramine<br/>maprotiline<br/>nortriptyline<br/>protriptyline<br/>trimipramine</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Elavil<br/>Anafranil<br/>Norpramin<br/>Sinequan<br/>Tofranil<br/>Ludiomil<br/>Pamelor<br/>Vivactil<br/>Surmontil</Smalltext>
            </Entry>
        </Row>
        <Row>
            <Entry Valign="TOP">
                <Smalltext>Monoamine oxidase inhibitors (MAOIs)*</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>isocarboxazid<br/>phenelzine<br/>tranylcypromine</Smalltext>
            </Entry>
            <Entry Valign="TOP"> <Smalltext>Marplan<br/>Nardil<br/>Parnate</Smalltext>
            </Entry>
        </Row>
    </Tbody>
    </Tgroup>
    <Tfoot>
        <Smalltext>*rarely prescribed for young people because of the strict dietary limitations that MAOIs require</Smalltext> </Tfoot>
</Table>

i want to convert the above xml into indesign-compliant xml.I want xslt for that.

Ex:Indesign-Compliant XML

<Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:tcols="4" aid:trows="3">
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130" aid:cstyle="italics">Table header 1</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="59">Table header 2</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table header 3</Cell>
<Cell aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table header 4</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">A</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">B
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">C
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">D
</Cell>
<!--<Cell aid:table="cell" aid:crows="1" aid:ccols="2">E straddles two columns</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">F
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">G
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">H
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">I
</Cell>
<Cell aid:table="cell" aid:crows="2" aid:ccols="1" aid:ccolwidth="130">J straddles two rows</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">K
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">L
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="59">M
</Cell>
<Cell aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="130">N
</Cell>-->
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 1</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="59">Table footer 2</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 3</Cell>
<Cell aid:table="cell" aid:tfooter="" aid:crows="1" aid:ccols="1"
aid:ccolwidth="130">Table footer 4</Cell>
</Table>

if i load the above indesign-compliant xml in Adobe InDesign CS2,it will get converted in a table format.

I want to convert the cals xml into indesign-compliant xml.

It is very very very urgent.Please help me.I have to submit tomorrow(June 2,2006)
I suppose the reason no one has answered your post is simply that InDesign supports CALS tables. If you just import the CALS table, and drag that from the Structure Pane of InDesign to the page, ID automatically converts it to an InDesign table. To verify that, simply export without checking the export CALS table option, and you will get an InDesign table.





Similar Threads
Thread Thread Starter Forum Replies Last Post
cals tables strurcure (XML) to indesign using vb mkarthic XSLT 3 April 16th, 2008 02:01 AM
XSL table to HTML ayamas XSLT 10 September 11th, 2006 06:45 AM
xsl formatting table cristtiah XSLT 3 May 18th, 2006 01:20 PM
URGENT multilayed table using one attribute ashcarrot XSLT 3 September 21st, 2004 04:53 AM
size of table (type table is table of number) MikoMax Oracle 1 November 19th, 2003 03:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.