Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 29th, 2008, 01:57 PM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default chap 19 : parse-gedcom.xsl

With oXygen XML Editor 9.2 on Mac, I tried from the xslt debugger with Saxon 9B to have parse-gedcom.xsl work with input kennedy.ged.

Before running the debugger, I had configured a parameter input = '/Users/jacquesfauquex/Downloads/ch19/kennedy.ged'

After running the debugger, the result window shows

/Users/jacquesfauquex/Downloads/ch19/kennedy.ged
Location: 1:0
Description: Content is not allowed in prolog.
URL:http://www.saxonica.com/documentatio....html#SXXP0003
E Content is not allowed in prolog. - 1:0
F Content is not allowed in prolog. - 1:0


... it looks like that xslt doesn't like to parse a text document instead of a xml document. Though, to parse text document is what the example wants to demostrate...

What do I do wrong?

Jacques
Reply With Quote
  #2 (permalink)  
Old May 29th, 2008, 02:35 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I guess you probably configured oxygen to treat kennedy.ged as the primary source document of the transformation. This won't work - the primary input must be XML if it exists at all. This stylesheet runs without any primary source document; it reads kennedy.ged as a secondary input file using the unparsed-text() function.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old May 29th, 2008, 03:36 PM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How then could I run parse-gedcom.xsl from saxon.jar comand line. More exactly, what are the options to add to
java -jar saxon9.jar -xsl:parse-gedcom.xsl

I tried
 java -jar saxon9.jar -xsl:parse-gedcom.xsl +param=/kennedy.ged

Although I copied kennedy.ged at the root of my HD, the terminal answers :

"Source file +param=/kennedy.ged does not exist"

Thanks a lot for your answers,

Jacques Fauquex
Reply With Quote
  #4 (permalink)  
Old May 29th, 2008, 03:51 PM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You have two options here, either supply a 'dummy' source document (can be any valid XML file) or use the -it switch. Note the parameter name at the end should be 'input'.

Also note that +param=file (note the '+') loads the parameters from the given file.

java -jar saxon9.jar -it main parse-gedcom.xsl input=kennedy.ged

java -jar saxon9.jar -s dummy.xml parse-gedcom.xsl input=kennedy.ged





/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
  #5 (permalink)  
Old May 29th, 2008, 04:08 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

java -jar saxon9.jar -it:main -xsl:parse-gedcom.xsl input=kennedy.ged

-it:main causes transformation to start at the template named "main".

input=kennedy.ged sets the value of <xsl:param name="input"/>.

The parameter is a string, not an XML document, so you don't want the "+" sign.

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Chap 19 Page 957 Lostincode BOOK: Ivor Horton's Beginning Visual C++ 2005 1 March 22nd, 2007 05:08 PM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 12:21 PM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM



All times are GMT -4. The time now is 06:02 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.