• 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

    Originally posted by DimPrawn
    @my-value='false' and not(ancestor::*/preceding-sibling::row/entry/@my-value='false')
    Well done DP, more or less all that's needed.

    Originally posted by AtW
    You have not offered the solution - DimPrawn did, even though I strongly suspect that performance will suffer for long sets, but then again I would not use XSL for performance critical operations, even though clearly having small loop that will abort quickly will always be faster - so much for functional way of doing things being better, eh?
    You sort of miss the point AtW, perhaps in this instance XSLT might be slower, certainly if the preceding clause requires a recursive lookup of all the previous nodes, but that's not what it was designed for.

    Like my comment about SQL, sometimes the best way to do something is simply using pure ANSI SQL, e.g, bulk update etc. "UPDATE blah blah blah WHERE...", sometimes you need another sort of control.

    In which case why b*rstardise the thing and add TSQL/PLSQL etc. as a hack, instead of simply leaving it to do what it does best and using something like ADO etc. to access a resultset when you need to manipulate things in another way?

    Comment


      Originally posted by Joe Black
      instead of simply leaving it to do what it does best and using something like ADO etc. to access a resultset when you need to manipulate things in another way?
      There is a reason why to keep some simple logic in SQL, like loops, vars etc - this brings huge performance benefits if you have complex logic that can sit nicely in a stored procedure - there is no network overheads sending data back and forth for ADO.net or anything else to do some simple processing, then send results back to execute more stuff: network overheads are not small and a nice stored procedure with loops/vars inside it will beat separate SQL statements with ADO.net logic.

      Kudos to DP that he got I think better solution than mine (though both will suck badly with any serious dataset - I bet it will check back recursively, so this is timebomb waiting to slow down).

      XPath is like SQL, but its light weight and not designed for heavy duty data because this requires indices etc. XSL is simple logic around XPath to manipulate the data - there is no reason whatsoever to cripple the language only for the sake of calling it "functional".

      XSLT people do know that its rubbish in respect of actual programming ability - programming time is not cheap and making loop is literally 10 seconds typing work and I can move on, where as DPs solution requires much more thinking. Don't believe me?

      Look here: What's new in XSLT 2.0

      Quote: "you will discover that the real power lies in the use of XPath 2.0 to define the result in the select attribute of the xsl:result element. As you may recall, XPath 2.0 includes the ability to do conditional expressions (if...then) and iterative expressions (for...return)."

      They also done away with stupid tree fragments that could not be queried - so that no need for node-set function (that's not part of standard XSLT 1).

      See, they clued up a bit that this kind of BS time waste is just slowing down adoption big time, so they added things that make programmers productive.

      Gotta check now which version .NET 2.0 supports. The answer to this seems negative: http://blogs.msdn.com/dareobasanjo/a...13/131166.aspx
      Last edited by AtW; 31 August 2006, 20:18.

      Comment


        Errr execution time *is* cheap compared to my daily rate. Perhaps it isn't compared to yours - what is your rate again ?

        Comment


          Well the main thing is we all lived happily ever after.

          Now, mods, banish this thread to Technical please.

          Comment


            I've really only skip-read this thread, but it sounds as if someone is determined to buy a caravan and expect it have all the facilities of a house...

            XSL(T) is an amazingly useful tool.... with XML being the increasingly 'best common denominator' - as opposed to being the 'lowest common demoninator'.

            Having worked in publishing, with the transition from SGML to XML etc, it is quite an achievement to offer such a flexible format.

            It would be great to have the ability to do X with Y language, but in reality, it is simply impossible to dictate that every way of programming / accessing data or objects should exhibit every functionality.

            And, that is basically what we are paid for, just like plumbers and builders - knowing which building materiels, and which tools, to use to solve a given problem.

            It's like complaining that bricks do not make good tiles for my bathroom, Alexei....
            Vieze Oude Man

            Comment


              P.S I agree with Dim Prawn .
              Vieze Oude Man

              Comment


                Originally posted by DimPrawn
                Now, mods, banish this thread to Technical please.
                No no no, this thread is a rant, much like other threads in General - I hope it will get to 1000 posts, even though that Test, Please Delete thingy really raised the barrier ...

                Comment


                  Have you tried Schönfinkelisation ?

                  Comment


                    Yes I have. Chicken Vindaloo is the best.
                    First Law of Contracting: Only the strong survive

                    Comment


                      Originally posted by _V_
                      Yes I have. Chicken Vindaloo is the best.
                      Doesn't that make your helmet smart a bit?

                      Comment

                      Working...
                      X