• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

To display XSL-FO content on a browser

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm new to XML technology. i tried displaying content written inside an XSL-FO file & i could very well see the result. But all the while i couldnt see the effect of line 1 on content of line 2.


I have the below file saved as Demo.fo
_______________________________________
<?xml version="1.0" encoding="ISO-8859-1"?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<fo:region-body margin="10cm"/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="100pt" line-height="50pt"> line--- 1
Welcome to XML FO line --- 2
</fo:block>
</fo:flow>
</fo:page-sequence>

</fo:root>
---------------------------------------------------------
The XML file to display the content inside the Demo.fo file

<?xml version="1.0"?>

<?xml:stylesheet href="Demo.fo" type="text/xsl"?>

<menu>
<lunch>
<rice>Fried</rice>
<curry>Dal</curry>
</lunch>
</menu>
___________________________________________________________

Regards,
Khateeb.
 
khateeb syed
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Continuing with my question above:
While when i try XSLT to display XML data, i dont see the effect again of the line 1.
i.e "Fried" is getting printed but the font-size & line-height attribute are not having the formatting effect on the xml result.
____________________________________________________________________________
Demo.xsl
--------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="html" version="1.0" />
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="only">
<fo:region-body />
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only">
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="100pt" line-height="50pt"> ----1
<xsl:value-of select="menu/lunch/rice"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------------
Demo.xml
--------
<?xml version="1.0"?>

<?xml:stylesheet href="Demo.xsl" type="text/xsl"?>

<menu>

<lunch>
<rice>Fried</rice>
<curry>Dal</curry>
</lunch>

<dinner>
<rice>Plain</rice>
<curry>Sambar</curry>
</dinner>

</menu>
___________________________________________________________________________

Thanks & regards,
Khateeb.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic