Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XSL Style Sheet Header/Footer Issues

Posted on 2006-11-01
8
Medium Priority
?
726 Views
Last Modified: 2008-02-01
Hi,

I am currently using xsl stylesheets to display my xml results.

However I have an issue.

I would like to be able to have a header/footer at the top of each page.......my issue is obviously how do I tell when a page breaks onto the next....the information on the page is dynamic so I cannot plan for a page break.

Are there any work arounds for this or can someone suggest possible alternatives for displaying my documents?? Bearing in mind I need to print these docs.........if I have not made myself clear or you require more info to come up with a valid answer please ask away!!

Thanks in advance.
0
Comment
Question by:scm0sml
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Vivek Thangaswamy
ID: 17848539
Hi

We can get the XML documents initial nodes (Top order) and in the header we can place the content whatever we want.

Sample Code:

<xsl:if test="position() = '1'">
      <font face="Verdana" size="2" color="red">
                   <p><b>Buy one Ticket Get One Ticket FREE</b></p>
      <br/>
              </font>
</xsl:if>

For Last

 <xsl:if test="position() = last()">
      Last figure title in chapter: <xsl:value-of select="."/>
  </xsl:if>

And can you explain you situation in more detail please.

More Ref:
http://www.xml.com/pub/a/2002/08/07/ducharme.html
http://www.dpawson.co.uk/xsl/sect2/N6099.html
http://sources.redhat.com/ml/xsl-list/2000-06/msg01049.html
0
 

Author Comment

by:scm0sml
ID: 17848566
Yeah the first and last nodes are not really what I'm after.

I'll have a row......that will contain information on say passenegers, flights, accomodation etc....which can obviously be of different sizes.

When displaying this information it is possible it will spill over onto a second or third page etc.

I am looking for a way by where i can detect this as I'd like to be able to have a repeating header and fotter on each page......like in word etc!!

bit clearer?
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17848632
Hi scm0sml,

How do you define a page?
Do you want the header and footer repeated when printing HTML pages?
Then I guess your best bet would be CSS

Are you setting up your print environment using XSL-FO?
There are some possibilities in XSL-FO that enable that

Can you tell us a bit more about your environment?

Cheers!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:scm0sml
ID: 17848677
my pages are html and xsl? and yeah i would want theheader/footer printing when pritning the html pages out.

You'l have to excuse me...im just inheriting the docs from a colleague who has left.......some of the jargon u have used about the environment has got me.... :(
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 17848809
scm0sml,

XSL-FO is XSL Formatting Objects, what you could use to produce print or PDF from XML
Usual steps use XSL to merge XML into an XSL-FO then use rendering software such as AntennaHouse or FOP to generate PDF from the XSL-FO files.
This is for when you want some more advanced page layout techniques
XSL-FO would help you with headers and footers but it requires a new technology introduced, so maybe not the best bet here

If you are OK with HTML pages printed there are some things you can do with CSS
CSS or Cascading StyleSheets is a language to express layout properties and attach them to HTML pages
It influences how the HTML looks on screen, but there are some facilities to influence how pages are printed differently from how they would look in a browser.

Here is a brief outline from a page
You don't display header and footer on the screen
but you display it on the print version (using the @media selectivity)
you then have to absolutely position the headers and the footers

This is a bit tricky, requires some experimenting and you are propably better of in the CSS TA, I am not that much of a CSS expert

<html>
<head>
<style>
    @media screen, print
    {
      .header {display: none;}
      .footer {display: none;}
    }
    @media print
    {
      .header {put some properties here}
      .footer {put some properties here}
    }
</style>
</head>
<body>

<div class="header">
...put header html here...
</div>
<div class="footer">
...put footer html here...
</div>

</body>
</html>
0
 

Author Comment

by:scm0sml
ID: 17848913
looks like there could be potential there!!

Do i get this transferred over to css or open a new thread?
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17849056
maybe it is easier if you just create a 20 points, pointer question in the CSS TA
one you can delete after you awarded points here
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17849063
sorry, just saw you already awarded, thanks
ignore my last comment
good luck @ CSS TA
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question