Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 4th, 2008, 05:02 PM
Authorized User
 
Join Date: Dec 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I declared LotsofSpaces as below and it seems not working
    <xsl:variable name="lotsOfSpaces">
        <text> <text/>



OR JUST THE LINE TYPED WITH SPACE BAR, STILL NO LUCK

</xsl:variable>


I used striling-length, it's reading 0. i guess i need to pass as string or something. any help is appreciated
 
Old June 4th, 2008, 05:29 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>I declared LotsofSpaces as below and it seems not working
    <xsl:variable name="lotsOfSpaces">
        <text> <text/>
    </xsl:variable>

Whitespace text nodes in a stylesheet are stripped out. You want

<xsl:variable name="lotsOfSpaces" select="' ... '"/>

Also, don't do

<xsl:with-param name="x">
  <xsl:value-of select="y"/>
</xsl:with-param>

XSLT doesn't have to be as verbose as that! Instead write

<xsl:with-param name="x" select="y"/>

It's a lot faster as well.


Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 4th, 2008, 05:46 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

> Is there anyway we can pass one more param as format type

Yes of course. You can pass any parameters that you like. Or you can have multiple functions/templates for the different types/formats.

But I'm getting the impression that you're thinking aloud about your program design: if you have a specific question or problem about XSLT, please ask it. We're not here to design or write your code for you.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 4th, 2008, 05:53 PM
Authorized User
 
Join Date: Dec 2007
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Np, no designes involved. I tried to pass one more param for format as well, i am still getting errors. That's just to make it generic template. It just popped up in my mind, but nothing more.

i owe you a big one, not sure how can i payback. But it really helped me to output something i would like to see. Thanks for your help

I promise will continue only with the problems and not the designs. Anyways i am not that kind of expert in my opinion, As you can see my idiot coding above

Once again thanks a bunch, will come back later with more questions, not that i am not working to learn at all. I am breaking my head all the time.

 
Old June 5th, 2008, 02:13 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>i am still getting errors

Then PLEASE, show us what you did and show us the errors. That's a much better way of making progress than to ask us to solve the problem from first principles.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Concat autonumber field with a constant character sathija Access 5 July 6th, 2007 07:25 AM
add a new row when cursor comes to the last field bullsb Classic ASP Professional 8 March 11th, 2007 04:11 PM
add a new row when cursor comes to the last field bullsb Javascript How-To 2 February 26th, 2007 11:26 PM
add a custom field to a mail item [email protected] Visual Studio 2005 0 May 15th, 2006 10:25 AM
Add field to top of recordset vertigo Beginning VB 6 6 July 14th, 2004 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.