473,387 Members | 1,504 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.

msxml scripts and xstlArgumentList entension objects. Can I combinethem?

I think the subject says it all, but just in case:

I know that I can call my own methods during an XSL transformation
using

<xsl:value-of select="myObject.someMethod(arg1)" />

having done something like:

dim xslTrans as System.Xml.Xsl.Xsltransform
dim xsltArg as new System.Xml.XsltArgumentList()
xsltArg.AddExtensionObject("urn:my-object")
....
dim navigator as System.Xml.Xpath.XPathNavigator = ..

xslTrans.transform(navigator, xslArg, myWriter, Nothing)

....
public function someMethod( arg as string) as String
...
end function
and I also know that I can define functions in a script inside
the xsl file using:

<msxsl:script language="VisualBasic" implements-prefix="user">
function myFunc (xx)
...
end function
</msxsl:script>

<xsl-value-of select="user:myFunc( elm/@value ) />
Is there an easy way to combine the two ideas so that my msxml:script
function calls the method of my extension object ?

<msxsl:script language="VisualBasic" implements-prefix="user">
<![CDATA[
function myFunc (xx)
myFunc = myObject.someMethod()
end function
]]>
</msxsl:script>
Steve.

Nov 17 '05 #1
3 1469
Like you, I would also like an answer to this question...

Also, does the VS debugger work for you with the contents of the msxsl:script tag ?
steve_h <st***********@bigfoot.co.m> wrote in message news:<bo**********@rex.ip-plus.net>...
I think the subject says it all, but just in case:

I know that I can call my own methods during an XSL transformation
using

<xsl:value-of select="myObject.someMethod(arg1)" />

having done something like:

dim xslTrans as System.Xml.Xsl.Xsltransform
dim xsltArg as new System.Xml.XsltArgumentList()
xsltArg.AddExtensionObject("urn:my-object")
....
dim navigator as System.Xml.Xpath.XPathNavigator = ..

xslTrans.transform(navigator, xslArg, myWriter, Nothing)

...
public function someMethod( arg as string) as String
...
end function
and I also know that I can define functions in a script inside
the xsl file using:

<msxsl:script language="VisualBasic" implements-prefix="user">
function myFunc (xx)
...
end function
</msxsl:script>

<xsl-value-of select="user:myFunc( elm/@value ) />
Is there an easy way to combine the two ideas so that my msxml:script
function calls the method of my extension object ?

<msxsl:script language="VisualBasic" implements-prefix="user">
<![CDATA[
function myFunc (xx)
myFunc = myObject.someMethod()
end function
]]>
</msxsl:script>
Steve.

Nov 17 '05 #2


John Doe wrote:
Like you, I would also like an answer to this question...

Also, does the VS debugger work for you with the contents of the msxsl:script tag ?
I had't tried it until just now. The only way I could think of doing
this was using 'step into' xsltTrans.transform(....)', but that doesn't
work. The callbacks to myObject.someMethod can be debugged if I place a
breakpoint there, but I can't place break points inside the
msxsl function because it's only a string inside a data file afa
devStudio is concerned.

steve_h <st***********@bigfoot.co.m> wrote in message news:<bo**********@rex.ip-plus.net>...
I think the subject says it all, but just in case:

I know that I can call my own methods during an XSL transformation
using

<xsl:value-of select="myObject.someMethod(arg1)" />

having done something like:

dim xslTrans as System.Xml.Xsl.Xsltransform
dim xsltArg as new System.Xml.XsltArgumentList()
xsltArg.AddExtensionObject("urn:my-object")
....
dim navigator as System.Xml.Xpath.XPathNavigator = ..

xslTrans.transform(navigator, xslArg, myWriter, Nothing)

...
public function someMethod( arg as string) as String
...
end function
and I also know that I can define functions in a script inside
the xsl file using:

<msxsl:script language="VisualBasic" implements-prefix="user">
function myFunc (xx)
...
end function
</msxsl:script>

<xsl-value-of select="user:myFunc( elm/@value ) />
Is there an easy way to combine the two ideas so that my msxml:script
function calls the method of my extension object ?

<msxsl:script language="VisualBasic" implements-prefix="user">
<![CDATA[
function myFunc (xx)
myFunc = myObject.someMethod()
end function
]]>
</msxsl:script>
Steve.


