CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   XML (http://www.codingforums.com/forumdisplay.php?f=3)
-   -   Help with xml parse error (http://www.codingforums.com/showthread.php?t=277899)

aryan86 10-19-2012 12:54 PM

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>


Alex Vincent 10-19-2012 11:30 PM

Check your XSLT document for well-formedness under XML rules. :)


All times are GMT +1. The time now is 02:36 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.