xml, html or xhtml in : Which is the better choice?

后端 未结 3 1753
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-20 15:20

For historic reasons we have a mixture of


and


         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 15:58

    HTML will serialize as HTML, so the output may not be well-formed XML. If you are only sending to browsers and don't care about being able to parse as XML then that may work for you.

    XML will serialize as XML, so the output will be well-formed, but you may run into some issues with browsers using the output. Small things, like self closing )

    If you have an XSLT 2.0 engine and want well formed HTML output without the headache of worrying about how some elements are serialized, then use XHTML.

提交回复
热议问题