Generate valid XHTML

Discussion in 'XML' started by Anna, Feb 18, 2004.

  1. Anna

    Anna Guest

    Hi all.
    I have probably a rather stupid question.
    If there is an HTML document, XML-formed using JTidy,
    is there any tool to convert it to valid XHTML?
    I.e. so that all the tags and attribute values will be XHTML compliant.
    For example, if the original document has following snippet:
    <p><div>text</div></p> (which is not valid XHTML), the output
    would be something like <p><span>text</span></p> (which is valid XHTML).

    Thank you very much for help.

    Anna
     
    Anna, Feb 18, 2004
    #1
    1. Advertising

  2. * Anna wrote in comp.text.xml:
    >If there is an HTML document, XML-formed using JTidy,
    >is there any tool to convert it to valid XHTML?
    >I.e. so that all the tags and attribute values will be XHTML compliant.
    >For example, if the original document has following snippet:
    ><p><div>text</div></p> (which is not valid XHTML), the output
    >would be something like <p><span>text</span></p> (which is valid XHTML).


    Well, I am not that familiar with JTidy, but Tidy attempts to do that to
    some extend. Current Tidy would turn that fragment into

    <div>text</div>
    <br />
    <br />

    which is bad but valid. If you specify the --drop-proprietary-attributes
    config option, it would even drop all non-W3C attributes from all
    elements, Tidy even tries to convert some known proprietary elements to
    other elements, CSS, characters, ... whatever might fit. In fact, if the
    result with --drop-proprietary-attributes enabled is not valid, it is
    probably a bug and should be reported (this does not apply to invalid
    attribute values for valid attributes, Tidy fixes some, but quite a
    number cannot be fixed, just dropped, but there is currently no config
    option to do that.)
     
    Bjoern Hoehrmann, Feb 18, 2004
    #2
    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. Replies:
    7
    Views:
    951
  2. chronos3d
    Replies:
    9
    Views:
    832
    Andy Dingley
    Dec 5, 2006
  3. Usha2009
    Replies:
    0
    Views:
    1,174
    Usha2009
    Dec 20, 2009
  4. xhtml champs
    Replies:
    0
    Views:
    564
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,083
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page