After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 157205 - Support for XMLSchema-instance
Support for XMLSchema-instance
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
2.6.14
Other All
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-03 09:59 UTC by Frans Englich
Modified: 2021-07-05 13:22 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Frans Englich 2004-11-03 09:59:42 UTC
Support for W3C XMLSchema-instance, the ability to specify a schema in a 
document instance, is missing. 
 
Namespace: http://www.w3.org/2001/XMLSchema-instance 
Specification: http://www.w3.org/TR/xmlschema-1/ 
 
A relevant thread(as of this time of submission): 
http://mail.gnome.org/archives/xml/2004-November/msg00023.html 
 
 
Cheers, 
 
        Frans
Comment 1 kbuchcik 2004-11-04 09:58:05 UTC
The functionality is initially implemented but not yet accessible via xmllint.
Comment 2 Frans Englich 2004-11-06 14:27:36 UTC
  
I'm thinking about the design of xmllint's parameters. AFAICT, it would be 
practical if the user didn't have to be concerned about whether the XML 
document referenced an XML Schema or DTD, such that one would have to use a 
specific parameter.  
 
Instead one could do `xmllint --valid file.xml` and it would be automatically 
detected whether a Schema or DTD was referenced, and then validated 
accordingly. In addition, could there be --dtdvalid and --xsdvalid, such that 
it also would be possible to get an error if a wrong type of document 
declaration was used. 
 
Also, perhaps a beta version could go into a real release, since it is an 
optional, and explicitly activated feature. 
 
Cheers, 
Frans 
 
Comment 3 Daniel Veillard 2004-11-06 20:11:28 UTC
Nothing prevent a document from referencing both a DTD and a XSD schemas.
DTD checking is a parsing process done as part of XML definition. It really
doesn't sit at the same level as XSD validation.

Daniel
Comment 4 Frans Englich 2004-11-07 12:58:02 UTC
 
Ok, that's apparently over my head. To express my wish in a way which doesn't 
touch implementation aspects; it would be practical if one could say to xmllint 
"validate this file" and then it's validated, regardless of it references a 
Schema, DTD, or both, such that the user doesn't have to bother if the file 
references a Schema, DTD, or both. 
 
 
Cheers, 
 
        Frans 
 
 
Comment 5 kbuchcik 2006-05-30 10:51:43 UTC
I think the current state is that we decided to add an option to xmllint
in order to let it validate against a schema specified by xsi:schemaLocation
and/or xsi:noNamespaceSchemaLocation in the instance document.
The questions left:
1) what should be the name of the option (e.g. --wxs-xsi-location-validate)
2) what should be done if the option --schema (and a schema document)
  is also specified. I would prefer to raise an argument error in this
  case.

Additionally, I would like to add the option --wxs-validate. In contrast
to --schema, which can also be used without an instance document, it would
require an instance document and, due to the "wxs" prefix, it will make it
more obvious that we want an XML Schema validation.
Comment 6 Daniel Veillard 2006-05-30 11:05:42 UTC
I would favor --xsischemas that's simpler, xsi indicates it's the
one in the instance and schemas as in --schemas for xsd

Daniel
Comment 7 kbuchcik 2006-05-30 11:41:01 UTC
I would prefer to have more explicit names. Although I wouldn't say that
I hate W3C XML Schema :-), I think that it does not deserve to have the
generic name "schema" reserved for it; so it we could use "wxs", then
this would put it in its slot where it belongs. Also "location" seems
more intuitive and would prevent us from ambiguity if the W3C decides to
add new XSI mechanisms. But the most important reason for an explicit
option like --wxs-xsi-location-validate is: the user will be more
reluctant to use that option :-)
Comment 8 kbuchcik 2006-05-30 11:48:26 UTC
Ah, I forgot to write that I'm also fine with --xsischema if the
explicit version is not accepted. The name might not be as important
as I currently think it is.
Comment 9 Vasil Rangelov 2009-07-28 16:16:11 UTC
Is it possible that the two get combined?
For example
"xmllint file.xml --xsi --schema file.xsd"
could mean "attempt to validate file.xml with the schema referenced in it, and use file.xsd if there's no such XML Schema".

If the same could be done for DTDs, it would be even better, especially if DTDs could be combined with XML Schemas, so that validation could be done for both, i.e.
"xmllint file.xml --xsi --schema file.xsd --valid --dtdvalid file.dtd"
would mean "attempt to validate file.xml by both its DTD and its referenced XML Schema, and use file.dtd and file.xsd if respectively there's no referenced DTD and/or XML Schema".

Would such a behavior be acceptable? If not, why not?
Comment 10 Daniel Veillard 2009-07-28 16:23:58 UTC
No there is no combination like that. 
 --valid will look for a DTD in the document
 --dtdvalid will try to validate against an instance
but operation are not at the same time and both could actually be run
to verify validity against both.
The options are independant.

Daniel
Comment 11 Vasil Rangelov 2009-07-28 18:06:13 UTC
So... no
"xmllint file.xml --valid --dtdvalid file.dtd"
but possible
"xmllint file.xml --xsi --schema file.xsd"
"xmllint file.xml --xsi --schema file.xsd --valid"
"xmllint file.xml --xsi --schema file.xsd --dtdvalid file.dtd"
"xmllint file.xml --schema file.xsd --valid"
"xmllint file.xml --schema file.xsd --dtdvalid file.dtd"
?
Comment 12 Deepankar Jain 2013-03-06 18:02:14 UTC
Hello, 

Is there any update on this issue?  I really want to use xmllint for my project, but having to explicitly tell it about the schema to validate against when that same schema is specified within the XML document is rather troubling.  If there's nothing that can be done about this issue, then I'm afraid I'm forced to choose Xerces for XML validation simply because it just figures out what validation scheme it must use.

Thanks,
Deepankar
Comment 13 GNOME Infrastructure Team 2021-07-05 13:22:27 UTC
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.