Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •