LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-07-2004, 04:48 AM   #1
alix123
Member
 
Registered: Nov 2004
Posts: 63

Rep: Reputation: 15
xml style sheet working on windows but not on linux


I have xml and xsl file its working perfectly on windows internet explorer but on linux mozilla it shows an error

"This XML file does not appear to have any style information associated with it. The document tree is shown below."

you can check it below iam giving both xml and xsl file just tell me what is wrong in theat

keep both the file in the same folder and open the xml file with explorer and mozilla


<--*********** xml file start here **********-->
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="LogFile.xsl"?>
<LogFile>
<Log Date="Datecheck">
<TestCase Result ="Passed"><Column1>1</Column1><Column2>2</Column2><Column3>3</Column3></TestCase>
</Log>
<Log Date="Datecheck">
<TestCase Result ="Passed"><Column1>1</Column1><Column2>2</Column2><Column3>3</Column3></TestCase>
</Log>
</LogFile>

<--*******xml file ends here ************-->




<-- xsl file starts here -->
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Complete Log Report</TITLE>
</HEAD>
<BODY>
<H1>Complete Log Report</H1>

<xsl:for-each select="LogFile/Log">
Test Case -
Log Date -
<TABLE BORDER="3" CELLSPACING="2" CELLPADDING="2">
<THEAD ALIGN="left" bgcolor="silver">
<TH>Column1</TH>
<TH>Column2</TH>
<TH>Column3</TH>
</THEAD>
<TBODY>
<xsl:for-each select="TestCase">
<TR>
<TD><B><xsl:value-of select="Column1"/></B></TD>
<TD><B><xsl:value-of select="Column2"/></B></TD>
<TD><B><xsl:value-of select="Column3"/></B></TD>
</TR>
</xsl:for-each>
</TBODY>
</TABLE>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>


<-- xsl file ends her -->
 
Old 12-07-2004, 07:14 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Code:
apt-get install libxml2-utils
Hint: your document is not valid XML:
Code:
toni@mario:~/work/pub/tst$ xmllint --noout foo.xml
foo.xml:2: parser warning : xmlParsePITarget: invalid name prefix 'xml'
<?xml:stylesheet type="text/xsl" href="LogFile.xsl"?>
                ^
toni@mario:~/work/pub/tst$ xmllint --noout fixed/foo.xml
toni@mario:~/work/pub/tst$ xmllint --noout --relaxng xslt.rng foo.xsl
foo.xsl:2: element stylesheet: Relax-NG validity error : Element stylesheet failed to validate attributes
foo.xsl fails to validate
toni@mario:~/work/pub/tst$ xmllint --noout --relaxng xslt.rng fixed/foo.xsl
fixed/foo.xsl validates
toni@mario:~/work/pub/tst$ diff -ub foo.xml fixed/foo.xml
--- foo.xml     2004-12-07 14:06:36.000000000 +0200
+++ fixed/foo.xml       2004-12-07 14:15:40.000000000 +0200
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<?xml:stylesheet type="text/xsl" href="foo.xsl"?>
+<?xml-stylesheet type="text/xsl" href="foo.xsl"?>
 <LogFile>
 <Log Date="Datecheck">
 <TestCase Result ="Passed"><Column1>1</Column1><Column2>2</Column2><Column3>3</Column3></TestCase>
toni@mario:~/work/pub/tst$ diff -ub foo.xsl fixed/foo.xsl 
--- foo.xsl     2004-12-07 14:07:06.000000000 +0200
+++ fixed/foo.xsl       2004-12-07 14:02:15.000000000 +0200
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:template match="/">
 <HTML>
 <HEAD>
toni@mario:~/work/pub/tst$

Last edited by ToniT; 12-07-2004 at 07:15 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
is the open office spread sheet program compatiable with ms windows? dr_zayus69 Linux - Software 5 10-14-2005 10:14 PM
Safari Style Sheet Problem atomicx Programming 2 05-03-2005 01:21 AM
external style sheet: list help trscookie Programming 1 04-16-2005 04:10 PM
Remove XML style tags using C kuronai Programming 8 11-12-2004 01:27 AM
latex question; how do I add a new style sheet schatoor Linux - Software 0 01-07-2003 06:23 PM


All times are GMT -5. The time now is 02:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration