xsl landscape printing

Discussion in 'XML' started by sheinaz@gmail.com, Feb 19, 2007.

  1. Guest

    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="printingtype" select="'landscape'">
    <xsl:variable name="pageheight">
    <xsl:choose>
    <xsl:when
    test="$printingtype='landscape'">21</xsl:when>
    <xsl:eek:therwise>29.7</xsl:eek:therwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="pagewidth">
    <xsl:choose>
    <xsl:when
    test="$printingtype='landscape'">29.7</xsl:when>
    <xsl:eek:therwise>21</xsl:eek:therwise>
    </xsl:choose>
    </xsl:variable>

    Any guidance would be appreciated.

    thanks
    shen
    , Feb 19, 2007
    #1
    1. Advertising

  2. wrote:
    > Variable or parameter 'printingtype' cannot have both a select
    > attribute and non-empty content.
    >
    > <xsl:param name="printingtype" select="'landscape'">
    > <xsl:variable name="pageheight">
    > <xsl:choose>
    > <xsl:when
    > test="$printingtype='landscape'">21</xsl:when>
    > <xsl:eek:therwise>29.7</xsl:eek:therwise>
    > </xsl:choose>
    > </xsl:variable>
    > <xsl:variable name="pagewidth">
    > <xsl:choose>
    > <xsl:when
    > test="$printingtype='landscape'">29.7</xsl:when>
    > <xsl:eek:therwise>21</xsl:eek:therwise>
    > </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
    Joe Kesselman, Feb 19, 2007
    #2
    1. Advertising

  3. roy axenov Guest

    On Feb 19, 8:22 pm, wrote:
    > <xsl:param name="printingtype" select="'landscape'">
    > <xsl:variable name="pageheight">
    > <xsl:choose>
    > <xsl:when
    > test="$printingtype='landscape'">21</xsl:when>
    > <xsl:eek:therwise>29.7</xsl:eek:therwise>
    > </xsl:choose>
    > </xsl:variable>
    > <xsl:variable name="pagewidth">
    > <xsl:choose>
    > <xsl:when
    > test="$printingtype='landscape'">29.7</xsl:when>
    > <xsl:eek:therwise>21</xsl:eek:therwise>
    > </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
    roy axenov, Feb 19, 2007
    #3
  4. Guest

    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:param> somewhere 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 <> wrote:
    > wrote:
    > > Variable or parameter 'printingtype' cannot have both a select
    > > attribute and non-empty content.

    >
    > > <xsl:param name="printingtype" select="'landscape'">
    > > <xsl:variable name="pageheight">
    > > <xsl:choose>
    > > <xsl:when
    > > test="$printingtype='landscape'">21</xsl:when>
    > > <xsl:eek:therwise>29.7</xsl:eek:therwise>
    > > </xsl:choose>
    > > </xsl:variable>
    > > <xsl:variable name="pagewidth">
    > > <xsl:choose>
    > > <xsl:when
    > > test="$printingtype='landscape'">29.7</xsl:when>
    > > <xsl:eek:therwise>21</xsl:eek:therwise>
    > > </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, 2007
    #4
  5. Guest

    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" <> wrote:
    > On Feb 19, 8:22 pm, wrote:
    >
    >
    >
    >
    >
    > > <xsl:param name="printingtype" select="'landscape'">
    > > <xsl:variable name="pageheight">
    > > <xsl:choose>
    > > <xsl:when
    > > test="$printingtype='landscape'">21</xsl:when>
    > > <xsl:eek:therwise>29.7</xsl:eek:therwise>
    > > </xsl:choose>
    > > </xsl:variable>
    > > <xsl:variable name="pagewidth">
    > > <xsl:choose>
    > > <xsl:when
    > > test="$printingtype='landscape'">29.7</xsl:when>
    > > <xsl:eek:therwise>21</xsl:eek:therwise>
    > > </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, 2007
    #5
  6. wrote:
    > Where did i forget the slash?


    It looks like you intended

    <xsl:param name="printingtype" select="'landscape'"/>

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

    <xsl:param name="printingtype" select="'landscape'"></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
    Joe Kesselman, Feb 19, 2007
    #6
  7. Guest

    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 <> wrote:
    > wrote:
    > > Where did i forget the slash?

    >
    > It looks like you intended
    >
    > <xsl:param name="printingtype" select="'landscape'"/>
    >
    > Note the /> to terminate the element. Or, equivalently,
    >
    > <xsl:param name="printingtype" select="'landscape'"></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, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric

    ASP.net and Printing Landscape

    Eric, May 31, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    8,853
    Tim McOwan
    May 31, 2005
  2. Replies:
    1
    Views:
    3,598
    A. Bolmarcich
    May 27, 2005
  3. Replies:
    2
    Views:
    1,488
  4. Pepito

    Printing in landscape

    Pepito, Oct 30, 2003, in forum: Javascript
    Replies:
    0
    Views:
    116
    Pepito
    Oct 30, 2003
  5. viki

    printing landscape

    viki, Jul 30, 2004, in forum: Javascript
    Replies:
    2
    Views:
    119
    Grant Wagner
    Jul 30, 2004
Loading...

Share This Page