Questions tagged [polyglot-markup]

Polyglot markup is a polyglot HTML document that has been written to conform to both the HTML and XHTML specifications. A document in polyglot markup can therefore be parsed as either valid HTML or XML, and will produce the same DOM structure either way.

Polyglot markup is HTML that has been written to conform to both the HTML and XHTML specifications.

A document that uses polyglot markup is a document that is a stream of bytes that parses into identical document trees (with the exception of the xmlns attribute on the root element) when processed as HTML and when processed as XML.
Polyglot markup that meets a well defined set of constraints is interpreted as compatible, regardless of whether they are processed as HTML or as XHTML, per the HTML5 specification.

To meet these criteria, polyglot markup is written in well-formed XHTML and uses a specific DOCTYPE, namespace declarations, and a specific case—normally lower case but occasionally camel case—for element and attribute names.
Polyglot markup uses lower case for certain attribute values. Further constraints include those on empty elements, named entity references, and the use of scripts and style.

The same document can then be served as either HTML or XHTML, depending on browser support and MIME type.

13 questions
16
votes
2 answers

How to validate angular HTML templates

I try to write mostly valid polyglot (X)HTML 5 in my angular HTML templates. They look something like this:
tobib
  • 2,114
  • 4
  • 21
  • 35
16
votes
3 answers

What is a polyglot document?

In this answer to this question, Lachlan-Hunt writes the following: With HTML5, you can choose to use HTML-only syntax, meaning that it is only compatible with being served and processed as text/html it is not well-formed XML. Or use XHTML-only…
Svish
  • 152,914
  • 173
  • 462
  • 620
8
votes
6 answers

Should I write Polyglot HTML5 documents?

I've been considering converting my current HTML5 documents to polyglot HTML5 ones. I figure that even if they only ever get served as text/html, the extra checks of writing it XML would help to keep my coding habits tidy and valid. Is there…
Tim
  • 304
  • 1
  • 14
5
votes
1 answer

W3C no longer maintains polyglot markup?

W3C has ended support for the polyglot markup. So do I have to convert my site to use regular HTML5 instead of XHTML? How would them abandoning this concept affect existing sites? I want to have a perfectly valid markup and if that code conflicts…
Johny P.
  • 648
  • 1
  • 9
  • 31
4
votes
2 answers

Tool (filter) to convert HTML5 into Polyglot Markup?

Context: my HTML5 documents not need Javascript, animations, forms... They are "only content". So, it can be filtered about these kind of representations, need only some subset/constraints of the "full-HTML5 representation". A good way to express…
Peter Krauss
  • 13,174
  • 24
  • 167
  • 304
4
votes
1 answer

There are a subset or constraint of HTML5 that can be perfectly mapped into XHTML5, and vice-versa?

I need to represent content in a lingua franca, that is, in nowadays, the HTML5 standard — my objective is not to show a page in the web-browser. I need to represent only content, no interface, no layout, no logic (no Javascript). As remembered in…
Peter Krauss
  • 13,174
  • 24
  • 167
  • 304
4
votes
1 answer

Polyglot-Markup validator

Is there a free online polyglot-markup validation service that will correctly identify and validate polyglot-markup? I did find totalvalidator and htmlvalidator but those are (paid) non-web-based solutions.
GitaarLAB
  • 14,536
  • 11
  • 60
  • 80
3
votes
1 answer

Defining two o more functions in karate-config.js

My karate-config.js is: function config(){ return karate.read('classpath:' + env_file()); } function env_file(){ var env_file = karate.env; if(!env_file){ env_file = 'local.yml'; } return 'env/' + env_file; } That was…
italktothewind
  • 1,950
  • 2
  • 28
  • 55
3
votes
2 answers

How to use Meta Viewport in XML?

I am trying to create a responsive design layout using XML that relies on setting the initial-scale of the user agent. In HTML I would use some variation of the tag such as this:
Startec
  • 12,496
  • 23
  • 93
  • 160
1
vote
1 answer

HTML Polyglot Markup served as text/html+xml

The question is simple: Can Polyglot Markup be "served" with the content-type: text/html+xml; charset=utf-8?
brunoais
  • 6,258
  • 8
  • 39
  • 59
1
vote
1 answer

Are HTML5 custom elements compatible with an XML (polyglot) serialization?

There is a draft specification that allows defining and using custom HTML elements. Since this draft does not mention XHTML5 polyglot documents, and to my knowledge valid (as opposed to well-formed) XML documents require a DTD declaring all possible…
lxgr
  • 3,719
  • 7
  • 31
  • 46
1
vote
1 answer

Polyglot, XHTML5, dl,dt,dd how to make a space between entries?

I have this piece of Polyglot XHTML5 and I am trying to make a space between each reference. However it seems I cannot use the p or br tags. It still has to be valid... Hopefully somebody could help out, would be super awesome!
Susan
  • 301
  • 1
  • 5
  • 17
0
votes
1 answer

Acceptance of HTML5 Polyglot served as application/xhtml+xml

In terms of browser support and HTML5 compliance, (assuming page is actually XML well-formed) how convenient is to serve HTML5 polyglot page with application/xhtml+xml HTTP Content-type header? In earlier times I served XHTML width text/html header…
user3473252