locked
XML Debug XSLT unexpected error RRS feed

  • Question

  • I am trying to get an XML file to produce an HTML file.  The  first few lines of the XML file:

    <?xml version="1.0" encoding="utf-8" ?> 
    <?xml-stylesheet type="text/xsl" href="XSLTFile1.xslt"?>  
    <xdef:DataDefinition xmlns:xdef="http://schemas.smartz.com/DataDefinition">  
        <xdef:tables> 
            <xdef:table name="customer">  
                <xdef:field name="cust_deleted"             type="bit"                  nullable="false" description="Is this customer still active?"/>  
                <xdef:field name="cust_acctNumber"          type="int"                  nullable="false" description="Customer account number (key)"/>  
                <xdef:field name="cust_name"                type="varchar"  size="50"   nullable="false" description="Customer name"/>  
     

    The XSLT file:
    <?xml version="1.0" encoding="utf-8"?>  
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" 
    > 
        <xsl:output method="html" indent="yes"/>  
     
        <xsl:template match="/">  
          <html> 
            <body> 
              <h2>Paladin POS Tables</h2> 
              <xsl:for-each select="DataDefinition">  
                   <tr> 
               <xsl:for-each select="tables">  
                    <td> 
                      <xsl:value-of select="table"/>  
                      <td> 
                        <xsl:for-each select="name"></xsl:for-each> 
                      </td> 
                      <td> 
                        <xsl:for-each select="type"></xsl:for-each> 
                      </td> 
                      <td> 
                        <xsl:for-each select="nullable"></xsl:for-each> 
                      </td> 
                      <td> 
                        <xsl:for-each select="description"></xsl:for-each> 
                      </td> 
                    </td> 
     
                </xsl:for-each> 
                   </tr> 
              </xsl:for-each> 
              </body> 
          </html> 
        </xsl:template> 
    </xsl:stylesheet> 
     
    It doesn't produce the output I was expecting--it is almost like it is ignoring the xsl:for-each commands.  All I get in the HTML output file is the header level 2.  When I try to debug it, using the XML Debug XSLT command, I get the message:

    Unexpected error encountered.  It is recommended that you restart the application as soon as possible.
    Error: Unspecified error
    File: vsee\pkgs\vssprovider\sccprj.cpp
    Line number: 3670

    1. What is causing the failure when I try to debug the XSLT?

    2. Why is it not seeing the the rest of my XML file?
    Monday, November 17, 2008 4:12 PM

All replies

  • I'm getting the same problem - I successfully debugged an xslt once and then, on the second run I terminated the debugger as I needed to change one of the lines.

    Upon terminating, I got this popup with the text you mention and now, even after a restart, I'm unable to debug the xslt at all.

    I found this post on stack overflow: http://stackoverflow.com/questions/12369/vs2008-sp1-crashes-when-debugging-an-xslt-file where a member of the Data Programmability team says that the issue has been identified and will be fixed with the next version - however, MS Connect doesn't yet have a hotfix listed.

    It's nothing to do with the content of the XSL itself, and I would be it's not directly an issue with source control, even though the message appears to suggest so.

    We'll have to keep an eye out for the hotfix, if it emerges.  In the meantime, I have no idea how to get it working again.  Pre-SP1 I used to get this error, but it would be okay after restarting the IDE, but now it seems it's permanently damaged!

    Tuesday, January 27, 2009 5:51 PM
  • I think your for-eachs are a little off - here's how I'd write your template:

    <?xml version="1.0" encoding="utf-8"?>     
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"    
        xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"    
    >    
        <xsl:output method="html" indent="yes"/>     
        
        <xsl:template match="/DataDefinition">     
          <html>    
            <body>    
              <h2>Paladin POS Tables</h2>    
                 <table>   
                    <xsl:apply-templates select="tables">     
                 <table>   
              </body>   
          </html>    
        </xsl:template>   
     
    <xsl:template match="tables">  
     
        <tr> 
     
            <xsl:apply-templates select="table"/>  
     
        </tr> 
     
    </xsl:template> 
     
    <xsl:template match="table">  
     
    <tr> 
     
    <td colspan="4">  
     
    <xsl:value-of select="@name" /> 
     
    </td> 
     
    </tr> 
     
    <!-- now apply field template for each field - the XPath select returns all 'field' nodes,  
     
     and then applies the template with the same match--> 
     
    <xsl:apply-templates select="field" /> 
     
    </xsl:template> 
     
    <xsl:template match="field> 
     
    <tr> 
     
    <td> 
     
        <xsl:value-of select="@name"/>  
     
    </td> 
     
    <td> 
     
        <xsl:value-of select="@type"/>  
     
    </td> 
     
    <td> 
     
        <xsl:value-of select="@nullable"/>  
     
    </td> 
     
    <td> 
     
        <xsl:value-of select="@description"/>  
     
    </td> 
     
    </tr> 
     
    </xsl:template> 
       
    </xsl:stylesheet>    
     

     

    • Proposed as answer by Lord Zoltan Wednesday, January 28, 2009 8:57 AM
    Tuesday, January 27, 2009 6:11 PM