Sign In/My Account | View Cart  
advertisement

Article:
 Migrating to XForms
Subject: XHTML
Date: 2006-11-02 00:35:39
From: iconara

"Our goal here is to take an XHTML document containing one or more standard forms, convert the forms into XForms format while preserving all of the information, and generate a new XHTML document as a result."


It's funny then, that you bother with preprocessing things like checked, diabled, since they wouldn't be allowed in an XHTML document anyway.


What you have done in this article is showing us how we can write a simple XML transformation utility. I have a better idea, since we are transforming XML (XHTML) into XML, why not use XSL, and get the transform engine for free. Just write the rules and you're done. I bet it would be around 20 lines of XSL, instead of this mess of half-readable PHP (not all your fault, PHP is notoriously hard to make readable).


XSL isn't even mentioned in the article, come on isn't this XML.com?


No Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • XHTML
    2006-11-02 06:10:58 sobes

    Hi there, thanks for your feedback.


    It's funny then, that you bother with preprocessing things like checked, diabled, since they wouldn't be allowed in an XHTML document anyway.


    True. However, they are quite common in an HTML document containing standard form tags. Therefore, we handled these cases so we could preserve all information in the original HTML forms document.


    What you have done in this article is showing us how we can write a simple XML transformation utility. I have a better idea, since we are transforming XML (XHTML) into XML, why not use XSL, and get the transform engine for free. Just write the rules and you're done. I bet it would be around 20 lines of XSL, instead of this mess of half-readable PHP (not all your fault, PHP is notoriously hard to make readable).


    PHP allows us the flexibility of handling input files that are either XML, XHTML, or even poorly written HTML. XSL would only work for XML input. As mentioned, HTML forms rarely fit this input requirement. Admittedly, at some points in the article I should have used the term, "HTML" instead of "XHTML." Sorry for the confusion.


    XSL isn't even mentioned in the article, come on isn't this XML.com?


    The purpose of the article was to show how PHP can be used to migrate existing HTML to XForms, not to discuss the various ways that this could be done. More time could have been spent explaining why this implementation strategy was chosen over another (e.g. you mention XSL), but this would mean less time spent on explaining the actual implementation.


    As far as the topic and its relevance, XForms is an XML implementation that is frequently covered on XML.com. In addition to the references in the article, check out Getting Started with XForms (http://www.xml.com/pub/a/2003/12/30/xforms.html) and Interactive Web Services with XForms (http://www.xml.com/pub/a/2001/09/26/xforms.html) .


    Paul Sobocinski
    (author)


Sponsored By: