This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 499

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: 4343
    
    8

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: 499

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: 18541
    
    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.
 
Consider Paul's rocket mass heater.
 
subject: XSLT error
 
Similar Threads
XML and XSLT not working
xsl issue for newbie
Remove unwanted space before and after the table using javascript
PLEASE HELP ME!!Creating drop down list using XSL
XML to Text with XSLT