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 3rd, 2009, 03:54 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default Issue using "saxon:line-number()" in command line XSL with Saxon9.jar

Hi All,

Following is the XSL used in two different platform.

1. Oxygen XML with Saxon-B 9.1.0.3
2. Command line with Saxon9.jar using "Java 1.6.0_13"


XSL

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:std="http://xml.com/xslt-extensions"
xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
xmlns:saxon="http://saxon.sf.net/">

...
...
<xsl:value-of select="position()"/> <xsl:text>/ #:
</xsl:text> <xsl:value-of select="saxon:line-number()"/>
...
...
</xsl:stylesheet>

Outputs

Using option 1.
679/ #: 6809

Using option 2.
679/ #:-1

Please guide how to fix the OPTION 2.

Any help would be great
__________________
Thanks,
Rocxy.
 
Old June 3rd, 2009, 04:06 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

This should really be asked on the Saxon mailing list but...

For the saxon:line-number() xpath function to work you need to enable the 'line numbering' feature in saxon by passing the '-l' parameter to saxon.

I suspect Oxygen is doing this automatically as a matter of course, but your command line version must not be.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
The Following User Says Thank You to samjudson For This Useful Post:
ROCXY (June 3rd, 2009)
 
Old June 3rd, 2009, 04:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sam's right - use -l on the command line (that's letter ell).

Another point though - product-specific questions are best asked on a product-specific forum. For Saxon that's the saxon-help mailing list or forum at SourceForge (project name "saxon").
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
ROCXY (June 3rd, 2009)
 
Old June 3rd, 2009, 04:24 AM
Authorized User
 
Join Date: Dec 2005
Posts: 71
Thanks: 10
Thanked 0 Times in 0 Posts
Default

Dear Sam & Kay,

Thank you, it is working fine.

Sure, I will abide to above mentioned product-specific question to be posted in product-specific forum. Hence forth any query related to 'saxon' I will post on SF. Thanks for letting me know this.
__________________
Thanks,
Rocxy.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 "An attempt to attach an auto-named database for file.." Gredkins BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 4 May 28th, 2009 11:55 PM
Code not going as planned: "icicle" vs "savedinstancestate" joopthecat BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 May 3rd, 2009 03:09 PM
Chapter-5 on Intents:ContactPickerTester does not show the button "Pick a Contact" sunilm12 BOOK: Professional Android Application Development ISBN: 978-0-470-34471-2 3 April 15th, 2009 11:55 AM
How to download Code in "Professional Active Server Page 3.0 " book. renjith0 All Other Wrox Books 2 April 2nd, 2009 05:06 AM
Executing Saxon from de Command Line Tomi XSLT 2 December 13th, 2007 04:58 AM





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