Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chris D 17 posts 37 karma points
    Jan 29, 2013 @ 22:54
    Chris D
    0

    Does anyone know where i can find actual code examples of XSLT files?

    I am looking for the following: 

    1) Example of XSLT SQL query.

    2) Example of a contact form written in XSLT.

    3) Example of a Login Page in XSLT

    4) Example of Navigation written in XSLT. 

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 30, 2013 @ 00:19
    Lee Kelleher
    3

    Hi Chris,

    Curious as to why you'd like examples of these in XSLT?  Is it to prove that they can be in within XSLT, or another reason?

     

    For executing a SQL statement from XSLT, there are a couple of packages offering that functionality:

    http://our.umbraco.org/projects/developer-tools/sql-for-xslt-(jespercom)

    http://our.umbraco.org/projects/developer-tools/a-sqlhelper-for-xslt

     

    As for a contact form and login page - honestly these are better suited as user-controls (.NET code).  They can be done in XSLT, but it isn't pretty.

     

    Lastly, navigation is best suited for XSLT.  Examples can be found via the Umbraco back-office; in the Developer section, right-click the XSLT tree, select Create and choose from the list of available example XSLT templates.

    Cheers, Lee.

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jan 30, 2013 @ 09:19
    Chriztian Steinmeier
    1

    Hi Chris,

    Just to chip in, though I agree with Lee:

    You should think of XSLT as one (of several) way(s) to generate markup. It is not in any way a round-trip language (my own term for the .NET like postback behavior) so you shouldn't do any "controller" like stuff in XSLT. It's purely a "view" language very well suited for XML data. 

    • SQL - While I understand the reasons for the various packages available for this, I think it's the very wrong place to do that sort of behavior.
    • Contact Form - Actually XSLT is good for this, as long as you only handle the form generation - combined with a serverside control to handle the post and updating the model/datastore it could provide for a nice solution where the backend developer does everything he needs, leaving all the frontend form code to the frontend developer - huge win for both :-)
    • Login Page - same as above.
    • Navigation - If the data is an XML tree (like Umbraco), there's no better tool for this job - only problem is that (almost) every site has it's own little quirks in how the navigation should behave, so almost every "all-purpose" navigation package becomes a huge mess of configurations & conditionals. Starting from scratch with a couple of simple templates usually gets the job done much more efficiently. Look here for more about navigations and XSLT 
    /Chriztian
  • Chris D 17 posts 37 karma points
    Jan 30, 2013 @ 15:47
    Chris D
    0

    Thanks for the input guys.. I am purely looking to tackle XSLT everyway i can. Ive really only used it to read or output XML in the past, so today after writing a couple of XSLT <ifXSLT <choose> I wanted to dive alittle bit more into this since everyone is demanding XSLT HTML5 and JSON because it's the " New Fad or Big Thing" of development and design. 

    I've just dove into Umbraco maybe 3-4 weeks ago, im starting to get comfortable with it but I want to master XSLT if i can and kill two bird with one stone. 

    By the way, a Contact Form and Login Pages completely in XSLT would be lovely if you can point me to one.,. 

  • Chris D 17 posts 37 karma points
    Jan 31, 2013 @ 15:33
    Chris D
    0

    By the way, a Contact Form and Login Pages completely in XSLT would be lovely if you can point me to one.,. 

Please Sign in or register to post replies

Write your reply to:

Draft