GNOME Bugzilla – Bug 526191
libxml2 behaves differently on actual <attribute> vs attribute inserted using <ref>
Last modified: 2021-07-05 13:25:53 UTC
I used <ref> to reference a predefined attribute in my Relax NG schema, but I received this error from libxml2: "Invalid attribute Title for element Book" To Reproduce: See below schema and xml snippets (notice the <ref name="TitleAttribute"/> under "Book" element. I did not get the same error if I directly specify the <attribute> under "Book", i.e: without using <ref>. =========== test.rng ==================== <?xml version="1.0" encoding="UTF-8"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <element name="Book"> <ref name="TitleAttribute"/> <!-- NOTE: using ref here caused error. --> <interleave> <zeroOrMore> <element name="Author"> <text/> </element> </zeroOrMore> </interleave> </element> </start> <define name="TitleAttribute"> <attribute name="Title"> <data type="token"/> </attribute> </define> </grammar> =============================================== =============== test.xml ========================= <Book Title="History101"> <Author>Joe Joe</Author> <Author>Jill Jill</Author> </Book> ================================================
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.