XSL-FO for rendering and xml file as it is.

View: New views
2 Messages — Rating Filter:   Alert me  

XSL-FO for rendering and xml file as it is.

by franklini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I have a unique problem and I have searched the forum for a solution but can't seem to see any.

I need to write an XSL-FO file that can output the xml it is quering as it is. so basically this xsl-fo file can be used to create a pdf file displaying the xml file that it is transforming.

for example;  if I had an xml file such as below;

<?xml version="1.0" encoding="UTF-8"?>
<Class>
   <Order Name="TINAMIFORMES">
        <Family Name="TINAMIDAE">
            <Species Scientific_Name="Tinamus major">  Great Tinamou.</Species>
            <Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
            <Species Scientific_Name="Crypturellus soui">Little Tinamou.</Species>
            <Species Scientific_Name="Crypturellus cinnamomeus">Thicket Tinamou.</Species>
            <Species Scientific_Name="Crypturellus boucardi">Slaty-breasted Tinamou.</Species>
            <Species Scientific_Name="Crypturellus kerriae">Choco Tinamou.</Species>
        </Family>
    </Order>
    <Order Name="GAVIIFORMES">
        <Family Name="GAVIIDAE">
            <Species Scientific_Name="Gavia stellata">Red-throated Loon.</Species>
            <Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
            <Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
            <Species Scientific_Name="Gavia immer">Common Loon.</Species>
            <Species Scientific_Name="Gavia adamsii">Yellow-billed Loon.</Species>
        </Family>
    </Order>
</Class>


i can use this XSL-FO file, to generate a pdf which will contain the above xml out. so the pdf will contain the following;

<?xml version="1.0" encoding="UTF-8"?>
<Class>
   <Order Name="TINAMIFORMES">
        <Family Name="TINAMIDAE">
            <Species Scientific_Name="Tinamus major">  Great Tinamou.</Species>
            <Species Scientific_Name="Nothocercus">Highland Tinamou.</Species>
            <Species Scientific_Name="Crypturellus soui">Little Tinamou.</Species>
            <Species Scientific_Name="Crypturellus cinnamomeus">Thicket Tinamou.</Species>
            <Species Scientific_Name="Crypturellus boucardi">Slaty-breasted Tinamou.</Species>
            <Species Scientific_Name="Crypturellus kerriae">Choco Tinamou.</Species>
        </Family>
    </Order>
    <Order Name="GAVIIFORMES">
        <Family Name="GAVIIDAE">
            <Species Scientific_Name="Gavia stellata">Red-throated Loon.</Species>
            <Species Scientific_Name="Gavia arctica">Arctic Loon.</Species>
            <Species Scientific_Name="Gavia pacifica">Pacific Loon.</Species>
            <Species Scientific_Name="Gavia immer">Common Loon.</Species>
            <Species Scientific_Name="Gavia adamsii">Yellow-billed Loon.</Species>
        </Family>
    </Order>
</Class>


which is exactly the same xml content.

I would really appreciate any help.


Re: XSL-FO for rendering and xml file as it is.

by Tony Graham-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jul 06 2009 15:32:11 +0100, franklini@... wrote:
...
> I need to write an XSL-FO file that can output the xml it is quering as it
> is. so basically this xsl-fo file can be used to create a pdf file
> displaying the xml file that it is transforming.

Are you using XSLT 1.0 or XSLT 2.0 to generate the FO that you feed to
the XSL formatter?

Regards,


Tony Graham                         Tony.Graham@...
Director                                  W3C XSL FO SG Invited Expert
Menteith Consulting Ltd                               XML Guild member
XML, XSL and XSLT consulting, programming and training
Registered Office: 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
Registered in Ireland - No. 428599   http://www.menteithconsulting.com
  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
xmlroff XSL Formatter                               http://xmlroff.org
xslide Emacs mode                  http://www.menteith.com/wiki/xslide
Unicode: A Primer                               urn:isbn:0-7645-4625-2