472,958 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

vb.net xsltransform hangs with fxsl randomizeList template

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 application 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 with this vb.net component, but they
are not using the FXSL randomizeList function.

Also, when I step through my code with the debugger, it hangs at the
line where xslt.Transform is called. It doesn't return from that line.

Rob

Feb 2 '06 #1
1 1474
For more information, please, see my replies in a similar thread in
microsoft.public.xsl.

To summarize, I haven't found any problem with running the randomizeList
template with the XslTransform class of .NET 1.1, using the nXSLT.exe
command-line utility.

It seems, therefore, that the cause of the described issue most probably
lies in the way the XSLT transformation is instantiated in the OP's code and
thus this topic may be more appropriate for this .NET - oriented forum.

Cheers,
Dimitre Novatchev.
<rm*******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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 application 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 with this vb.net component, but they
are not using the FXSL randomizeList function.

Also, when I step through my code with the debugger, it hangs at the
line where xslt.Transform is called. It doesn't return from that line.

Rob

Feb 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Animesh Sharma | last post by:
Hi, Following template matches correctly in MSXML4 but NOT with .Net XSL translator: <xsl:template match="//input]"> <--Do Some operation> </xsl:template>
5
by: Kevin Westhead | last post by:
I'm using XslTransform to apply a transform to an XML document, however I get validation problems when parsing the resulting XML document due to invalid whitespace. I'm passing in an XPathNavigator...
9
by: LarryR | last post by:
The following XSLT works fine using MSXML 4.0 (e.g I receive a result in about 20 seconds), but effectively hangs in both .NET 1.0 sp2 with the XML hot fix and NET 1.1. My source XML file is...
5
by: John Sever | last post by:
My transform in cludes a variable that holds a node set from the node-set() extension function. It the transformation works fine when using MSXML2 or msxsl.exe but not in VB.Net. My code looks...
6
by: BLechmann | last post by:
Hello *, I'm trying to transform my DocBook document with the FO stylesheet from the DocBook XSL distribution (the transformation with the XHTML stylesheet works). I changed "$years + 1" to...
3
by: Steve | last post by:
Is there any way of specifying the startMode when using the xslTransform class? We are updating code which used msxml to the system.xml classes but can find no way to specify the startMode. We...
1
by: Yuriy | last post by:
Hi, Can anybody explain the following? Say I have the following source XML and XSLT (see below). No matter what this XSLT does. It is just a sample to show a problem. the idea is that XSLT...
1
by: Bob Yuan | last post by:
Hi, I am working on a asp.net project that takes a xml source and use XslTransform.transform to generate a xhtml output. The problem with using XslTransform is that it automatically reformats...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.