No it should work as written.

Because when the xslt processor is the template that matches on tubby,
its context is its tubby node.

So you just need to select the value of the name child  <xsl: value-of
select="name"/>


-----Original Message-----
From: Manuel Reyes [mailto:[EMAIL PROTECTED] 
Sent: 20 November, 2003 13:35
To: [EMAIL PROTECTED]
Subject: RE: Merging XML and FO files


That's an interesting way of doing this, and will probably come in handy
for the documents I need to produce.  Thanks a lot.

To get the code to work I needed to change this slightly:

<xsl:template match="repeater">
<xsl:apply-templates select="tubby"/>
</xsl:template>
                                        
<xsl:template match="tubby">
<fo:block>
Name : <xsl:value-of select="repeater/tubby/name"/> / Colour :
<xsl:value-of select="repeater/tubby/colour"/> 
</fo:block>
</xsl:template>

What I did find is that this only prints the first tubby value found
inside data/repeater.  Is there a way to get all the values (I did
notice that I could use for-each inside the xsl:template to do this)

Regards
Manuel

-----Original Message-----
From: Chris Adams [mailto:[EMAIL PROTECTED] 
Sent: 20 November 2003 12:11
To: [EMAIL PROTECTED]
Subject: RE: Merging XML and FO files

You could have also done it like

<xsl:template match="repeater">
        <xsl:apply-templates select="tubby"/>
</xsl:template>

<xsl:template match="tubby">
        <fo:block>
                Name : <xsl:value-of select="name"/> / Colour :
<xsl:value-of select="colour"/> 
        </fo:block>
</xsl:template>

-----Original Message-----
From: Manuel Reyes [mailto:[EMAIL PROTECTED] 
Sent: 20 November, 2003 12:08
To: [EMAIL PROTECTED]
Subject: RE: Merging XML and FO files


For anybody who may be searching this list in trying to find the answers
to the questions I am asking, this is how it is done :

XML File :
<repeater>
<tubby>
<name>Dipsy</name> 
<colour>Green</colour> 
</tubby>
<tubby>
<name>Laalaa</name> 
<colour>Red</colour> 
</tubby>
<tubby>
<name>Po</name> 
<colour>Purple</colour> 
</tubby>
</repeater>

XSL File :
<xsl:for-each select="repeater/tubby">
<fo:block>
Name : <xsl:value-of select="name"/> / Colour : <xsl:value-of
select="colour"/> 
</fo:block> 
</xsl:for-each>

This will generate the following pdf :
Name : Dipsy / Colour : Green
Name : Laalaa / Colour : Red
Name : Po / Colour : Purple

Once again thanks to all those who replied

-----Original Message-----
From: Manuel Reyes 
Sent: 20 November 2003 11:36
To: [EMAIL PROTECTED]
Subject: RE: Merging XML and FO files

That's great, thanks a lot for those files they more or less cover
everything I needed to know.

One small thing though, due to the nature of the documents I am creating
the ability to create "intelligent" tables is essential.  As an example
I have a table called "foos" in which all my foos are listed, the data
being held in a database.  Now as the total of foos I have increases (or
decreases), I will need to regenerate the table (PDF) and this table
needs to look professional.  So I need something that will allow me to
create dynamic tables that will only contain the amount of rows I need
to add the details of the foos in the database.

I had a look around on http://www-106.ibm.com/developerworks/xml/ I
found some information about basic merging, but nothing on dynamic
merges. 

-----Original Message-----
From: Manjush G. Menon [mailto:[EMAIL PROTECTED] 
Sent: 20 November 2003 06:45
To: [EMAIL PROTECTED]
Subject: Fw: Merging XML and FO files

Iam sorry the about  the missed attachment.
--

Manjush G Menon                            /"\    ASCII Ribbon Campaign
[EMAIL PROTECTED]         \ /    Respect for open standards
FSC Consultant                                 X     No HTML/RTF in
email
FSC SGB Governing body member   / \    No M$ Word docs in email
----- Original Message -----
From: "Manjush G. Menon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 20, 2003 9:18 AM
Subject: Re: Merging XML and FO files


>
> Hi,
>
> Iam using FOP in a similar scenario. As  Charles said, its XSLT that
you need
>
> Please try out the XML/XSL:FO attached.
>
> --
> Thanks
> Manjush
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 19, 2003 11:59 PM
> Subject: RE: Merging XML and FO files
>
>
> > The instructions at this link
> (http://xml.apache.org/fop/running.html#standalone-start) seem pretty
clear to
> me. I think the piece you are missing is an XSLT stylesheet to convert
your
XML
> to XSL-FO.
> > --
> > Charles Knell
> > [EMAIL PROTECTED] - email
> >
> >
> >
> > -----Original Message-----
> > From:     Manuel Reyes <[EMAIL PROTECTED]>
> > Sent:     Wed, 19 Nov 2003 17:51:51 -0000
> > To:       <[EMAIL PROTECTED]>
> > Subject:  Merging XML and FO files
> >
> > Hello all,
> >
> > I am currently working on an application that will pull data values
from a
> database and place these into an XML file.  The resulting XML file is
then to
be
> merged with an FO template file and the result would be used to
generate a PDF
> >
> > The reason for the mail, is that I wanted to get opinions on the
best way to
> go about doing this.  In my minds eye I have the following idea :
> >
> > XML File (containing data values) :
> > <merge_test_report>
> > <field_values>
> > <value id="@value1">abc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------- -
        Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be the
views of Reuters Ltd.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-----------------------------------------------------------------
        Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to