Subject: [xml2rfc] #384 (Version_3_cli_txt): inline SVG requires type="svg" on <artwork>

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 15:41:18 -0000

#384: inline SVG requires type="svg" on <artwork>

 Given

 {{{
         <figure>
           <preamble>Text before...</preamble>
           <artwork alt="IETF Logo"><svg xmlns="http://www.w3.org/2000/svg"
 width="175" height="57" viewBox="0 0 175 57">
             <path
 d="M60,2l12,12l-12,12l-12-12zM88,2l12,12l-12,12l-12-12zM116,2l12,12l-12,12l-12-12zM18,16l12,12l-12,12l-12-12zM46,16l12,12l-12,12l-12-12zM74,16l12,12l-12,12l-12-12zM102,16l12,12l-12,12l-12-12zM130,16l12,12l-12,12l-12-12zM158,16l12,12l-12,12l-12-12zM60,30l12,12l-12,12l-12-12zM88,30l12,12l-12,12l-12-12zM116,30l12,12l-12,12l-12-12z"
 fill="black"/>
             <path stroke="black" stroke-width="0.5"
 d="M7,27h26l13,13l14-14l14,14l28-28l14,14l14-14l15,15h26v3h-
 27l-14-14l-14,14l-14-14l-28,28l-14-14l-14,14l-14-14h-25z" fill="white"/>
             <path d="M3,26h5v5h-5zM168,26h5v5h-5z"/>
           </svg></artwork>
           <postamble>Text after...</postamble>
         </figure>

 }}}

 xml2rfc (with --v3 and --html) says:

 {{{
  Error: Expected ascii-art artwork for <artwork type="">, but found
 b'<artwork alt="IETF Logo" align="left" pn="section-8.1-2"><svg
 xmlns="http://www.w3.org/2000/svg" width="175" height="57" viewBox'...
 }}}

 This can be worked-around by specifying the type as "svg", but I can't see
 how RFC 7991 requires this, and it appears to be redundant information
 when the content is indeed SVG.

-- 
-----------------------------------+--------------------
 Reporter:  [email-masked]  |      Owner:
     Type:  defect                 |     Status:  new
 Priority:  minor                  |  Milestone:
Component:  Version_3_cli_txt      |    Version:  2.13.x
 Keywords:                         |
-----------------------------------+--------------------

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 18:16:59 -0000

Comment (by [email-masked]):

 See https://tools.ietf.org/html/rfc7998#page-13, list items 4, 5, and 6.

-- 
------------------------------------+--------------------
Resolution:                         |   Keywords:
------------------------------------+--------------------

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:1>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 20:29:36 -0000

Comment (by [email-masked]):

 None of these steps seem to apply here (also, this is the preptool spec,
 so if it would define the actual meaning of the grammar, it would be
 misplaced).

 FWIW:

 Step 4: If an <artwork> element has type='svg' and there is an "src"
 attribute...

 Step 5: If an <artwork> element has type='binary-art'...

 Step 6: If an <artwork> element does not have type='svg' or type='binary-
 art' and there is an "src" attribute, the data needs to be moved into the
 content of the <artwork> element....

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:2>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 20:51:10 -0000

The rest of the quoted text from 7998 says:

 {{{
    6.  If an <artwork> element does not have type='svg' or
        type='binary-art' and there is an "src" attribute, the data needs
        to be moved into the content of the <artwork> element.  Note that
        this step assumes that all of the preferred types other than
        "binary-art" are text, which is possibly wrong.

        *  If the "src" URI scheme is "data:", fill the content of the
           <artwork> element with the correctly escaped form of that data
           and remove the "src" attribute.

        *  If the "src" URI scheme is "file:", "http:", or "https:", fill
           the content of the <artwork> element with the correctly
           escaped form of the resolved text from the URI in the "src"
           attribute.  If there is no "originalSrc" attribute, add an
           "originalSrc" attribute with the value of the URI and remove
           the "src" attribute.
 }}}

 If I were to follow this for <svg> content, it would be quoted so as to
 appear
 literally.

 In order to avoid making mistakes by guessing at what the author means in
 the absence of a type attribute, the type attribute is required.  Say that
 the artwork content is type="svg", and the possibilities of mistakes go
 away.

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:3>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 20:58:32 -0000

Not true.

 The processor clearly can detect whether the content of artwork is just
 character data or whether it contains an <svg> child element (plus
 optional whitespace).

 FWIW, that's also what the grammar says
 (https://greenbytes.de/tech/webdav/rfc7991.html#grammar.artwork) and the
 prose
 (https://greenbytes.de/tech/webdav/rfc7991.html#rfc.section.2.5.p.9>) say.
 There is no ambiguity here.

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:4>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 21:00:18 -0000

And how would you then include literal svg code?

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:5>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 21:07:42 -0000

You would have to escape it, just like HTML or other XML code.

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:6>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 21:23:26 -0000

That said, I can see that it might make sense to issue a warning when
 there is SVG content and the type says something else.

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:7>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 26 Nov 2018 21:40:34 -0000

opened: https://github.com/rfc-format/draft-iab-xml2rfc-v3-bis/issues/75

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/384#comment:8>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>