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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1182)
- Stylus Studio Technical Forum (14570)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-> + Problem with SAXO processor - ... (5)
-> + PDF Format Help (4)
-> + License check unreliable (2)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7617)
+ XQuery Help and Discussion (1971)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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
(Deleted User) Subject: Calling .Net classes from XSL during a transformation
Author: (Deleted User)
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
(Deleted User) Subject: Calling .Net classes from XSL during a transformation
Author: (Deleted User)
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

   
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.