=?ISO-8859-1?Q?Re=3A=20=27Re=3A=20=22=5Bxml=5D=20xmllint=3A=20Validating=20with=20schemaLocation=20instead=20of=20passing=20on=20cmd=20line=22=27?=



Hi,

Frans Englich wrote:
On Wednesday 03 November 2004 09:48, you wrote:
Hi,
Frans Englich wrote:
[...]
But how do I make xmllint validate/locate the Schema when it is specified
in the XML document with
http://www.w3.org/2001/XMLSchema-instance:schemaLocation?

AFAIK this is not yet accessible via xmllint. We did an initial
implementation of xsi:schemaLocation/xsi:noNamespaceSchemaLocation not
long ago, so I guess it just needs some time and priority to make
through to xmllint. Please report it in bugzilla, so we can schedule it;


http://bugzilla.gnome.org/show_bug.cgi?id=157205

Thanks.

or, if you feel like it, try an implementation. xmlSchemaNewValidCtxt
needs to be called with NULL as the @schema argument.
XMLSchema-instance:schemaLocation has not been tested much, so we would
be glad to hear from your experience here.


Ok, that was /dev/random for me. I will gladly test code that is available, 
and report bugs. I will use xmllint; I should run CVS HEAD, grep for 
xmlSchemaNewValidCtxt and blank the schema argument(field in struct)? That's 
it? With parameter --valid? (that sure must sound amusing if I'm wrong :)

"--valid" seems to be reserved for DTD validation.
A sketched modification of xmllint.c - if you just need a quick local
change:

1. New functionallity, new variable:
    static int wxsivalid = 0;
2. Process a new command line argument:
    } else if ((!strcmp(argv[i], "-wxsivalid")) ||
        (!strcmp(argv[i], "--wxsivalid"))) {
            wxsivalid++;
            noent++;
    }
3. Modify the schema validation handler to validate even
    if no schema was created:
    } else if ((wxschemas != NULL) || (wxsivalid)) {


Regards,

Kasimier




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]