Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-19-2012, 12:54 PM   PM User | #1
aryan86
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
aryan86 is an unknown quantity at this point
Help with xml parse error

Hello,

Im making a lexicon with 2 xml files into one and then style with one xsl stylesheet. I get the error: Parsing an XSLT stylesheet failed. someone that can see what im doing wrong

the xml file:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="lexstyle.xsl"?>

<lexicon>
	<title>Lexikon</title>
		<logo filename="book.svg"/>
		<glossary filename="eng.xml"/>
		<glossary filename="swe.xml"/>
		<author>Aryan Satarvandi</author>
</lexicon>
and the xsl file

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" 
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes" />



  <xsl:template match="/">
    <html>
      <head>
        <link rel="stylesheet" type="text/css" href="stylesheet.css"/> 
        <title>Lexikon</title>
      </head>
      <body>
      
      <div id="wrap"> 

      <div id ="title">Lexikon</div> 


		<xsl:for-each select="/lexicon/glossary">
		<xsl:apply-templates select="document(@filename)/dictionary" />
		</xsl:for-each>
        </div>
        
          <xsl:template match="dictionary"/> 
          <xsl:apply-templates />
			</xsl:template>
                    
      <p class="words"><xsl:template match="//word">
              <xsl:sort order="ascending"/>
        <xsl:apply-templates />
		</xsl:template>
        </p>
        </div>
	
		<xsl:template match="word">Orden: <xsl:value-of select="." />
	
        </div>
        </body>
	</html>
		</xsl:template>
</xsl:stylesheet>
and one of the lists

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="style.xsl"?>

<!-- Filename: eng.xml --> 
<!-- Author: Aryan Satarvandi --> 
<!-- Date: 2012-09-30 -->

<dictionary>
  <language>Engelsk</language>
  <author>Aryan Satarvandi</author>
  <word type="1">Work</word>
  <word type="1">Bath</word>
  <word type="1">Children</word>
  <word type="1">Grade</word>
  <word type="1">Computer</word>
  <word type="1">Degree</word>
  <word type="1">Aircraft</word>
  <word type="1">Pregnant</word>
  <word type="1">Vacant</word>
  <word type="1">Lesson</word>
  <word type="1">Teacher</word>
  <word type="1">Project</word>
  <word type="1">Travel</word>
  <word type="1">Vacation</word>
  <word type="1">Sun</word>
  <word type="1">Study</word>
  <word type="1">Connection</word>
  <word type="1">Bag</word>
  <word type="1">Earplugs</word>
</dictionary>

Last edited by Alex Vincent; 10-19-2012 at 11:27 PM.. Reason: fixing code tag
aryan86 is offline   Reply With Quote
Old 10-19-2012, 11:30 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
Check your XSLT document for well-formedness under XML rules.
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:01 PM.


Advertisement
Log in to turn off these ads.