File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XSLT error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT error" Watch "XSLT error" New topic
Author

XSLT error

Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 497

Hi all,

I have a XML file and a XSLT file, but when I open the XML file, it tells me "invalid style sheet" in opera, and in FF it displays the text in one single line. I can't understand what is the error. Here is the XML file



Here is the XSLT file



Please help me to find the error. I am pretty much new to this subject, so please be kind enough to give me an explanation. Thanks


Are you better than me? Then please show me my mistakes..
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

I just tried those files in Firefox, and it started working once I changed the XSL file to put the output in <html> tags.
Yohan Weerasinghe
Ranch Hand

Joined: Oct 07, 2010
Posts: 497

Matthew Brown wrote:I just tried those files in Firefox, and it started working once I changed the XSL file to put the output in <html> tags.


WOW!!! THANKS FOR THE HELP!!! I AM SO GLAD!!! Anyway why is that?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18138
    
    8

My guess: your XSLT document says you're producing XML. (It says that because you didn't include an <xsl:output> element which said otherwise, and you didn't output an opening <HTML> tag to signal your intention to produce HTML.) But then you didn't produce XML.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT error
 
Similar Threads
XML to Text with XSLT
Remove unwanted space before and after the table using javascript
xsl issue for newbie
XML and XSLT not working
PLEASE HELP ME!!Creating drop down list using XSL