473,909 Members | 4,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsl landscape printing

Hi I am tryign to use this to print my table in landscape by default.
i am new at the xsl and need some assistance. when i try to use the
following i get the error:

Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
Variable or parameter 'printingtype' cannot have both a select
attribute and non-empty content.

code:

<xsl:param name="printingt ype" select="'landsc ape'">
<xsl:variable name="pageheigh t">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">21</xsl:when>
<xsl:otherwise> 29.7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagewidth ">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">29.7</xsl:when>
<xsl:otherwise> 21</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Any guidance would be appreciated.

thanks
shen

Feb 19 '07 #1
6 3914
sh*****@gmail.c om wrote:
Variable or parameter 'printingtype' cannot have both a select
attribute and non-empty content.

<xsl:param name="printingt ype" select="'landsc ape'">
<xsl:variable name="pageheigh t">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">21</xsl:when>
<xsl:otherwise> 29.7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagewidth ">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">29.7</xsl:when>
<xsl:otherwise> 21</xsl:otherwise>
</xsl:choose>
</xsl:variable>
The message means exactly what it says. You can set the value of the
param *EITHER* by using an XPath expression in the select attribute,
*OR* by providing a contained XSLT tree that computes the value, and
since you have not terminated the xsl:param before you start defining
the variables you are trying to do both.

What are you actually trying to do?
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 19 '07 #2
On Feb 19, 8:22 pm, shei...@gmail.c om wrote:
<xsl:param name="printingt ype" select="'landsc ape'">
<xsl:variable name="pageheigh t">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">21</xsl:when>
<xsl:otherwise> 29.7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagewidth ">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">29.7</xsl:when>
<xsl:otherwise> 21</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Variable or parameter 'printingtype' cannot have both a
select attribute and non-empty content.
The error message is about as clear as it could possibly
get. xsl:param element cannot have both non-empty content
and a select attribute. Either your transformation is not
well-formed XML (in that case use / to indicate empty
content for xsl:param element) or you're trying to do
something that cannot be done.

Since you seem to expect $printingtype to be already
defined in those xsl:variable elements, I'd bet you simply
forgot that slash in xsl:param.

--
roy axenov

Feb 19 '07 #3
Well... I have a xsl file that i want to print, but i want my client
to be able to print it in landscape mode and not have to go set it
himself. Because this table that is being printed does not fit when
prinitng in portrait...

So i should put the </xsl:paramsomewh ere else?
where do i terminate it? i thought i just end at the end of the xsl
file (??)

sorry about my ignorance..i'm just tryign to get this to work with a
fiel someone else made..and yet i hardly even know how xsl works...
is printing i landscape even doable??

thanks
shen
On Feb 19, 1:31 pm, Joe Kesselman <keshlam-nos...@comcast. netwrote:
shei...@gmail.c om wrote:
Variable or parameter 'printingtype' cannot have both a select
attribute and non-empty content.
<xsl:param name="printingt ype" select="'landsc ape'">
<xsl:variable name="pageheigh t">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">21</xsl:when>
<xsl:otherwise> 29.7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagewidth ">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">29.7</xsl:when>
<xsl:otherwise> 21</xsl:otherwise>
</xsl:choose>
</xsl:variable>

The message means exactly what it says. You can set the value of the
param *EITHER* by using an XPath expression in the select attribute,
*OR* by providing a contained XSLT tree that computes the value, and
since you have not terminated the xsl:param before you start defining
the variables you are trying to do both.

What are you actually trying to do?

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry- Hide quoted text -

- Show quoted text -

Feb 19 '07 #4
Where did i forget the slash?
Which one is the empty element?
does printingtype not exist??

thanks
shen

On Feb 19, 1:35 pm, "roy axenov" <r_axe...@mail. ruwrote:
On Feb 19, 8:22 pm, shei...@gmail.c om wrote:


<xsl:param name="printingt ype" select="'landsc ape'">
<xsl:variable name="pageheigh t">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">21</xsl:when>
<xsl:otherwise> 29.7</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pagewidth ">
<xsl:choose>
<xsl:when
test="$printing type='landscape '">29.7</xsl:when>
<xsl:otherwise> 21</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Variable or parameter 'printingtype' cannot have both a
select attribute and non-empty content.

The error message is about as clear as it could possibly
get. xsl:param element cannot have both non-empty content
and a select attribute. Either your transformation is not
well-formed XML (in that case use / to indicate empty
content for xsl:param element) or you're trying to do
something that cannot be done.

Since you seem to expect $printingtype to be already
defined in those xsl:variable elements, I'd bet you simply
forgot that slash in xsl:param.

--
roy axenov- Hide quoted text -

- Show quoted text -

Feb 19 '07 #5
sh*****@gmail.c om wrote:
Where did i forget the slash?
It looks like you intended

<xsl:param name="printingt ype" select="'landsc ape'"/>

Note the /to terminate the element. Or, equivalently,

<xsl:param name="printingt ype" select="'landsc ape'"></xsl:param>

XSLT/XML elements, unlike HTML/SGML elements, *MUST* be properly terminated.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Feb 19 '07 #6
Ok perfect, so i did this and no longer get the error...but i still
can not get my page to print in landscape mode...
how woudl i do this?

i've tried everythign i know how. I even tried rotating the page 90
degrees...but then only my title rotates and the table stays the way
it is. Just to give you a better idea: the database used is access,
and an xml file and then using the xsl file we can view teh content in
the db. which is what i am tryign to print in landscape..

thanks..
shen
On Feb 19, 3:23 pm, Joe Kesselman <keshlam-nos...@comcast. netwrote:
shei...@gmail.c om wrote:
Where did i forget the slash?

It looks like you intended

<xsl:param name="printingt ype" select="'landsc ape'"/>

Note the /to terminate the element. Or, equivalently,

<xsl:param name="printingt ype" select="'landsc ape'"></xsl:param>

XSLT/XML elements, unlike HTML/SGML elements, *MUST* be properly terminated.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry

Feb 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4585
by: gilga123 | last post by:
Trying & trying ad infinitum to print page in landscape mode from Java program - orientation is correct landscape but printing width will NOT go to landscape - always prints in portrait mode width - how to get width out to landscape?????? Graphics2D g2d = (Graphics2D)g; //Paper paper = new Paper(); Paper paper = pageFormat.getPaper(); //default portrait width=468 hi=648 x=72 y=72
0
1993
by: gilga123 | last post by:
Trying & trying ad infinitum to print page in landscape mode from Java program - orientation is correct landscape but printing width will NOT go to landscape - always prints in portrait mode width - how to get width out to landscape?????? Graphics2D g2d = (Graphics2D)g; //Paper paper = new Paper(); Paper paper = pageFormat.getPaper(); //default portrait width=468 hi=648 x=72 y=72
3
10629
by: MarcJ | last post by:
Hello, I can't seem to get printing to landscape working. Here is some of the code I've tried. '--------------------------------------------------------------------------------- Dim myDocument As PrintDocument = PreparePrintDocument() Dim myPaperSize As PaperSize Dim iSizeCount As Integer Dim dlgPrint As New PrintDialog
2
1324
by: Andrei Gavra via .NET 247 | last post by:
Hello. I have a problem when I choose landscape format forprinting. The page width and height are remaining the same asfor portrait format. In portrait format everything is ok and I'mposition my text in page based on page width, height and papermargins. I also want to say that the margins are different whenI choose landscape, but not the page size. I would appreciate very much any answer. -------------------------------- From: Andrei Gavra...
1
2012
by: Bill Burke | last post by:
I have created a "Certificate of Completion" in C# .net and have a typical problem of not being able to print this in landscape mode without user intervention. The certificate is a web user control as it gets information to complete the certificate (userName, date, course) from the SQl database. 2 Questions: 1. Can I rotate the user control somehow 90 degress and place it in a hidden frame? and print it in protrait mode? 2. Does...
5
6879
by: cpopham | last post by:
I tried posting earlier and it never showed up.. I have a simple program to print a text file. I need to know how to change the page settings to landscape if it is not already in ladnscape mode. I do not want to use a dialog to do it and this appears the only way you can do it. I just need it to spit out the print in landscape orientation. Why is this so hard to do for something that should be easy.
1
2022
by: lord.zoltar | last post by:
Hi, I'm trying to print a text report from an application. It works fine, except in landscape mode, which it seems to ignore. I have a function that handles the PrintPage even for the PrintDocument, and I even tried forcing it to print in landscape mode by adding: ev.PageSettings.Landscape = True (where ev is the parameter: ByVal ev As System.Drawing.Printing.PrintPageEventArgs) I also tried printDoc.DefaultPageSettings.Landscape = True...
2
8484
by: FireStarter | last post by:
I am apparently unable to print landscape... maybe I'm doing something wrong here. I am adding a printDocument to a form. The form also has a textbox containing the text that I want to print and a button that triggers the printing. All properties of all objects are left intact for simplicity's sake. Code on the form:
6
5600
by: farukcse | last post by:
Dear sir, I have trouble with printing page with landscape. I am using java script to print the page. as well as I have set css file to print landscape but it is not working. I have used these line in css files, <style type="text/css"> <!-- @page { size: landscape; } -->
0
10035
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
11046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7248
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3357
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.