473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Exception: "Index was outside the bounds of the array." in a XSLT transformation.

A transform that works fine in XMLSPy fails when I run it under dot net.
I've run many other transforms successfully in dot net so there is something
"special" about this transform
I just installed dot net framework 1.1 SP1 - but I still get the same error

What makes this transform more complex than others is:
1) It uses an MSXSL extension function to evaluate Xpaths at run time
2) It uses an include to include the extension function
3) It reads two XML files - a second specified in document statement

I've tried fiddling with the dot net transform statement to use a
XPathDocument. a XPathNavigator and/or a XmlUrlResolver, but I still get the
same error

here's a sample:

XPathDocument doc = new XPathDocument(xtr);

XPathNavigator nav = doc.CreateNavigator();

XmlResolver res = new XmlUrlResolver();

MemoryStream ms = new MemoryStream();

// transform.Transform(doc,null,ms,null);

transform.Transform(nav,null,ms,res);
I'll provide more details if ncessary, but I'm hoping this is enough for
some expert

Here is the extension function def:

<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:dyn="http://www.wheels.com/dynamic"

xmlns:msxsl="urn:schemas-microsoft-com:xslt"

extension-element-prefixes="dyn msxsl">

<msxsl:script implements-prefix="dyn" language="jscript">

function evaluate(context, expression)

{

return context.nextNode().selectNodes(expression);

}

</msxsl:script>

</xsl:stylesheet>
Nov 12 '05 #1
2 2230
David Laub wrote:
A transform that works fine in XMLSPy fails when I run it under dot net.
I've run many other transforms successfully in dot net so there is something
"special" about this transform
I just installed dot net framework 1.1 SP1 - but I still get the same error

What makes this transform more complex than others is:
1) It uses an MSXSL extension function to evaluate Xpaths at run time


You can't run MSXML extension functions with .NET XSLT processor. It's
not portable. Write your extensions using JScript.NET or C#.
--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #2
Thanks - will do!
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:e2*************@TK2MSFTNGP15.phx.gbl...
David Laub wrote:
A transform that works fine in XMLSPy fails when I run it under dot net.
I've run many other transforms successfully in dot net so there is something "special" about this transform
I just installed dot net framework 1.1 SP1 - but I still get the same error
What makes this transform more complex than others is:
1) It uses an MSXSL extension function to evaluate Xpaths at run time


You can't run MSXML extension functions with .NET XSLT processor. It's
not portable. Write your extensions using JScript.NET or C#.
--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com

Nov 12 '05 #3

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

Similar topics

1
by: kim | last post by:
Scenario (I'm a newbie): I have a datagrid with countries listed and 5 parameters in each row. I want to add a row to this datagrid via an Event Handler. Very basic stuff. This method then call a...
0
by: Brian Dobby | last post by:
Hi. I have just updated the version of FOP used by a servlet running under Tomcat to 0.20.5 (previous version unknown). I included all FOP's support jars, including Xalan. Now a Xalan transform in...
2
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
1
by: melinda | last post by:
How do you set up a MDI interface so that one of the MDI forms can be dragged outside of the parent form. For example, in Visual Studio, you can do this with some of the windows. Is this MDI? ...
0
by: Trapulo | last post by:
I've a datagrid filled with a collection of objects that inherits from basecollection. When I remove an item from this collection and then click onto the datagrid, I've always this error: ...
12
by: Coen | last post by:
Hi, I'm dealing with a master-detail relationship. A datagrid bound to the detail data. When navigating through the records (next record: Me.BindingContext(mDv1).Position += 1), I notice a delay...
3
by: writebrent | last post by:
I wrote a little interface for users to post data to a website. On their local machines, it produces CSV from an Excel spreadsheet, then posts it to the site. In some cases, the CSV will contain...
0
by: =?Utf-8?B?Q3ltZXI=?= | last post by:
When the datagrid has multi rows and the vertical scrollbar hasn't appeared, if I click the column near the bound or drag horizontal scrollbar, this exception will be throwed. The trace stack as...
3
by: kalaivani572 | last post by:
i am getting "Index was outside the bounds of the array." error when i try to get the checked items from list view. the code is private void btnFinish_Click(object sender, EventArgs e) {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.