Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: FXSL randomizeList hangs system [Thread Next] Re: FXSL randomizeList hangs systemTo: NULL Date: 2/2/2006 12:22:00 PM Thanks for your response. I am using the same vb.net code to transform our xml data with several other xsl template files, all of which work. The only one that doesn't work is the one that uses the randomizeList. I understand that it works when I run it in a browser. That is how I tested it. And yes, I did register my .Net component as a COM object with Regasm. Otherwise, none of the other xsl templates would work. Indeed, my object would not even load in the browser. It's got to be something in the way the randomizeList was written. I'm not saying its poorly written, not at all. I'm wondering what in the randomizeList templates causes my component to go into an endless loop? For example, are the xsl:import statements confusing the XslTransform object? Is the msxsl:node-set(...) confusing the XslTransform object? I was hoping someone else encountered this issue, that's all, and knows what I need to change to make the randomizeList object work. Rob Dimitre Novatchev wrote: > There is no problem in the XSLT transformation using the .NET XslTransform > class. I checked this using the nXslt.exe command line utility and the > following transformation, applied on your provided source.xml: > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:vendor="urn:schemas-microsoft-com:xslt" > exclude-result-prefixes="vendor" > > > > <xsl:import href="randomList.xsl"/> > > <xsl:output omit-xml-declaration="yes" indent="yes"/> > > <xsl:template match="/"> > > RandomizeList: > <xsl:call-template name="randomizeList"> > <xsl:with-param name="pList" select="/*/*/*"/> > </xsl:call-template> > </xsl:template> > </xsl:stylesheet> > > When applied using nXslt.exe on your provided source.xml: > > <Lists> > <List> > <Item>Item 1</Item> > </List> > <List> > <Item>Item 2</Item> > </List> > <List> > <Item>Item 3</Item> > </List> > <List> > <Item>Item 4</Item> > </List> > <List> > <Item>Item 5</Item> > </List> > <List> > <Item>Item 6</Item> > </List> > <List> > <Item>Item 7</Item> > </List> > </Lists> > > the result is: > > .NET XSLT command line utility, version 1.5 build 1860 > (c) 2004 Oleg Tkachenko, http://www.tkachenko.com/dotnet/nxslt.html > Running under .NET 1.1.4322.2032 > > Source document load time: 11.512 milliseconds > Stylesheet load/compile time: 15.943 milliseconds > Stylesheet execution time: 22.961 milliseconds > > > > RandomizeList: > <el>Item 2</el><el>Item 7</el><el>Item 1</el><el>Item 6</el><el>Item > 5</el><el>Item 3</el><el>Item 4</el> > > Therefore, the problem lies in your VB.NET code (most of which you haven't > shown) and the way you're attempting to use a .NET object (did you register > it as a COM object?) in the script of your html page. > > > Cheers, > Dimitre Novatchev. > > > <rmgalante@y...> wrote in message > news:1138901429.074736.290850@g...... > > Hello, > > > > I have a VB.Net component that uses the XslTransform object. I am using > > the FXSL randomizeList function in my XSL template. When I transform > > the XML in the VB.Net component, my system hangs. When I load the XML > > in a browser with a reference to the XSL template, it works fine. > > > > Here is my XML: > > <?xml version="1.0" ?> > > <Lists> > > <List><Item>Item 1</Item></List> > > <List><Item>Item 2</Item></List> > > <List><Item>Item 3</Item></List> > > <List><Item>Item 4</Item></List> > > <List><Item>Item 5</Item></List> > > <List><Item>Item 6</Item></List> > > <List><Item>Item 7</Item></List> > > </Lists> > > > > Here is my XSL: > > <xsl:stylesheet version = "1.0" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > > exclude-result-prefixes = "xsl" > > > > > <xsl:import href = "randomList.xsl" /> > > > > <xsl:output method = "html" /> > > > > <xsl:template match = "/" > > > <xsl:variable name="vRandFunc"> > > <xsl:call-template name="randomizeList"> > > <xsl:with-param name="pList" select="/Lists/List/Item" /> > > <xsl:with-param name="pSeed" select="32768" /> > > </xsl:call-template> > > </xsl:variable> > > > > <table> > > <xsl:for-each select="msxsl:node-set($vRandFunc)/*"> > > <tr> > > <td><xsl:value-of select="." /></td> > > </tr> > > </xsl:for-each> > > </table> > > </xsl:template> > > > > </xsl:stylesheet> > > > > Here is my VB.Net code snippet: > > ' Create the XslTransform and load the stylesheet. > > Dim xslt As XslTransform = New XslTransform > > xslt.Load(sXslTemplateFile) > > > > ' Create an XsltArgumentList. > > Dim xslArg As XsltArgumentList = New XsltArgumentList > > ' Add parameters > > xslArg.AddParam("firstelement", "", > > iElement.ToString()) > > xslArg.AddParam("elementsperpage", "", > > m_iElementsPerPage.ToString()) > > > > 'Create an XmlTextWriter to handle the output, but put > > it in a string. > > Dim sb As StringBuilder = New StringBuilder > > Dim sw As StringWriter = New StringWriter(sb) > > Dim xw As XmlTextWriter = New XmlTextWriter(sw) > > > > 'Transform the file. > > xslt.Transform(m_xmlDom.CreateNavigator(), xslArg, xw, > > Nothing) > > 'Get the output > > RenderPage = sb.ToString() > > > > When I execute this code, my system hangs and I cannot kill the > > application, which is a browser in this case. I load my .Net component > > as an object in an HTML page in a browser, and inject the results in > > RenderPage to a div tag. > > > > All of my other XSL templates work, but they are not using the FXSL > > randomizeList function. > > > > Anyone have any ideas, alternatives, etc.? > > > > Rob > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
