libxml-rs 0.1.0-alpha.50

Native-Rust forensic reimplementation of libxml2+libxslt with C ABI drop-in replacement. Cross-version oracle matrix (libxml2 2.7.8-2.15.3, libxslt 1.1.26-1.1.45) with semantic epochs; full xmllint/xmlcatalog/xsltproc CLIs; differential-court-verified C API closure; three-DSO ELF packaging (libxml2.so.16 core + libxslt.so.1/libexslt.so.0 facades, upstream NEEDED chain); fail-closed oracle-isolated ABI-FUNCTION-SIGNATURE plane (SOURCE_PROTOTYPE + MACHINE_ABI fingerprints, zero silent omissions); Phase-12 real downstream substitution (binary/static/docker substitution, export-surface disposition, ELF version graphs); Phase-13 hostile audit courts (ABI/ownership/allocator/callbacks/failure/threads/oracle-contamination) byte-identical vs the system oracle incl. the upstream thread-local globals model; Phase-14 downstream custodian validation courts (lxml/Nokogiri/PHP/Debian). Test counts live in atlas/TEST_COUNTS.json, residuals in atlas/RESIDUAL_LEDGER.json (generated evidence).
Documentation
/**
 * @file
 *
 * Schematron API for libxml-rs
 *
 * # UPSTREAM-PARITY
 * Types follow upstream `schematron.h` (libxml2 2.15.x).
 */

#ifndef __XML_SCHEMATRON_H__
#define __XML_SCHEMATRON_H__

#include <libxml/xmlversion.h>
#include <libxml/tree.h>
#include <libxml/xmlerror.h>

#ifdef __cplusplus
extern "C" {
#endif

/* Validation callback types (upstream schematron.h) */
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);

typedef struct _xmlSchematron xmlSchematron;
typedef xmlSchematron *xmlSchematronPtr;
typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;

typedef enum {
    XML_SCHEMATRON_OUT_QUIET = 1 << 0,
    XML_SCHEMATRON_OUT_TEXT = 1 << 1,
    XML_SCHEMATRON_OUT_XML = 1 << 2,
    XML_SCHEMATRON_OUT_ERROR = 1 << 3,
    XML_SCHEMATRON_OUT_ANNOTATE = 1 << 4,
    XML_SCHEMATRON_OUT_STREAM = 1 << 5
} xmlSchematronValidOptions;

XMLPUBFUN xmlSchematronParserCtxtPtr xmlSchematronNewParserCtxt(const char *URL);
XMLPUBFUN xmlSchematronParserCtxtPtr xmlSchematronNewMemParserCtxt(const char *buffer,
                                                                   int size);
XMLPUBFUN xmlSchematronPtr xmlSchematronParse(xmlSchematronParserCtxtPtr ctxt);
XMLPUBFUN void xmlSchematronFreeParserCtxt(xmlSchematronParserCtxtPtr ctxt);
XMLPUBFUN void xmlSchematronFree(xmlSchematronPtr schema);
XMLPUBFUN xmlSchematronValidCtxtPtr xmlSchematronNewValidCtxt(xmlSchematronPtr schema,
                                                              int options);
XMLPUBFUN void xmlSchematronFreeValidCtxt(xmlSchematronValidCtxtPtr ctxt);
XMLPUBFUN int xmlSchematronValidateDoc(xmlSchematronValidCtxtPtr ctxt,
                                       xmlDocPtr instance);


/* [11.1-S] begin: oracle-extracted declarations
 * Extracted verbatim from the upstream headers (11.1-S header-surface
 * audit: every function the oracle headers declare must be declared by the
 * drop-in headers — the source-compatibility contract. Signatures are the upstream ABI contract.
 */
XMLPUBFUN int xmlSchematronGetParserErrors(xmlSchematronParserCtxt *ctxt, xmlSchematronValidityErrorFunc * err, xmlSchematronValidityWarningFunc * warn, void **ctx);
XMLPUBFUN int xmlSchematronGetValidErrors (xmlSchematronValidCtxt *ctxt, xmlSchematronValidityErrorFunc *err, xmlSchematronValidityWarningFunc *warn, void **ctx);
XMLPUBFUN int xmlSchematronIsValid (xmlSchematronValidCtxt *ctxt);
XMLPUBFUN xmlSchematronParserCtxt * xmlSchematronNewDocParserCtxt(xmlDoc *doc);
XMLPUBFUN void xmlSchematronSetParserErrors(xmlSchematronParserCtxt *ctxt, xmlSchematronValidityErrorFunc err, xmlSchematronValidityWarningFunc warn, void *ctx);
XMLPUBFUN void xmlSchematronSetValidErrors (xmlSchematronValidCtxt *ctxt, xmlSchematronValidityErrorFunc err, xmlSchematronValidityWarningFunc warn, void *ctx);
XMLPUBFUN int xmlSchematronSetValidOptions(xmlSchematronValidCtxt *ctxt, int options);
XMLPUBFUN void xmlSchematronSetValidStructuredErrors( xmlSchematronValidCtxt *ctxt, xmlStructuredErrorFunc serror, void *ctx);
XMLPUBFUN int xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxt *ctxt);
XMLPUBFUN int xmlSchematronValidateOneElement (xmlSchematronValidCtxt *ctxt, xmlNode *elem);
/* [11.1-S] end: oracle-extracted declarations */

#ifdef __cplusplus
}
#endif

#endif /* __XML_SCHEMATRON_H__ */