1
0
-1

Hi Unifacers,

is an HTML5 schema (html5.xsd) available somewhere?

I would like to load an html5 page into a struct.

Any other hint, tip ... suggestion?

Gianni

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Gianni, 

      Unfortunately HTML 5 is not strictly XML compliant. Some people are promoting XHTML as a standard but it doesn't seem to be popular and not supported by all browsers. 

      I found this page (https://wiki.whatwg.org/wiki/HTML_vs._XHTML) which gives a little more information.

      Regards,

      Mike

      1. Dino Seelig

        A) in the past you could find a DTD and not an XML-schema for HTML. B) HTML5 does not care of you create a well formed (X)HTML5 document or not. Both are valid in your browser. I prefer well formed HTML5 it saves a lot of work figuring out why the generated DOM does not fit your picture of the DOM. While generating don't forget that <script/> and <script></script> is not the same in HTML5. some element needs a closing element. for example script, textarea, div. XMLtoStruct does not need a XML-Schema. an XML-Schema is only for validation purpose. incase your document is wel formed, you can also use XSLT (Saxon or the in UF internally build in XALAN processor). Saxon3.0 supports Json. Success Dino.

      2. Gianni Sandigliano

        Hi guys,

        Thanks for those informations defined in your posts!

        what's in your opinion the best way to go from HTML to XHTML?

        After some search I am currently experimenting with tidy library. Is it a good pick?

        Any other suggestion?

        Best regards,
        Gianni

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Ciao Knut,

      Yes, being HTML a Markup Language too, my idea was to use:

            xmlToStruct/full/schema myStruct, myPage, anHTMLschema

      but I was not able to find any HTML schema definition...that's why I was asking!

      I do not like the idea to build an HTML parser to generate a Uniface struct... (sad)

      ...or it could be someone has already developed it! (smile)

      Gianni

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Gianni,

        I guess my 1st shot would be from HTML via XML or JSON - then xmltostruct / jsontostruct....

        Regards,

        Knut

          CommentAdd your comment...