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

Re: transforming lists

Subject: Re: transforming lists
From: "sascha" <sascha@xxxxxxxxxx>
Date: Mon, 29 Jul 2002 16:35:08 +0200
dxl richtext
Well I think this might be right somehow, but i don't get it to work.

There is a lot of things in between my "par"-template- not only lists
It's not sure that there is a "run" child always, i believe.
How do i get it to work more universally?

my par template look like this at the moment- i need a list "add-on" here
somehow:

 <xsl:template match="dxl:par">
  <fo:block>


   <xsl:if test="@def">
    <xsl:variable name="pabid" select="@def"/>


    <!-- referenz id //-->
    <xsl:choose>


     <xsl:when
test="contains(ancestor::dxl:richtext//dxl:pardef[@id=$pabid]/@align,'left')
">
      <xsl:attribute name="text-align">start</xsl:attribute>
     </xsl:when>.....

     <xsl:when
test="ancestor::dxl:richtext//dxl:pardef[@id=$pabid]/@leftmargin">
      <xsl:attribute name="margin-left"><xsl:value-of
select="ancestor::dxl:richtext//dxl:pardef[@id=$pabid]/@leftmargin"/></xsl:a
ttribute>
     </xsl:when>....

    </xsl:choose>
   </xsl:if>


   <xsl:apply-templates/>
  </fo:block>
 </xsl:template>

- THE XML-INPUT AGAIN:

 <pardef id="3" leftmargin="1.2500in" list="bullet"/>
    <par def="3">
     <run>
      <font color="blue" name="Arial" style="bold"/>liste 1</run>
    </par>
    <par>
     <run>
      <font color="blue" name="Arial" style="bold"/>listenpunkt2</run>
    </par>
    <par>
     <run>
      <font color="blue" name="Arial" style="bold"/>listenpunkt3</run>
    </par>



sascha



----- Original Message -----
From: <Jarno.Elovirta@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, July 24, 2002 3:14 PM
Subject: RE:  transforming lists


> Hi,
>
> > This is what i get from a Lotus Notes XML Export, sorry for that ;-)
> > i dont have any influence.
> >
> > the "def" attribute is only the reference to the paragraph definition
> > <pardef>, where it says that (it should be like that)
> > <par>'s with the def=9 are list items and have a bullet
> > shown... BUT not all
> > the listitems have their def=9 attribute, you see? That's why
> > i am asking if
> > there is any way to reconstruct that?
> > Maybe it helps that the next following element is a <pardef id="10">?!
> >
> >
> > The output should be like
> >
> > * ITEM 1 liste
> > * ITEM 2 liste
> > * ITEM 3 liste
> >
> > you know? just like an HTML <ul><li>....but within my PDF Output.
>
> So was this what you were after
>
> <xsl:key name="label" match="pardef" use="@id" />
> <xsl:key name="def" match="par[not(@def)]"
use="preceding-sibling::par[@def][1]/@def" />
>
> <xsl:template match="/">
>   <fo:root>
>     <fo:layout-master-set>
>        <fo:simple-page-master master-name="simple" page-height="29.7cm"
page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2.5cm"
margin-right="2.5cm">
>           <fo:region-body margin-top="0cm" />
>           <fo:region-before extent="2cm" />
>           <fo:region-after extent="1.5cm" />
>        </fo:simple-page-master>
>     </fo:layout-master-set>
>     <fo:page-sequence master-reference="simple">
>       <fo:flow flow-name="xsl-region-body">
>         <xsl:apply-templates select="document/par[@def]" />
>       </fo:flow>
>     </fo:page-sequence>
>   </fo:root>
> </xsl:template>
>
> <xsl:template match="par">
>   <xsl:variable name="def" select="@def" />
>
>   <fo:list-block>
>     <xsl:for-each select=". | key('def', $def)">
>       <fo:list-item>
>         <fo:list-item-label end-indent="label-end()">
>           <fo:block>
>             <fo:inline>
>               <xsl:call-template name="label">
>                 <xsl:with-param name="def" select="$def" />
>               </xsl:call-template>
>             </fo:inline>
>           </fo:block>
>         </fo:list-item-label>
>         <fo:list-item-body start-indent="body-start()">
>           <fo:block>
>             <xsl:apply-templates select="run" />
>           </fo:block>
>         </fo:list-item-body>
>       </fo:list-item>
>     </xsl:for-each>
>   </fo:list-block>
> </xsl:template>
>
> <xsl:template name="label">
>   <xsl:param name="def"/>
>
>   <xsl:choose>
>     <xsl:when test="key('label', $def)/@list = 'bullet'">*</xsl:when>
>     <xsl:otherwise>-</xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
>
> Cheers,
>
> Jarno
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.