Nov 17 '05 #3
Here is the same reply I put on the microsoft.public.xsl list:

They are processed very differently by the .NET framework, and you should
refrain from using msxsl:script elements within XSLT parsed by managed code.
See Q316775 [1], the assembly cannot be unloaded correctly and may lead to a
memory leak. There are several design patterns that you can use to mitigate
the changes, including dynamically loading an assembly that contains your
extension objects.

Not that it is impossible to do, but I have not seen any vendors that
support script debugging in their XSLT products. For example, Marrowsoft's
Xselerator is one of the best XSLT IDEs and it does not support script
debugging. I have not seen ActiveState's newest release of their XSLT
debugger for .NET, but I have not heard about it being able to debug inlined
script, either.

Your best bet is to simply use extension objects if you are using .NET.

[1] http://support.microsoft.com/default...b;EN-US;316775

--
Kirk Allen Evans
Microsoft MVP, ASP.NET
XmlInsider
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans

"steve_h" <st***********@bigfoot.co.m> wrote in message
news:bo**********@rex.ip-plus.net...


John Doe wrote:
Like you, I would also like an answer to this question...

Also, does the VS debugger work for you with the contents of the msxsl:script tag ?

I had't tried it until just now. The only way I could think of doing
this was using 'step into' xsltTrans.transform(....)', but that doesn't
work. The callbacks to myObject.someMethod can be debugged if I place a
breakpoint there, but I can't place break points inside the
msxsl function because it's only a string inside a data file afa
devStudio is concerned.

steve_h <st***********@bigfoot.co.m> wrote in message news:<bo**********@rex.ip-plus.net>...
I think the subject says it all, but just in case:

I know that I can call my own methods during an XSL transformation
using

<xsl:value-of select="myObject.someMethod(arg1)" />

having done something like:

dim xslTrans as System.Xml.Xsl.Xsltransform
dim xsltArg as new System.Xml.XsltArgumentList()
xsltArg.AddExtensionObject("urn:my-object")
....
dim navigator as System.Xml.Xpath.XPathNavigator = ..

xslTrans.transform(navigator, xslArg, myWriter, Nothing)

...
public function someMethod( arg as string) as String
...
end function
and I also know that I can define functions in a script inside
the xsl file using:

<msxsl:script language="VisualBasic" implements-prefix="user">
function myFunc (xx)
...
end function
</msxsl:script>

<xsl-value-of select="user:myFunc( elm/@value ) />
Is there an easy way to combine the two ideas so that my msxml:script
function calls the method of my extension object ?

<msxsl:script language="VisualBasic" implements-prefix="user">
<![CDATA[
function myFunc (xx)
myFunc = myObject.someMethod()
end function
]]>
</msxsl:script>
Steve.

Nov 17 '05 #4

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

Similar topics

4
by: isee | last post by:
I want to send xml to some site and get response (also XML). I am using vb.net,but I don't want to install MSXML 4.0 .
6
by: Alfred Taylor | last post by:
I'm having performance/memory problems using .NET's XslTransform class so I thought I'd give the MSXML object's a whirl. The question I haven't been able to find in these groups is can I use C#...
4
by: Mathew | last post by:
Hi, I've got a problem and I haven't found any solution in the web till now. I'm using MSXML4.0SP2 with VC6 creating large XML files. The (only) problem I've got is the not-existing release of...
1
by: Kent | last post by:
I was wondering if there are direct equivelents in .NET to the objects provided by MSXML 4.0 dll. For example I need to send and recieve XML documents from an asp page. The example I was given uses...
0
by: Kent | last post by:
I was wondering if there are equivelents in .NET to the objects provided by MSXML 4.0 dll. For example I need to send and recieve XML documents from an asp page. The example I was given uses these...
3
by: Sharon | last post by:
How can I find what MSXML version I have installed? -- Thanks Sharon
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
3
by: balakrishnan.dinesh | last post by:
hi frnds How to determine the version of the MSXML installed on a computer and How to determine the version of the MSXML used by Internet Explorer through javascript code. Can anyone say me ,...
7
by: Edward | last post by:
Hello: I need to dynamically include documents stored in my own website. The website is coded in ASP. As far as I know there are two common options: FSO and the MSXML Objects. Which one of the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.