Subject: [xml2rfc] #381 (Version_3_cli_txt): XInclude processing apparently appends ".xml" when needed

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 14:24:22 -0000

#381: XInclude processing apparently appends ".xml" when needed

 Apparently, the xi:include processing code supports the same fallbacks as
 the xml2rfcv2 code for the include PI.

 This is a bug because it does not conform to the XInclude processing
 specification.

 (I'll supply an example when needed)

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 14:43:45 -0000

Comment (by [email-masked]):

 Xinclude processing is completely handled by the libxml2 library which
 underlies the lxml python library.  If this is a problem, it's probably
 best to register an issue against libxml2.

 For more information, could you provide a pointer to the xinclude
 specification, showing how this is non-conformant?

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 14:52:31 -0000

Comment (by [email-masked]):

 You may want to debug this; I'm positive that lxml doesn't have fallback
 code like that.

 FWIW, <https://www.w3.org/TR/xinclude/#xml-included-items> says:

 {{{
 Resources that are unavailable for any reason (for example the resource
 doesn't exist, connection difficulties or security restrictions prevent it
 from being fetched, the URI scheme isn't a fetchable one, the resource is
 in an unsupported encoding, or the resource is determined through
 implementation-specific mechanisms not to be XML) result in a resource
 error.
 }}}

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

---

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

I'm calling the method xinclude() on an lxml.etree._ElementTree object,
 nothing more.

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 15:59:13 -0000

...maybe some low-level entity resolver kicks in, which implements some
 fallback behavior for the "include" PI?

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 16:02:09 -0000

FWIW, "--prep" reports (one example):

 {{{
         <reference anchor="W3C.REC-SVGTiny12-20081222"
 target="http://www.w3.org/TR/2008/REC-SVGTiny12-20081222"
 xml:base="/var/cache/xml2rfc/reference.W3C.REC-SVGTiny12-20081222.xml"
 quoteTitle="true" derivedA
 nchor="W3C.REC-SVGTiny12-20081222">
 }}}

 ...which in itself is a problem, as "xml:base" needs to be set to the
 object that was retrieved.

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

---

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

Right, there's a callback.

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 19 Nov 2018 22:38:49 -0000

Changes (by [email-masked]):

 * status:  new => closed
 * resolution:   => fixed

Comment:

 Fixed in [2756]:

 Tweaked the lxml resolver callback to not accept include names lacking
 extension under v3.  Added setting of xml:base before caching xi:include
 content, in order to not loose the origin.  Fixes issue #381.

-- 
------------------------------------+--------------------
  Reporter:  [email-masked]  |      Owner:
      Type:  defect                 |     Status:  closed
  Priority:  medium                 |  Milestone:
 Component:  Version_3_cli_txt      |    Version:  2.13.x
Resolution:  fixed                  |   Keywords:
------------------------------------+--------------------

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