CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> you mofo old useless xslt 1.0 junk, or xslt custom extensions
amir
post Aug 15 2009, 08:16 PM
Post #1


SuperNova III Member
Group Icon

Group: Support Team
Posts: 2,141
Joined: 2-November 02
From: Toronto
Member No.: 302

Canada




i wish firefox bookmark organizer had a counter to see how many bookmarks are sitting in there. even thinking about how big the number could be scares the crap out of me.

as the greatest boss of mine asked for, I looked into my bookmarks & found some precious piece of url to some article which I have summarized it here:

if you need to have your xml processor do something fancy for you & if the processor happens to be either of MS ones (MSXML or .Net), then forget about begging old XPATH/XSLT 1.0 to do it for you. write your own nasty piece of code (a .Net language or JS/VB for MSXML) & put it right in the middle of the xslt file & have the processor suck it up! (while saying : you mofo old useless xslt 1.0 junk, now eat this! i don't need ur built-in crap! )

CODE
<xsl:transform version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:ms="urn:schemas-microsoft-com:xslt"
   xmlns:havingFun="csharp.xslt.ext">
     <xsl:output method="text"/>
     <ms:script language="C#" implements-prefix="havingFun">
         <![CDATA[    
         public string HaveFun(string str)
         {            
             return "Having Fun Now with " + str;
         }    
     ]]>
     </ms:script>    
     <xsl:template match="/">        
         <xsl:value-of select="havingFun:HaveFun(/items/item[1])"/>
     </xsl:template>
</xsl:transform>


of course the point is that XSLT built-in functions are limited & can't do every crazy thing my boss asks for.

I don't know why that article is that long but the whole trick is the

CODE
     <ms:script language="C#" implements-prefix="havingFun">


& there must be a non-MS tag too somewhere out there.

Go to the top of the page
 
+Quote Post
usr.c
post Sep 13 2009, 05:40 PM
Post #2


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




XML tends to be verbose, much like Java, which tends to be a pain in the backside a lot of the time.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
amir
post Sep 15 2009, 01:40 AM
Post #3


SuperNova III Member
Group Icon

Group: Support Team
Posts: 2,141
Joined: 2-November 02
From: Toronto
Member No.: 302

Canada




QUOTE(usr.c @ Sep 13 2009, 05:40 PM) *
XML tends to be verbose, much like Java, which tends to be a pain in the backside a lot of the time.


i think the writer of the article won't get paid if his article is as short of mine!
Go to the top of the page
 
+Quote Post
MaD_cOw
post Mar 20 2010, 09:40 PM
Post #4


No way... It compiles? SHIP IT!
Group Icon

Group: Moderators
Posts: 609
Joined: 27-December 04
From: Thunder Bay, Ontario Canada
Member No.: 2,133

Canada




QUOTE(usr.c @ Sep 13 2009, 01:40 PM) *
XML tends to be verbose, much like Java, which tends to be a pain in the backside a lot of the time.


But Java is an ENTERPRISE SOLUTION.
Verbosity is needed for something like that wink.gif

This post has been edited by MaD_cOw: Mar 20 2010, 09:49 PM


--------------------
-Mad_cow
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd May 2013 - 10:12 AM