XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
DL BirchSubject: Calling .Net classes from XSL during a transformation
Author: DL Birch
Date: 01 Aug 2008 11:07 AM
Hello,

A couple softballs from the newbie on the block:

I need to tranform a file ... using the ss mapper how do I:

1) Translate a code value that comes in .. let's say its a string containing "US" representing a 'Country' and in my system I need to translate that to "USA" ...

2) How do I call my own .net classes from within the XSL during a transformation?

Regards,

DL Birch

Postnext
Alberto MassariSubject: Calling .Net classes from XSL during a transformation
Author: Alberto Massari
Date: 04 Aug 2008 06:54 AM
Hi,
Mapper only supports registering Java extension functions; in order to use .NET extensions functions you need to use the MS .NET processor and follow its documentation (e.g. here http://msdn.microsoft.com/en-us/library/system.xml.xsl.xsltargumentlist.addextensionobject(VS.80).aspx) to invoke the processor from within your .Net code specifying the extension object that the XSLT will use.

As for doing lookup in Mapper, it's doable but it requires a lot of instructions blocks; it's faster to directly write in the text view a compact predicate expression like $allCountries[@id=$thisCountry] (assuming you have a global variable named allCountried containing nodes with an 'id' attribute with the short version and a child text node with the expanded version)

Alberto

Postnext
DL BirchSubject: Calling .Net classes from XSL during a transformation
Author: DL Birch
Date: 04 Aug 2008 12:35 PM
Alberto,

Thank you for the tip on calling .net classes straight from the XSL.

Awesome! This makes my little conversion project much more straightforward.

I've given it a go already and the result works quite well.

Regards,

DL

Postnext
DL BirchSubject: Calling .Net classes from XSL during a transformation
Author: DL Birch
Date: 04 Aug 2008 12:39 PM
My only question then is (now that I can call my own .net assembly straight from the XSL) is how I can get this to work in the Preview mode of the XSL Mapper tool.

When I run the XSL from my VB.Net app, everything works swell. It just would be nice to be able to test it all right from Stylus Studio ...

Regards,

DL

Postnext
DL BirchSubject: Calling .Net classes from XSL during a transformation
Author: DL Birch
Date: 04 Aug 2008 12:59 PM
My only question then is (now that I can call my own .net assembly straight from the XSL) is how I can get this to work in the Preview mode of the XSL Mapper tool.

When I run the XSL from my VB.Net app, everything works swell. It just would be nice to be able to test it all right from Stylus Studio ...

Regards,

DL

Posttop
Alberto MassariSubject: Calling .Net classes from XSL during a transformation
Author: Alberto Massari
Date: 05 Aug 2008 04:16 AM
Hi,
as you can see, the extensibility model for the .NET processor requires a that the code that invokes the XSLT processor knows the extension classes, so Mapper cannot do it in a generic way. Your only option is to compile your VB.NET app into an executable and use the "custom processor" entry in the Processor tab of the XSLT scenario to run it.

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.