SitePoint Sponsor

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 93

Thread: Xsl Xslt

  1. #51
    SitePoint Enthusiast mjlivelyjr's Avatar
    Join Date
    Dec 2003
    Location
    Post Falls, ID, US
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You know, I actually agree with you. I usually have alot of input into who my firm hires and if I come across an applicant that is unable to learn he/she does not even have a snowballs chance at getting the job. It's one thing if someone doesn't know a technology. In my experience open minds are able to learn just about anything when given the right materials. If you refuse to learn though, all you do is hold back your organization.

    Now that's not to say we should all go out and learn XSL right now. Learn it when you need to (or when you want too, whichever comes first.) That's the principle I tend to follow and it works out well. Granted the older I get the harder it gets to remember new things...is it the memory that goes first?

    So, I guess my whole opinion on the matter is that it's silly to expect everyone to use XSL and it's silly to think anyone can't learn XSL. Use what works best for your clients and/or your organization. Just make sure you are aware of the consequences...all decisions have pros and cons no matter which way you slice it
    Mike Lively
    Digital Sandwich - MMM MMM Good

  2. #52
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    If a script t's what it should do, not generate XML in the middle somewhere. If the script is just responsible for getting data out of the database so that other scripts can convert the data into HTML, PDF, etc, then yes, XML is "the standard".
    Why do you have to generate XML in the middle? What is an XSL client?

    The fundamental problem with XSL is that it requires alot of work to implement a feasible solution. Currently knowledge of XSL is transparent to the staff as well as the 'editorial team'. Does the designer need to know XSL? No. To answer the initial question "mwmitchell" - "Why aren't people using XSL instead of PHP template engines?" Misinformation, and enforcing transparency of the above is difficult.

    Edit:


    Off hand, i'm not sure of valid reasons to implement XSL on small scale sites. If you come up with any let me know

  3. #53
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Andrew-J2000
    Why do you have to generate XML in the middle?
    You need some XML to to apply the XSL transform to don't you? You could use a DomDocument and then the XML exists only as a tree, but you are still generating XML right?

    What is an XSL client?
    Sloppy language on my part: anything using XSL to transform XML into XML, though I did mean any client that can accept XML input and do something with it.

    Perhaps you are doing something fundamentally different from what I have done with XSL. What are you using XSL for?

    Douglas
    Hello World

  4. #54
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    Bucharest
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And I was just thinking to use/develop a template system based on XML/XSL after I saw this kind of simplicity and replace the smarty engine.
    Because, I was thinking, what if after a while I will need a WML output (insteard of HTML or XHTML) for a web site?
    If I would have the page as XML and a simple transformation using XSL will allow me to output whatever I want (WML,HTML or why not WXML).
    And, this is only a php 5 thought.

  5. #55
    SitePoint Evangelist
    Join Date
    Dec 2003
    Location
    Arizona
    Posts
    411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can still use WYSIWYG editors (e.g. Dreamweaver, FrontPage, etc.) with XSLT if you use the "Simplified Syntax":

    http://www.w3.org/TR/xslt#result-element-stylesheet
    http://www.sitepoint.com/forums/show...65&postcount=1

    Altova also makes some powerful tools for visual development of XSLT stylesheets:

    http://www.altova.com/products_xsl.html

    Although not as prevelant as other technologies, there is tool support for XSLT.

    Thanks,

    JT

  6. #56
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally I disagree with the argument of "too slow? buy more hardware" as that just smacks of not actually correctly scoping the project in the first place. I don't believe many of my clients would buy the excuse of "get another server" because I decided to use a method to create their site that was significantly more inefficient than it could have been. But I guess the smaller the system the less noticeable this is anyway.
    I agree completely - throwing a server at it isnt the right answer! While a few hundreths of a second or second slow downs are acceptable, a 10x increase can hardly be classified in the same category.

    Quote Originally Posted by Tony Marston
    In some cases being able to produce an application in 6 weeks is more important than waiting 6 months. If performance starts becoming a problem then you have to compare the costs of rewriting the software or adding in more hardware. If you can achieve the same speed increase by spending $1,000 on hardware or $5,000 on a programmer which would be more cost effective?
    If there is a four month difference in development time soley because of the presentation method, the developer should probally be reevaluated as a fit for the job.

    Quote Originally Posted by Andrew-J2000
    Just to throw something in, why do the largest organizations use XSL? WallStreet, BBC, Adobe, Microsoft, MTV, Disney?

    Most current PHP templating solutions are not feasible in a clustered load balanced environment, now to beg the question, why go for an XSL based templating solution? With effective caching aspects as mentioned above are pretty insignificant.

    Off Topic:


    Just to fuel the debate
    But they dont use PHP anyways. Effective caching systems can be easily done with PHP; and many developers dont even realyl utilize all the tools avaliable. If you have a dedicated server, us the shared memory to save a ton of execution time. Throw the DB on a seperate server, and cluster / replicate that. Store files on a third one - in many cases, this is more then enough.

  7. #57
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by fastwork
    And I was just thinking to use/develop a template system based on XML/XSL after I saw this kind of simplicity and replace the smarty engine.
    There isn't any XSL in that example

    You still have to generate the XML input for for simplexml, but otherwise it is really just a standard PHP template with data stored in simplexml rather than custom objects or associative arrays. Might be useful, would have to give it a proper try out.

    Douglas
    Hello World

  8. #58
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your designer cares about web standards, they are going to be pissed that they can't use a <ul> in their templates without calling up the programmer.

    IMO, the template should have all the presentation, not just a header and a footer.

    Code:
    <xsl:template name="links">
      <xsl:for-each select="links/link">
        <a href="{href}"><xsl:value-of select="name"/></a><br/>
      </xsl:for-each>
    </xsl:template>
    If I (as a designer) wanted a list of links in an html list, I'd want code like this:

    HTML Code:
    <ul>
    <li><a href="">ccc</a></li>
    <li><a href="">bbb</a></li>
    <li><a href="">aaa</a></li>
    </ul>
    To get your XSL working, you'd have to make another template. Small example, but then the original was hardly building a whole page either.

    Douglas
    Hello World

  9. #59
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Super Phil
    But they dont use PHP anyways. Effective caching systems can be easily done with PHP; and many developers dont even realyl utilize all the tools avaliable. If you have a dedicated server, us the shared memory to save a ton of execution time. Throw the DB on a seperate server, and cluster / replicate that. Store files on a third one - in many cases, this is more then enough.
    Quote Originally Posted by MySelf
    MTV you'll have to take my word for it, as i'm currently developing their internal site and its currently running on clustered enviroment utilizing PHP5. (PHP5 was their request, MTV's).
    You'll be surprised at the number of large scale php applications there are, and your quite right there is alot of unused functionality in PHP. Doug, you can run an entire site from just one root element, you have the option of off-loading the creation of XML to the data tier, and simply passing that straight to the XSL processor. You also assume there is no cohesion between developers and designers. Your example simply sounds counter-intuitive to me.

    Off Topic:


    *Web Applications seems to have grown on me, damn .NET.

  10. #60
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Andrew-J2000
    Your example simply sounds counter-intuitive to me.
    Me too

    Are you describing something similar to this? With XML between the middle two?
    http://fox.wikis.com/wc.dll?Wiki~Fou...re~SoftwareEng

    I've not written a clustered app before, though Phil's PHP/DB/Static set of servers makes sense to me; but I don't know where XML could come into that picture.

    Sorry for being a noob

    Douglas
    Hello World

  11. #61
    SitePoint Addict Brak's Avatar
    Join Date
    Jul 2004
    Location
    Central Coast, CA
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something that hasn't really been brought up, is the interchangability of XSL. XSL is a uniform templating language, applicable across multiple platforms and system configurations.

    I work at a web firm where there is an Engineering department, and a Web Production (HTML coding) department (among others). The advantage of using XSL is the Engineers can create usable applications without knowing any HTML or presentation. It also allows our Web Production team to work with the data without knowing any real programming, or how the application works. We just need the XML, then build the XSL and wa-la! You have a fully skinned, fully functioning site.

    Now, in the real world you will find that application development (engineering) happens while the site is being developed (Web Production). Having a flexible medium (XML) between the two (engineering, presentation) is invaluable. This kind of thinking is a major benefit to our workflow. Also, it allows engineers to work better as a team. They simply develop XML standards, and each person can create their own section (product catalog, cms, etc) and have it plug into the framework flawlessly.

    I don't really believe people will understand the benefit of XML/XSL until you work on Enterpreise applications with dozens of people on a project at once. You need a common language - and XML is that language.
    Studio Rockstar's Blog - A journey to quitting the dayjob.

  12. #62
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XSL will become famous soon enough, once M$ starts to REALLY use it

  13. #63
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YEAH, XSL RULEZ

    Resistance is futile, you will ALL be assimilated.

  14. #64
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do you have to generate XML in the middle? What is an XSL client?
    The real advantage (and I don't know if someone allready mentioned it) is that you REALLY separate bussines from presentation.

    And XML is the connection. You have to have some connection. And XML, since it's a standard, it's the best one.

    3-tier developing really works with XSL.

  15. #65
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    3-tier really works without XSL too! The thing I like about XSL is report creation, let a webservice spit out xml's and put an XSL over it(together with a little css and some javascript for sorting) you can create a nice looking report and people just filter out the data they need for their report through different xsl's reusable and all.

    Never found an other interresting use for it.

  16. #66
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XSL will become famous soon enough,
    Sod Microsoft, XSL is already famous without the likes of Microsoft

  17. #67
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    true, but M$ will commercialize it, if the see an interest in it

  18. #68
    SitePoint Zealot ohnnyj's Avatar
    Join Date
    Jun 2003
    Location
    California
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have dabbled in an XSL/PHP combination and after reading through the entire discussion here I am beginning to see the utilization of XSLT as benefiting larger applications, as others have already pointed out.

    I was using it for a simply blogging system and found that in order to get output just the way I desired took a significant amount of effort. My main XSL file became nearly 1000 lines long. I'm not sure if this is typical but that seems a bit long winded.

    Now I am not the world's expert on XSLT and so maybe my file wasn't as optimized as it should be but from the research I have done on the subject, the implementation I came up with seemed to be the only way to get the output generated as needed.

  19. #69
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always cut up an xslt in smaller template-parts

  20. #70
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been trying to get some more information about xsl also.. but what i dont get from it, is that why does it needs an extra 'layer' if you use a database would it not be far easier, and faster to directly output in xhtml.

    This is to say that you will only use it as a website for normal browsers and dont use it to display it on various devices like handhelds and mobilephones.. as i can see that it could be usefull there.

    MySQL -> PHP -> XHTML

    or

    MySQL -> PHP -> XML & XLS -> XHTML

    I just don't understand how i can benefit from putting in extra effort in writing a xml doc first and then a xls which only outputs xhtml while i could have been writing xhtml in the first place?

    Perhaps somebody would care to explain

    Also if i look at xls file i dont think it really improves the readability of an html document since it is all inside xml tags? pure html is easier to read and write i think.
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  21. #71
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You said it partialy alreay... Different devices, or an other possibility: different views.... eg. Managers will need different info out of this xml than sales.

  22. #72
    SitePoint Guru
    Join Date
    Jul 2004
    Location
    Netherlands
    Posts
    672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So basically if i want to design my site purely for desktop this technology is really not recommended because of the extra effort..

    Quote Originally Posted by momos
    You said it partialy alreay... Different devices, or an other possibility: different views.... eg. Managers will need different info out of this xml than sales.
    Go visit my site :-D you know you want to ;-)
    www.mech7.net

  23. #73
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been trying to get some more information about xsl also.. but what i dont get from it, is that why does it needs an extra 'layer' if you use a database would it not be far easier, and faster to directly output in xhtml.
    That's the point. You said it allready. Why do you think all this talk about template managers. Because template managers attept to separate business from presentation. But the presentation layer is (or at least should be) a different application layer.

    The benefits are the following: you can change whenever you want your presentation layer without modifying the bussines layer. Say that after 6 months, a client of yours says that he had heard of XUL or Avalon or a Java app deployed through Java Web Start, or Macromedia Flash and wants to have a new interface based on one of those but also wants to keep the old version. And he wants it fast. What are you going to do ?

    Rebuilding the whole application mentioned above is the only solution if your architecture is the one mentioned:
    DATABASE -> PHP -> XHTML
    because you have to heavilly modify the PHP part.

    But with an architecture like this:
    DATABASE -> PHP -> XML -> XSL -> XHTML
    you can always cut the chain from XSL and transform it like this:
    DATABASE -> PHP -> XML -> MACROMEDIA FLASH

    And that's called a 3-tier application.

    So basically if i want to design my site purely for desktop this technology is really not recommended because of the extra effort..
    Yes, but that's not 3-tier. That's 1-tier. And desktop applications are not taken into account here.

  24. #74
    SitePoint Zealot cholmon's Avatar
    Join Date
    Mar 2004
    Location
    SC
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pixelsoul
    I just don't understand how i can benefit from putting in extra effort in writing a xml doc first and then a xls which only outputs xhtml while i could have been writing xhtml in the first place?
    The idea behind it is that it essentially makes your PHP cleaner. If you are generating a page from several records of a database result set, say a list of products, your PHP will be cleaner if all you have to worry about generating is something like:

    Code:
       <products>
          <product id="12345" catid="5" rating="3.9">
        	<name>How to build a PHP website in XSL</name>
        	<price>25.95</price>
        	<thumbnail>how_to_php_xsl.jpg</thumbnail>
          </product>
       
          <product id="54321" catid="5" rating="4.0">
        	<name>Templating systems in PHP</name>
        	<price>29.95</price>
        	<thumbnail>tpl_php.jpg</thumbnail>
          </product>
       </products>
    This would be easy to create with PHP (either with a bunch of echo's or with the DomDocument class).

    ...then put all the the XHTML inside of some XSL stylesheets. The alternative that you stated, "writing xhtml in the first place", could be done straight from the PHP and often is, but it's difficult to do and have nice-looking, easily changeable code. As I'm sure you're aware, templating systems in general exist to address that problem, and most of them behave in a similar way:




    • hit the db and do other business logic
    • put all results in some easily readable/parseable format (array, xml, etc)
    • invoke a template engine to grab the data and put the pieces together into a nicely formatted html document.
    With XSL, we use XML as the container for the data and XSL as the template. With Smarty, you use the smarty object as the container and the smarty template engine (Smarty:display()).


    basically, you add another step (or two) in the process (SQL->PHP->XML->XSL->XHTML) in order to make each step a little bit simpler.

  25. #75
    SitePoint Zealot cholmon's Avatar
    Join Date
    Mar 2004
    Location
    SC
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ohnnyj
    My main XSL file became nearly 1000 lines long. I'm not sure if this is typical but that seems a bit long winded.
    Holy crap, what kind of page was it?

    Last year I had to do something similar. It was an employment application that ended up being 8 pages when printed out. the XSL for that thing was about 1200 lines long and it took about 10 seconds for the XHTML form itself to get fully generated and sent back.

    I find that the best thing to do when using this method is rely alot on CSS with the finished product That way the HTML is as small and simple as possible (a la css zen garden). the worst thing in the world, with any templating system, is generating loads of nested tables. it's alot easier to spend some design time up front and have a nice clean HTML layout, that way the XSL's job is a breeze.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •