XHTML - Doctype and output

Discussion in 'XML' started by johkar, Oct 8, 2004.

  1. johkar

    johkar Guest

    What is the proper doctype syntax for XHTML transitional??? Strict? How
    come XSLT doesn't preserve XHTML when it is compiled (Xalan)? Meaning, <br
    /> tags become <br> <input /> tags become <input> etc. It seems I am dazed
    and confused? Any hints or clear online resources appreciated.

    John
    johkar, Oct 8, 2004
    #1
    1. Advertising

  2. johkar wrote:

    > What is the proper doctype syntax for XHTML transitional??? Strict?


    http://www.w3.org/QA/2002/04/valid-dtd-list.html

    > How come XSLT doesn't preserve XHTML when it is compiled (Xalan)?
    > Meaning, <br /> tags become <br> <input /> tags become <input> etc.


    Maybe you have it set to generate HTML output.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Oct 8, 2004
    #2
    1. Advertising

  3. johkar wrote:

    > What is the proper doctype syntax for XHTML transitional??? Strict? How
    > come XSLT doesn't preserve XHTML when it is compiled (Xalan)? Meaning, <br
    > /> tags become <br> <input /> tags become <input> etc. It seems I am dazed
    > and confused? Any hints or clear online resources appreciated.


    Well the XSLT 1.0 output method html is supposed to output according to
    HTML rules and not XHTML rules thus if you have
    <xsl:eek:utput method="html" />
    or you happen to have a root result element
    <html>
    then the XSLT processor uses the html output method and in HTML a br
    element in the tree needs to be serialized as <br>, an input element in
    the tree needs to be serialized as <input>. See
    http://www.w3.org/TR/xslt#section-HTML-Output-Method

    Thus if you want to have XHTML as the result of an XSLT 1.0
    transformation you need to use
    <xsl:eek:utput method="xml" />

    Some processors (like Saxon for instance, I don't know about Xalan) also
    know a special output method called xhtml that outputs XHTML according
    to the HTML 4.01 backwards compatibility rules given in the XHTML 1.0
    specification.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Oct 8, 2004
    #3
  4. johkar

    johkar N Guest

    Thank you both for the replies and good info.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    johkar N, Oct 9, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tjerk Wolterink

    XSLT XHTML MIX DOCTYPE PROBLEM

    Tjerk Wolterink, Feb 11, 2005, in forum: XML
    Replies:
    13
    Views:
    1,134
    David Carlisle
    Feb 14, 2005
  2. Tatyana
    Replies:
    1
    Views:
    1,186
    Alan Silver
    Aug 8, 2006
  3. Rolf Welskes
    Replies:
    6
    Views:
    1,441
    Steven Cheng[MSFT]
    Aug 24, 2006
  4. John
    Replies:
    1
    Views:
    573
  5. Larry Lindstrom
    Replies:
    19
    Views:
    1,268
    Jonathan N. Little
    Jun 12, 2012
Loading...

Share This Page