libxmljs2 icon indicating copy to clipboard operation
libxmljs2 copied to clipboard

Allow enabling default attribute insertion when validating with XML Schema

Open hubgit opened this issue 4 years ago • 0 comments

When calling doc.validate(xsdDoc) it would be useful to be able to add { create: true } as the second parameter.

The idea is that this would set XML_SCHEMA_VAL_VC_I_CREATE on the validation context, which would tell libxml to insert any default attributes into the document being validated, as defined in the schema.

This would be the XML Schema equivalent of setting dtdattr: true when parsing an XML file with a DTD.

If it's helpful, the equivalent in PHP is the LIBXML_SCHEMA_CREATE flag passed to schemaValidate.

hubgit avatar Sep 24 '21 19:09 hubgit