You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WXS schema schema/htmlbook.xsd failed to compile (ailed to load external entity "http://www.w3.org/2001/xml.xsd") #217
git clone https://github.com/oreillymedia/HTMLBook.git
cd HTMLBook
xmllint --noout --schema schema/htmlbook.xsd samples/alices_adventures_in_wonderland.html
Output:
warning: failed to load external entity "http://www.w3.org/2001/xml.xsd"
schema/svg/xlink.xsd:27: element import: Schemas parser warning : Element '{http://www.w3.org/2001/XMLSchema}import': Failed to locate a schema at location 'http://www.w3.org/2001/xml.xsd'. Skipping the import.
schema/svg/xlink.xsd:171: element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}lang' does not resolve to a(n) attribute declaration.
schema/svg/SVG.xsd:337: element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}base' does not resolve to a(n) attribute declaration.
schema/svg/SVG.xsd:343: element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}lang' does not resolve to a(n) attribute declaration.
schema/svg/SVG.xsd:344: element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}space' does not resolve to a(n) attribute declaration.
schema/svg/SVG.xsd:1389: element attribute: Schemas parser error : attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}space' does not resolve to a(n) attribute declaration.
WXS schema schema/htmlbook.xsd failed to compile
I think I just encountered a similar problem using Python and lxml:
Python 3.7.9 (default, Sep 6 2020, 16:32:30)
[Clang 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml.etree
>>> lxml.etree.XMLSchema(file="htmlbook.xsd")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src/lxml/xmlschema.pxi", line 88, in lxml.etree.XMLSchema.__init__
lxml.etree.XMLSchemaParseError: attribute use (unknown), attribute 'ref': The QName value '{http://www.w3.org/XML/1998/namespace}lang' does not resolve to a(n) attribute declaration., line 171
Activity
dac514 commentedon Sep 19, 2018
In
schema/svg/xlink.xsd, changing:To:
Resolves the issue but I'm not sure this is right? I'm a bit surprised
http://www.w3.org/2001/XMLSchemawould vanish?Fix github.com/oreillymedia/HTMLBook/issues/217
fix oreillymedia#217
gimsieke commentedon Sep 19, 2018
I’d rather use the file that is guaranteed to remain available (unless someone removes it from this repo), xml.xsd. See PR #218
HTMLBook: Use a file that is guaranteed to remain available
HTMLBook: Use a file that is guaranteed to remain available (#1366)
HTMLBook: Use a file that is guaranteed to remain available (#1366)
jenstroeger commentedon Dec 10, 2020
I think I just encountered a similar problem using Python and lxml:
@gimsieke*, your suggested workaround didn’t work for me, but considering that
svg/xml.xsdis checked into the repo I changed this lineHTMLBook/schema/svg/xlink.xsd
Line 27 in 465453a
to
and I could load the schema file:
—————☺️
* Hallo nach Leebsch vonnem annern Sachsn!
gimsieke commentedon Dec 10, 2020
Isn’t that exactly what I suggested in gimsieke@04ab437, mei Guudsder?
jenstroeger commentedon Dec 10, 2020
Indeed you did 👍🏼 (Nu klor!)