• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

XSLT transformation problem

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


XML file :-

JSP file:-



Following error is occuring:-
[Fatal Error] jstl::1:1: Content is not allowed in prolog.

Please solve it.

Thanks and Regards
Amit Oberoi
 
Marshal
Posts: 27275
87
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
If you look at the XML document, you will see it has a blank before the prolog. At least, the version you posted does. That's what the error message is about.
 
yogi maheshnath
Ranch Hand
Posts: 30
  • 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:
If you look at the XML document, you will see it has a blank before the prolog. At least, the version you posted does. That's what the error message is about.



Hi,
As you mentioned there is a blank before the prolog.i didn't find anyone.
I come to know sometimes there are hex strings add up in starting of our xml.
I had used XVi32 hex editor to check the hex strings and i found FF FE in starting.which characters to use in Place of FF FE to fix it.

Pleas solve it.
 
Paul Clapham
Marshal
Posts: 27275
87
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
That's a byte-order mark. Some software puts it at the front of XML documents even when it's technically not required to be there. And if it isn't technically required to be there, the XML parsers in Java don't ignore it.

But you could wrap your input stream in something which does ignore it. You could write a PushbackInputStream which reads until it finds the first "<", then backs up one byte so that reading it will start at the right place. Or you could use the BOMExclusionInputStream which is in the Apache Commons IO package.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic