On 5 Mar 2017, at 5:53, Leif Halvard Silli wrote:

  ... snip ...
1. insert a style element *before* the document’s title element
  ... snip ...
3. Inside the above style element, add the following content:
         </style><title>Lorem ipsum</title><style>

  ... snip ...
  <style><?xxe-sn foo BAR?>/*<![CDATA[*/
     </style><title>Lorem ipsum.</title><style>
  /*]]>*/</style>
  <title>Lorem ipsum</title>

This hack relies on the fact that XMLmind XMLeditor inserts /*<![CDATA[*/ as the first content of of every style element, and /*]]>*/ as the last content of every style element. This means that all the content in betweeen, from XML’s point of view is text. However, from text/html’s point of view the style element ends when it sees the first endtag </style>.

More explanation:

1) text/html parsers look for the *first* occurrence of a title element. That’s why, if there is a title element “outside” the style element, that title element must come *after* the title element element (actuallly, it is not an element, but just a ‘look-alike’) of the style element.

2) That being said: To get your document to conform to how text/html HTML5 validators think, you must delete the title element that occurs after the style element. (Because it is not permitted to have two title elements.) The downside to that is that there then, from XML and XMLmind’s point of view, is no title element in the document. (But sometimes this is a smaller problem ...)
--
leif halvard silli

--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to