• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Xsl

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #81
    Originally posted by _V_
    And all of this IS BY DESIGN!!!!!!
    It is a sh1t design, calling it "functional" is adding insult to injury - there is nothing functional in this steaming crock of sh1t.

    Why node-set was not made compulsory function? Why they had to force the damn thing to rely on actual implementor doing their own version of this absolutely essential command? Why? Because they are sh1t designers who do not understand what programmers need in solving real world tasks.

    Comment


      #82
      Originally posted by AtW
      they are sh1t designers who do not understand what programmers need in solving real world tasks.
      Like most of these sort of things, XSLT was designed by a comittee using RFCs as input.

      It may not be perfect, but it's no where near as bad as you say Atw.

      You're just getting frustrated because you can't be bothered putting in the time to learn how to use the tool properly. And, of course, you always know best - being the eminent computer scientist that you (supposedly) are.

      V is right - XSLT is more of a functional language than a procedural one - and in that context 'functional' doesn't mean "it does lots of things".

      Read up about the difference between imperative programming (what you want it to do) and functional programming which is closer to what XSLT does.

      You've come right out the other side of the forest of irony and ended up in the desert of wrong.

      Comment


        #83
        Well put BM.
        First Law of Contracting: Only the strong survive

        Comment


          #84
          Originally posted by bogeyman
          Like most of these sort of things, XSLT was designed by a comittee using RFCs as input.
          Why they made node-set() function that turns tree fragment into node-set that is required in order to for-each it or do other things to it was not made mandatory and left up to implementators to implement or not to implement it, and in any case causing people to write code that will be specific to that implementor, ie msxml: prefix used for Microsoft stuff, what's the deep wisdom of such decision?

          I look newsgroups around and lots of people ask same simple questions: how to assign to variable, how to break out of the loop. At best answers are inefficient lengthy workarounds, at worst just redirects to FAQ, which would say you can't do it.

          Functional my arse - they have nice approach to match sets in XML using XPath, that's great (apart from limits in XPath but lets not get diverted), but wtf they had to to cripple programmer after giving him powerful matching set?

          XSLT is a false prophet - much like Chico's boss: a lot of promise, but once you try something non-trivial it become apparent that its a steaming crock of doodoo.

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

          Here is example: in a set I needed to calculate number of the first X elements that satisfied given condition and once element found that does not satisfy such condition I need to stop counting, ie:

          true
          true
          false
          true
          false

          When looking for number of first trueths I would need to get number 2. How do I get this in XSLT when I can't break the loop? Tell me, I found solution but maybe yours will be much better than mine (which is crap but due to XSLT design crapness).

          Comment


            #85
            Alexi,

            Why not have a shower and wash your hair. Have a good close shave. Maybe grab a beer from the fridge. Put on some music, and dance away while you put on your best duds.

            When you've done all that, and you've mellowed at bit, go out and have a night on the town.

            It's far more important to have a life rather than festering over the deficiencies of some obscure, transient technology.

            I really mean that.

            BM

            You've come right out the other side of the forest of irony and ended up in the desert of wrong.

            Comment


              #86
              Can you solve the above problem using XSLT or not, simple yes or no would suffice?

              Comment


                #87
                Alexei mate. You are still thinking in terms of loops and breaking out of loops.

                It don't work that way. You use XPATH to get all the nodes that match your condition and count them that way. No loops.

                It's Functional programming.

                No loops.
                No variables.

                You don't need em mate.

                PS. BM is right. Forgest XSLT. Go down the pub and tell some bird how rich you are.

                Comment


                  #88
                  Ok, its functional programming, fair enough - now show me how this functional programming will solve the task above - its very easy, I just want to know count of elements with given value (true), the answer for the above problem will be 2, now here is how it will work in any half-reasonable language:

                  int iCount=0;

                  while(iCount<bElems.Length)
                  {
                  if(bElems[iCount++]!=true)
                  break;
                  }

                  There are 2 key elements that used here: variables and breaking loops. The latter is not necessary (though for performance reasons its good idea to have it), but variable is necessary to accumulate count.

                  Now how fking more functionally can you get than that? Go on be honest say that you don't know how to do it with XSLT, you are excused without prejudice.

                  Comment


                    #89
                    Originally posted by AtW
                    Ok, its functional programming, fair enough - now show me how this functional programming will solve the task above - its very easy, I just want to know count of elements with given value (true), the answer for the above problem will be 2, now here is how it will work in any half-reasonable language:

                    int iCount=0;

                    while(iCount<bElems.Length)
                    {
                    if(bElems[iCount++]!=true)
                    break;
                    }

                    There are 2 key elements that used here: variables and breaking loops. The latter is not necessary (though for performance reasons its good idea to have it), but variable is necessary to accumulate count.

                    Now how fking more functionally can you get than that? Go on be honest say that you don't know how to do it with XSLT, you are excused without prejudice.
                    You can't do that because you don't need to. Simple as that. If you understand the paradigm behind XSLT fully you would realise that. You are trying to apply an algorithm to your templates. In functional programming their isn't really such a thing as an algorithm. Again, you don't need them.

                    Learn the tool before slagging it off. It'd be like me sitting here and slagging off .NET when I've never used it. I'd look like a fool...
                    Listen to my last album on Spotify

                    Comment


                      #90
                      PHP Code:
                      <xsl:value-of select="count(your xpath expression to select only the true nodes here"/> 
                      Yeah tuff stuff mate.

                      Loops, variables? I tulip em

                      Comment

                      Working...
                      X