Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 12:13
    Chris Knowles
    0

    Page won't list my products

    When i got to the page i have for listing products i get an xslt error. if i visualise the error in the developer section i get the following error:

    Error parsing the XSLT:

    System.Xml.Xsl.XslLoadException: XSLT compile error. An error occurred at (10,47). ---> System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\productList-Product.xslt'. File name: 'c:\windows\system32\inetsrv\productList-Product.xslt' at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) at System.Xml.Xsl.Xslt.XsltLoader.CreateReader(Uri uri, XmlResolver xmlResolver) at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(Uri uri, Boolean include) at System.Xml.Xsl.Xslt.XsltLoader.LoadInclude() at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include) --- End of inner exception stack trace --- at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include) at System.Xml.Xsl.Xslt.XsltLoader.Load(XmlReader reader) at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver) at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil) at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver) at umbraco.macro.CreateXsltTransform(XmlTextReader xslReader, Boolean debugMode) at umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object sender, EventArgs e)

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 12:13
    Chris Knowles
    0

    sorry forgot to add it's Umbraco 4.7.0 on IIS6

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 12:19
    Rune Grønkjær
    0

    Hi Chris,

    Looks like productList-Product.xslt is missing.

    Probably a bad installation of the Tea Commerce Kit you're using. Try and check your folder permissions on the website.

    Check to see if all the files of the package has been installed.

    If everything fails, I would try again with a fresh installation of Umbraco and Tea Commerce.

    /Rune

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 12:24
    Chris Knowles
    0

    Hi Rune,

    I can see the productList-Product.xslt in the xslt folder. i have added the macro for the productlist into the RTE on the page i want it to appear on.

    Do you think this would be the problem and would it be better to create a different template and do the macro that way instead?

    Thanks

    Chris

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 12:30
    Rune Grønkjær
    0

    Hm, that should work. Try debugging the xslt's by ripping stuff out of them until something works and den build them up again, until it fails. That way you might be able to identify the problem, whether it's a Tea Commerce problem or just a normal Umbraco problem.

    /Rune

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 14:20
    Chris Knowles
    0

    how does the invokexslt div work to call the productlist-product.xslt?

    Thanks

    Chris

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 14:25
    Rune Grønkjær
    0

    That div indikates to the JavaScript what xslt to invoke, to update that specific area of the html content.

    The JavaScript will find the invokeXslt div. Then invoke the xslt and replace the PARENT of the invokeXslt div with the new content from the server.

    This means that every product in the product list can be updated individually, when e.g. the variant is changed.

    /Rune

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 14:33
    Chris Knowles
    0

    ok, so how does the page know which xslt to call then?

    Chris

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 14:46
    Chris Knowles
    0

    right, have put the fully qualified path into the <xsl:include> and if i use the umbdebugshowtrace=true i am getting:

    Value was either too large or too small for an Int32.
    Value was either too large or too small for an Int32.
      at System.Convert.ToInt32(Double value)
      at System.Double.System.IConvertible.ToInt32(IFormatProvider provider)
      at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
      at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
      at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
      at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="Product">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in http://cropwell.101test1.co.uk/xslt/productList-Product.xslt:line 25
      at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
      at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in D:\Inetpub\wwwroot\cropwell\xslt\productList.xslt:line 19
      at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
      at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
      at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
      at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)

    Any ideas where this error would be and why?

    Thanks

    Chris

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 14:54
    Rune Grønkjær
    0

    "Value was either too large or too small for an Int32." means that one of your library calls fails because no int is being added. In other words, one of your products does not have an image attached. Our standard xslt's does not take that into account yet. It's on my todo list.

    Anyways, give your products images, or remove the image part from the xslt template.

    /Rune

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 14:56
    Rune Grønkjær
    0

    As to your other question about the invokeXSLT.

    Heres an example from the teaCommerce_Advanced.js. When the currency is changed all Tea Commerce stuff is updated on the website with the updatePageUI method.

    /* CURRENCY CHANGE */
    jQuery('#currency').live('change'function () {
      var newCurrency = jQuery(this).val(),
          productPrices = jQuery('.product .productPrice');
      //Change the currency on the server
      TeaCommerce.setCurrentCurrency(newCurrency,
      {
        async: true,
        successfn: function (data) {
          //In the return we update the pages UI
          updatePageUI();
        }
      });
    });
    /* When the currency is changed we need to update product prices all over the page. To do this, we need to know what xslt's to run to get the desired html. We have written the name of the xslt's in each xslt, and can fetch it from the html. */ function updatePageUI() {   /*   All xslt's that can be invoked in this way have information in a div   with the class "invokeXSLT". For every one of them we update the UI.   */   jQuery('div.invokeXSLT').each(function () {     var invokeXSLT = jQuery(this),         parent = invokeXSLT.parent(),         htmlFromServer = TeaCommerce.invokeXSLT(invokeXSLT.text(), _nodeId,         {           umbracoLanguageId: _languageId,           async: false         });     parent.before(htmlFromServer).remove();   }); }

     

  • Chris Knowles 141 posts 222 karma points
    Jul 15, 2011 @ 15:03
    Chris Knowles
    0

    the image has solved it. 

    thanks for your help

    Chris

  • Rune Grønkjær 1372 posts 3103 karma points
    Jul 15, 2011 @ 15:05
    Rune Grønkjær
    0

    Great :)

    Allways nice to be able to help. You might want to add some conditions around the use of the image id's. When now I have been too lazy to do so :(

    /Rune

  • ianhoughton 281 posts 605 karma points c-trib
    Nov 02, 2011 @ 15:13
    ianhoughton
    0

    Came across the same product image issue and this is how I fixed it:

    Original productList-Product.XSLT:

    <xsl:if test="$productImage != ''">
    <div class="listShadow">
            <img alt="{productName}" title="{productName}" >
                        <xsl:attribute name="src">
                          <xsl:value-of select="concat('/imagegen.ashx?image=',$productImage)"/>&amp;width=110&amp;height=155&amp;constrain=true
                        </xsl:attribute>
                    </img>
            </div>
    </xsl:if>

     

    and this is the new XSLT section (remember to move the product image variable inside the choose statement)

    <xsl:choose>
                      <xsl:when test="teacommerce:GetProperty($variant, 'productImage') !=''">
                        <div class="listShadow">
                          <xsl:variable name="productImage" select="umbraco.library:GetMedia(teacommerce:GetProperty($variant, 'productImage'), 0)/umbracoFile" />
                          <img alt="{productName}" title="{productName}" >
                            <xsl:attribute name="src">
                              <xsl:value-of select="concat('/imagegen.ashx?image=',$productImage)"/>&amp;width=110&amp;height=155&amp;constrain=true
                            </xsl:attribute>
                          </img>
                        </div>
                      </xsl:when>
                    <xsl:otherwise>
                      <div class="listShadow">
                        <img src="" alt="holding image" title="holding image" width="110px" height="155px" />
                      </div>
                    </xsl:otherwise>
                  </xsl:choose>
Please Sign in or register to post replies

Write your reply to:

Draft