Jump to content


Photo
- - - - -

you mofo old useless xslt 1.0 junk


  • Please log in to reply
3 replies to this topic

#1 amir

amir

    SuperNova III Member

  • Support Team
  • 2,141 posts
  • Location:Toronto
  • Interests:http://adagio.fm<br />http://entranced.fm/

  • Canada

Posted 15 August 2009 - 08:16 PM

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.



#2 usr.c

usr.c

    Boss, my code's compiling (xkcd)

  • Admins
  • 10,440 posts
  • Gender:Male
  • Interests:Software
    Soccer
    Photography
    RC cars
    Electronics

  • Nothing Selected

Posted 13 September 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.


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

#3 amir

amir

    SuperNova III Member

  • Support Team
  • 2,141 posts
  • Location:Toronto
  • Interests:http://adagio.fm<br />http://entranced.fm/

  • Canada

Posted 15 September 2009 - 01:40 AM

QUOTE(usr.c @ Sep 13 2009, 05:40 PM) <{POST_SNAPBACK}>
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!

#4 MaD_cOw

MaD_cOw

    No way... It compiles? SHIP IT!

  • Moderators
  • 609 posts
  • Location:Thunder Bay, Ontario Canada
  • Interests:Drumming,<br />Music,<br />Mountain Biking,<br />Modding,<br />Vintage Hardware,

  • Canada

Posted 20 March 2010 - 09:40 PM

QUOTE(usr.c @ Sep 13 2009, 01:40 PM) <{POST_SNAPBACK}>
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

Edited by MaD_cOw, 20 March 2010 - 09:49 PM.

-Mad_cow




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users