• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Newbie: javax . xml . transform . Transformer Configuration Exception

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to test an example of the ujac print utility using an xsl file that comes bundled with majix.

http://ujac.sourceforge.net/html/print.html
http://sourceforge.net/projects/majix/

When I call this line of code


It throws the exception


Here are the first few lines of the xsl file.


Now I can see the line the exception is referring to, but I am not very familiar with xsl. Could anyone explain what this error means and what might be my next steps in fixing it? A nudge in the right direction would be a great help.

TIA
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the error message really refer to "xsl:space"? The element you displayed doesn't contain that attribute, it contains "xml:space".
 
Corrie L Sherone
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Clapham:
Does the error message really refer to "xsl:space"? The element you displayed doesn't contain that attribute, it contains "xml:space".



Yes, you are right. I posted the wrong section of xml. Here is an example

 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There isn't any xsl:space attribute in XSLT, at least not in XSLT 1.0, which I assume is what you are using. There is xsl:strip-space and xsl:preserve-space but those are elements, not attributes.

Whoever wrote that appears to have confused those things with the xml:space attribute. Normally whitespace-only text nodes in a template are ignored by the XSLT processor, but the xml:space attribute can override that behaviour. In your example, xml:space="preserve" would mean that the processor should preserve the line-ending character after the <TABLE> tag (i.e. write it into the output document) and the line-ending character before the </TABLE> tag.

Which seems unnecessary to me, but that's another question.
 
Corrie L Sherone
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I am using XSLT 1.0. Thanks, that makes sense. I really appreciate the explanation. I did not know where to start with that one and the w3.org xslt docs are still reading like greek to me at this point.

One error fixed another one to go! But at least google returned results on this one. Off to read about this error, xml:space="preserve", xsl:strip-space and xsl:preserve-space.

Thanks again.
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Corrie L Sherone:
... the w3.org xslt docs are still reading like greek to me at this point...

Not the best way to learn XSLT. You could look for XSLT tutorials on the Internet but unfortunately most of the things I found that claim to be "tutorials" just rehash what the elements do and fail to explain things like the built-in template rules. If you're going to be doing anything significant with XSLT you should consider getting a book.
 
Corrie L Sherone
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Clapham:
most of the things I found that claim to be "tutorials" just rehash what the elements do and fail to explain things like the built-in template rules.



Yes, that jives with my experiences as well. If you have any recommendations on books you have found helpful, or even ones to avoid, let me know. I will keep it mind.

Thanks
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book I learned XSLT from is by Michael Kay. My edition is copyright 2000 so I expect there are a couple of more recent versions. Michael Kay probably knows more about XSLT than anybody else on the planet and his book was quite readable. It did have to rehash what all the elements do, of course, but it had good examples and explanations.

I expect modern XSLT books would cover XSLT 2.0, which most people aren't using yet. His certainly would, since he's the author of the thing. Make sure that any book you buy clearly identifies what elements are 2.0 only.
 
Corrie L Sherone
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the good recommendation. I found an old article that gives a hint of his writing style. So I will probably decide to go with one of his books.

http://www.ibm.com/developerworks/library/x-xslt/

Cheers
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic