Re: Comments on section 6.2 of ITS 2.0

On 5.7.2013 17:08, Daniel Glazman wrote:

> If we implement what I recommend with a CDATA section for XHTML docs,
> getting the ITS rules from any script element is ALWAYS a matter of two
> lines WHATEVER the flavor of HTML:

Whole point of recommending to use its-* attributes in XHTML is in order
to get consistent results if you process page with either HTML or XML
parser as users use wrong media type usually. Of course this will no
longer be true with XML fragment inside <script> as it is not parsed in
HTML but it gets parsed with XML parser.

If you will introduce CDATA sections inside <script> then you break
possibility of parsing content with HTML parser as HTML doesn't
recognize CDATA sections. So while solving one problem, you have
introduced another one -- resulting syntax is no more "polyglot compatible".

I really don't see elegant solution which will satisfy all constraints
here. We have to live with messy HTML parsing rules and sub-optimal HTML
and XML compatibility.

What about adding following into the spec:

"If HTML or XHTML document contains script element with
type=application/its+xml and such element does not contain any child
elements then ITS markup must be extracted from this node by applying
XML parsing on a content of the script element."

Would that resolve your objection? It will be pretty clear what to do,
and you can even use CDATA sections in XHTML if you think that makes sense.

Your code will then be just little more complex -- it will test for
presence of subelement -- if there will be some then all children of
<script> element will be treated as fragment of ITS otherwise you will
have first call parser on the text content of <script> node to get
fragment of ITS markup.

    Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------

Received on Friday, 5 July 2013 15:58:34 UTC