My XSL document causes my XML to disappear.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Palabasan
    New Member
    • May 2011
    • 3

    My XSL document causes my XML to disappear.

    Stats:
    Chrome 11.0
    Notepad++

    Basically i wrote some XSL and linked it to my XML and then Google Chrome won't display the XML file. The code is below.

    Code:
     
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/">
    <html>
    	     <body>
    		     <xsl:for-each select="recipebook/recipe">
    		         <h1><xsl:value-of select="name"/></h1>
    			         <xsl:for-each select="ingredientlist/ingredient">
    					     <xsl:value-of select="."/>
    					 </xsl:for-each>
    				     <xsl:for-each select="preparation/step">
    					     <xsl:value-of select="."/>
    					 </xsl:for-each>
    				 
    			 </xsl:for-each>
    		 </body>
    	 </html>
    </xsl:template>
    </xsl:stylesheet>
    and there are no error codes that chrome 11 gave.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    well, not sure if this is really your XSL, but if it is, it is invalid (missing closing tags of <xsl:template >, & <xsl:stylesheet >, invalid use of a second <xsl:stylesheet > tag, missing XML declaration)

    Comment

    • Ian Palabasan
      New Member
      • May 2011
      • 3

      #3
      i replaced the two final xsl tags with closing tags and i alredy added the declaration, but no.
      oh, and it really is my XSL for a DTD i made.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        remove the second <xsl:template >, you can only have one root element.

        Comment

        • Ian Palabasan
          New Member
          • May 2011
          • 3

          #5
          where is the second template? i have only 1 template.

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            it may have been in a previous display or I just nod had enough coffee …

            anyways, are you sure your XPath expression matches?

            Comment

            Working...