schemasInternals.inc 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. (*
  2. * Summary: internal interfaces for XML Schemas
  3. * Description: internal interfaces for the XML Schemas handling
  4. * and schema validity checking
  5. * The Schemas development is a Work In Progress.
  6. * Some of those interfaces are not garanteed to be API or ABI stable !
  7. *
  8. * Copy: See Copyright for the status of this software.
  9. *
  10. * Author: Daniel Veillard
  11. *)
  12. {$IFDEF LIBXML_SCHEMAS_ENABLED}
  13. {$IFDEF POINTER}
  14. xmlSchemaValPtr = ^xmlSchemaVal;
  15. xmlSchemaValPtrPtr = ^xmlSchemaValPtr;
  16. xmlSchemaTypePtr = ^xmlSchemaType;
  17. xmlSchemaFacetPtr = ^xmlSchemaFacet;
  18. xmlSchemaAnnotPtr = ^xmlSchemaAnnot;
  19. xmlSchemaAttributePtr = ^xmlSchemaAttribute;
  20. xmlSchemaAttributeLinkPtr = ^xmlSchemaAttributeLink;
  21. xmlSchemaAttributeLinkPtrPtr = ^xmlSchemaAttributeLinkPtr;
  22. xmlSchemaWildcardNsPtr = ^xmlSchemaWildcardNs;
  23. xmlSchemaWildcardPtr = ^xmlSchemaWildcard;
  24. xmlSchemaAttributeGroupPtr = ^xmlSchemaAttributeGroup;
  25. xmlSchemaTypeLinkPtr = ^xmlSchemaTypeLink;
  26. xmlSchemaFacetLinkPtr = ^xmlSchemaFacetLink;
  27. xmlSchemaElementPtr = ^xmlSchemaElement;
  28. {$ENDIF}
  29. {$IFDEF TYPE}
  30. xmlSchemaVal = record end;
  31. xmlSchemaValType = (
  32. XML_SCHEMAS_UNKNOWN = 0,
  33. XML_SCHEMAS_STRING,
  34. XML_SCHEMAS_NORMSTRING,
  35. XML_SCHEMAS_DECIMAL,
  36. XML_SCHEMAS_TIME,
  37. XML_SCHEMAS_GDAY,
  38. XML_SCHEMAS_GMONTH,
  39. XML_SCHEMAS_GMONTHDAY,
  40. XML_SCHEMAS_GYEAR,
  41. XML_SCHEMAS_GYEARMONTH,
  42. XML_SCHEMAS_DATE,
  43. XML_SCHEMAS_DATETIME,
  44. XML_SCHEMAS_DURATION,
  45. XML_SCHEMAS_FLOAT,
  46. XML_SCHEMAS_DOUBLE,
  47. XML_SCHEMAS_BOOLEAN,
  48. XML_SCHEMAS_TOKEN,
  49. XML_SCHEMAS_LANGUAGE,
  50. XML_SCHEMAS_NMTOKEN,
  51. XML_SCHEMAS_NMTOKENS,
  52. XML_SCHEMAS_NAME,
  53. XML_SCHEMAS_QNAME,
  54. XML_SCHEMAS_NCNAME,
  55. XML_SCHEMAS_ID,
  56. XML_SCHEMAS_IDREF,
  57. XML_SCHEMAS_IDREFS,
  58. XML_SCHEMAS_ENTITY,
  59. XML_SCHEMAS_ENTITIES,
  60. XML_SCHEMAS_NOTATION,
  61. XML_SCHEMAS_ANYURI,
  62. XML_SCHEMAS_INTEGER,
  63. XML_SCHEMAS_NPINTEGER,
  64. XML_SCHEMAS_NINTEGER,
  65. XML_SCHEMAS_NNINTEGER,
  66. XML_SCHEMAS_PINTEGER,
  67. XML_SCHEMAS_INT,
  68. XML_SCHEMAS_UINT,
  69. XML_SCHEMAS_LONG,
  70. XML_SCHEMAS_ULONG,
  71. XML_SCHEMAS_SHORT,
  72. XML_SCHEMAS_USHORT,
  73. XML_SCHEMAS_BYTE,
  74. XML_SCHEMAS_UBYTE,
  75. XML_SCHEMAS_HEXBINARY,
  76. XML_SCHEMAS_BASE64BINARY,
  77. XML_SCHEMAS_ANYTYPE,
  78. XML_SCHEMAS_ANYSIMPLETYPE
  79. );
  80. (*
  81. * XML Schemas defines multiple type of types.
  82. *)
  83. xmlSchemaTypeType = (
  84. XML_SCHEMA_TYPE_BASIC = 1, (* A built-in datatype *)
  85. XML_SCHEMA_TYPE_ANY,
  86. XML_SCHEMA_TYPE_FACET,
  87. XML_SCHEMA_TYPE_SIMPLE,
  88. XML_SCHEMA_TYPE_COMPLEX,
  89. XML_SCHEMA_TYPE_SEQUENCE = 6,
  90. XML_SCHEMA_TYPE_CHOICE,
  91. XML_SCHEMA_TYPE_ALL,
  92. XML_SCHEMA_TYPE_SIMPLE_CONTENT,
  93. XML_SCHEMA_TYPE_COMPLEX_CONTENT,
  94. XML_SCHEMA_TYPE_UR,
  95. XML_SCHEMA_TYPE_RESTRICTION,
  96. XML_SCHEMA_TYPE_EXTENSION,
  97. XML_SCHEMA_TYPE_ELEMENT,
  98. XML_SCHEMA_TYPE_ATTRIBUTE,
  99. XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
  100. XML_SCHEMA_TYPE_GROUP,
  101. XML_SCHEMA_TYPE_NOTATION,
  102. XML_SCHEMA_TYPE_LIST,
  103. XML_SCHEMA_TYPE_UNION,
  104. XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
  105. XML_SCHEMA_TYPE_IDC_UNIQUE,
  106. XML_SCHEMA_TYPE_IDC_KEY,
  107. XML_SCHEMA_TYPE_IDC_KEYREF,
  108. XML_SCHEMA_TYPE_PARTICLE = 25,
  109. XML_SCHEMA_TYPE_ATTRIBUTE_USE,
  110. XML_SCHEMA_FACET_MININCLUSIVE = 1000,
  111. XML_SCHEMA_FACET_MINEXCLUSIVE,
  112. XML_SCHEMA_FACET_MAXINCLUSIVE,
  113. XML_SCHEMA_FACET_MAXEXCLUSIVE,
  114. XML_SCHEMA_FACET_TOTALDIGITS,
  115. XML_SCHEMA_FACET_FRACTIONDIGITS,
  116. XML_SCHEMA_FACET_PATTERN,
  117. XML_SCHEMA_FACET_ENUMERATION,
  118. XML_SCHEMA_FACET_WHITESPACE,
  119. XML_SCHEMA_FACET_LENGTH,
  120. XML_SCHEMA_FACET_MAXLENGTH,
  121. XML_SCHEMA_FACET_MINLENGTH,
  122. XML_SCHEMA_EXTRA_QNAMEREF = 2000,
  123. XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
  124. );
  125. xmlSchemaContentType = (
  126. XML_SCHEMA_CONTENT_UNKNOWN = 0,
  127. XML_SCHEMA_CONTENT_EMPTY = 1,
  128. XML_SCHEMA_CONTENT_ELEMENTS,
  129. XML_SCHEMA_CONTENT_MIXED,
  130. XML_SCHEMA_CONTENT_SIMPLE,
  131. XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, (* Obsolete *)
  132. XML_SCHEMA_CONTENT_BASIC,
  133. XML_SCHEMA_CONTENT_ANY
  134. );
  135. (**
  136. * Annotation
  137. *)
  138. xmlSchemaAnnot = record
  139. next : xmlSchemaAnnotPtr;
  140. content : xmlNodePtr; (* the annotation *)
  141. end;
  142. {$ENDIF}
  143. {$IFDEF CONST}
  144. (**
  145. * XML_SCHEMAS_ANY_SKIP:
  146. *
  147. * Skip unknown attribute from validation
  148. *)
  149. XML_SCHEMAS_ANY_SKIP = 1;
  150. (**
  151. * XML_SCHEMAS_ANY_LAX:
  152. *
  153. * Used by wildcards.
  154. * Validate if type found, don't worry if not found
  155. *)
  156. XML_SCHEMAS_ANY_LAX = 2;
  157. (**
  158. * XML_SCHEMAS_ANY_STRICT:
  159. *
  160. * Used by wildcards.
  161. * Apply strict validation rules
  162. *)
  163. XML_SCHEMAS_ANY_STRICT = 3;
  164. (**
  165. * XML_SCHEMAS_ATTR_USE_PROHIBITED:
  166. *
  167. * Used by wildcards.
  168. * The attribute is prohibited.
  169. *)
  170. XML_SCHEMAS_ATTR_USE_PROHIBITED = 0;
  171. (**
  172. * XML_SCHEMAS_ATTR_USE_REQUIRED:
  173. *
  174. * The attribute is required.
  175. *)
  176. XML_SCHEMAS_ATTR_USE_REQUIRED = 1;
  177. (**
  178. * XML_SCHEMAS_ATTR_USE_OPTIONAL:
  179. *
  180. * The attribute is optional.
  181. *)
  182. XML_SCHEMAS_ATTR_USE_OPTIONAL = 2;
  183. (**
  184. * XML_SCHEMAS_ATTR_GLOBAL:
  185. *
  186. * allow elements in no namespace
  187. *)
  188. XML_SCHEMAS_ATTR_GLOBAL = (1 shl 0);
  189. (**
  190. * XML_SCHEMAS_ATTR_NSDEFAULT:
  191. *
  192. * allow elements in no namespace
  193. *)
  194. XML_SCHEMAS_ATTR_NSDEFAULT = (1 shl 7);
  195. (**
  196. * XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
  197. *
  198. * this is set when the "type" and "ref" references
  199. * have been resolved.
  200. *)
  201. XML_SCHEMAS_ATTR_INTERNAL_RESOLVED = (1 shl 8);
  202. (**
  203. * XML_SCHEMAS_ATTR_FIXED:
  204. *
  205. * the attribute has a fixed value
  206. *)
  207. XML_SCHEMAS_ATTR_FIXED = (1 shl 9);
  208. {$ENDIF}
  209. {$IFDEF TYPE}
  210. (**
  211. * xmlSchemaAttribute:
  212. * An attribute definition.
  213. *)
  214. xmlSchemaAttribute = record
  215. _type : xmlSchemaTypeType;
  216. next : xmlSchemaAttributePtr; (* the next attribute (not used?) *)
  217. name : xmlCharPtr; (* the name of the declaration *)
  218. id : xmlCharPtr; (* Deprecated; not used *)
  219. ref : xmlCharPtr; (* Deprecated; not used *)
  220. refNs : xmlCharPtr; (* Deprecated; not used *)
  221. typeName : xmlCharPtr; (* the local name of the type definition *)
  222. typeNs : xmlCharPtr; (* the ns URI of the type definition *)
  223. annot : xmlSchemaAnnotPtr;
  224. base : xmlSchemaTypePtr; (* Deprecated; not used *)
  225. occurs : cint; (* Deprecated; not used *)
  226. defValue : xmlCharPtr; (* The initial value of the value constraint *)
  227. subtypes : xmlSchemaTypePtr; (* the type definition *)
  228. node : xmlNodePtr;
  229. targetNamespace : xmlCharPtr;
  230. flags : cint;
  231. refPrefix : xmlCharPtr; (* Deprecated; not used *)
  232. defVal : xmlSchemaValPtr; (* The compiled value constraint *)
  233. refDecl : xmlSchemaAttributePtr; (* Deprecated; not used *)
  234. end;
  235. (**
  236. * xmlSchemaAttributeLink:
  237. * Used to build a list of attribute uses on complexType definitions.
  238. * WARNING: Deprecated; not used.
  239. *)
  240. xmlSchemaAttributeLink = record
  241. next : xmlSchemaAttributeLinkPtr;(* the next attribute link ... *)
  242. attr : xmlSchemaAttributePtr;(* the linked attribute *)
  243. end;
  244. {$ENDIF}
  245. {$IFDEF CONST}
  246. (**
  247. * XML_SCHEMAS_WILDCARD_COMPLETE:
  248. *
  249. * If the wildcard is complete.
  250. *)
  251. XML_SCHEMAS_WILDCARD_COMPLETE = (1 shl 0);
  252. {$ENDIF}
  253. {$IFDEF TYPE}
  254. (**
  255. * xmlSchemaCharValueLink:
  256. * Used to build a list of namespaces on wildcards.
  257. *)
  258. xmlSchemaWildcardNs = record
  259. next : xmlSchemaWildcardNsPtr;(* the next constraint link ... *)
  260. value : xmlCharPtr;(* the value *)
  261. end;
  262. (**
  263. * xmlSchemaWildcard.
  264. * A wildcard.
  265. *)
  266. xmlSchemaWildcard = record
  267. _type : xmlSchemaTypeType; (* The kind of type *)
  268. id : xmlCharPtr; (* Deprecated; not used *)
  269. annot : xmlSchemaAnnotPtr;
  270. node : xmlNodePtr;
  271. minOccurs : cint; (* Deprecated; not used *)
  272. maxOccurs : cint; (* Deprecated; not used *)
  273. processContents : cint;
  274. any : cint; (* Indicates if the ns constraint is of ##any *)
  275. nsSet : xmlSchemaWildcardNsPtr; (* The list of allowed namespaces *)
  276. negNsSet : xmlSchemaWildcardNsPtr; (* The negated namespace *)
  277. flags : cint;
  278. end;
  279. {$ENDIF}
  280. {$IFDEF CONST}
  281. (**
  282. * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
  283. *
  284. * The attribute wildcard has been already builded.
  285. *)
  286. XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED = (1 shl 0);
  287. (**
  288. * XML_SCHEMAS_ATTRGROUP_GLOBAL:
  289. *
  290. * The attribute wildcard has been already builded.
  291. *)
  292. XML_SCHEMAS_ATTRGROUP_GLOBAL = (1 shl 1);
  293. (**
  294. * XML_SCHEMAS_ATTRGROUP_MARKED:
  295. *
  296. * Marks the attr group as marked; used for circular checks.
  297. *)
  298. XML_SCHEMAS_ATTRGROUP_MARKED = (1 shl 2);
  299. (**
  300. * XML_SCHEMAS_ATTRGROUP_REDEFINED:
  301. *
  302. * The attr group was redefined.
  303. *)
  304. XML_SCHEMAS_ATTRGROUP_REDEFINED = (1 shl 3);
  305. (**
  306. * XML_SCHEMAS_ATTRGROUP_HAS_REFS:
  307. *
  308. * Whether this attr. group contains attr. group references.
  309. *)
  310. XML_SCHEMAS_ATTRGROUP_HAS_REFS = (1 shl 4);
  311. {$ENDIF}
  312. {$IFDEF TYPE}
  313. (**
  314. * An attribute group definition.
  315. *
  316. * xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
  317. * must be kept similar
  318. *)
  319. xmlSchemaAttributeGroup = record
  320. _type : xmlSchemaTypeType; (* The kind of type *)
  321. next : xmlSchemaAttributePtr;(* the next attribute if in a group ... *)
  322. name : xmlCharPtr;
  323. id : xmlCharPtr;
  324. ref : xmlCharPtr; (* Deprecated; not used *)
  325. refNs : xmlCharPtr; (* Deprecated; not used *)
  326. annot : xmlSchemaAnnotPtr;
  327. attributes : xmlSchemaAttributePtr; (* Deprecated; not used *)
  328. node : xmlNodePtr;
  329. flags : cint;
  330. attributeWildcard : xmlSchemaWildcardPtr;
  331. refPrefix : xmlCharPtr; (* Deprecated; not used *)
  332. refItem : xmlSchemaAttributeGroupPtr; (* Deprecated; not used *)
  333. targetNamespace : xmlCharPtr;
  334. attrUses : pointer;
  335. end;
  336. (**
  337. * xmlSchemaTypeLink:
  338. * Used to build a list of types (e.g. member types of
  339. * simpleType with variety "union").
  340. *)
  341. xmlSchemaTypeLink = record
  342. next : xmlSchemaTypeLinkPtr;(* the next type link ... *)
  343. _type : xmlSchemaTypePtr;(* the linked type *)
  344. end;
  345. (**
  346. * xmlSchemaFacetLink:
  347. * Used to build a list of facets.
  348. *)
  349. xmlSchemaFacetLink = record
  350. next : xmlSchemaFacetLinkPtr;(* the next facet link ... *)
  351. facet : xmlSchemaFacetPtr;(* the linked facet *)
  352. end;
  353. {$ENDIF}
  354. {$IFDEF CONST}
  355. (**
  356. * XML_SCHEMAS_TYPE_MIXED:
  357. *
  358. * the element content type is mixed
  359. *)
  360. XML_SCHEMAS_TYPE_MIXED = (1 shl 0);
  361. (**
  362. * XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
  363. *
  364. * the simple or complex type has a derivation method of "extension".
  365. *)
  366. XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION = (1 shl 1);
  367. (**
  368. * XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
  369. *
  370. * the simple or complex type has a derivation method of "restriction".
  371. *)
  372. XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION = (1 shl 2);
  373. (**
  374. * XML_SCHEMAS_TYPE_GLOBAL:
  375. *
  376. * the type is global
  377. *)
  378. XML_SCHEMAS_TYPE_GLOBAL = (1 shl 3);
  379. (**
  380. * XML_SCHEMAS_TYPE_VARIETY_ABSENT:
  381. *
  382. * the simpleType has a variety of "absent".
  383. * TODO: Actually not necessary :-/, since if
  384. * none of the variety flags occur then it's
  385. * automatically absent.
  386. *)
  387. XML_SCHEMAS_TYPE_VARIETY_ABSENT = (1 shl 5);
  388. (**
  389. * XML_SCHEMAS_TYPE_VARIETY_LIST:
  390. *
  391. * the simpleType has a variety of "list".
  392. *)
  393. XML_SCHEMAS_TYPE_VARIETY_LIST = (1 shl 6);
  394. (**
  395. * XML_SCHEMAS_TYPE_VARIETY_UNION:
  396. *
  397. * the simpleType has a variety of "union".
  398. *)
  399. XML_SCHEMAS_TYPE_VARIETY_UNION = (1 shl 7);
  400. (**
  401. * XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
  402. *
  403. * the simpleType has a variety of "union".
  404. *)
  405. XML_SCHEMAS_TYPE_VARIETY_ATOMIC = (1 shl 8);
  406. (**
  407. * XML_SCHEMAS_TYPE_FINAL_EXTENSION:
  408. *
  409. * the complexType has a final of "extension".
  410. *)
  411. XML_SCHEMAS_TYPE_FINAL_EXTENSION = (1 shl 9);
  412. (**
  413. * XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
  414. *
  415. * the simpleType/complexType has a final of "restriction".
  416. *)
  417. XML_SCHEMAS_TYPE_FINAL_RESTRICTION = (1 shl 10);
  418. (**
  419. * XML_SCHEMAS_TYPE_FINAL_LIST:
  420. *
  421. * the simpleType has a final of "list".
  422. *)
  423. XML_SCHEMAS_TYPE_FINAL_LIST = (1 shl 11);
  424. (**
  425. * XML_SCHEMAS_TYPE_FINAL_UNION:
  426. *
  427. * the simpleType has a final of "union".
  428. *)
  429. XML_SCHEMAS_TYPE_FINAL_UNION = (1 shl 12);
  430. (**
  431. * XML_SCHEMAS_TYPE_FINAL_DEFAULT:
  432. *
  433. * the simpleType has a final of "default".
  434. *)
  435. XML_SCHEMAS_TYPE_FINAL_DEFAULT = (1 shl 13);
  436. (**
  437. * XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
  438. *
  439. * Marks the item as a builtin primitive.
  440. *)
  441. XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE = (1 shl 14);
  442. (**
  443. * XML_SCHEMAS_TYPE_MARKED:
  444. *
  445. * Marks the item as marked; used for circular checks.
  446. *)
  447. XML_SCHEMAS_TYPE_MARKED = (1 shl 16);
  448. (**
  449. * XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
  450. *
  451. * the complexType did not specify 'block' so use the default of the
  452. * <schema> item.
  453. *)
  454. XML_SCHEMAS_TYPE_BLOCK_DEFAULT = (1 shl 17);
  455. (**
  456. * XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
  457. *
  458. * the complexType has a 'block' of "extension".
  459. *)
  460. XML_SCHEMAS_TYPE_BLOCK_EXTENSION = (1 shl 18);
  461. (**
  462. * XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
  463. *
  464. * the complexType has a 'block' of "restriction".
  465. *)
  466. XML_SCHEMAS_TYPE_BLOCK_RESTRICTION = (1 shl 19);
  467. (**
  468. * XML_SCHEMAS_TYPE_ABSTRACT:
  469. *
  470. * the simple/complexType is abstract.
  471. *)
  472. XML_SCHEMAS_TYPE_ABSTRACT = (1 shl 20);
  473. (**
  474. * XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
  475. *
  476. * indicates if the facets need a computed value
  477. *)
  478. XML_SCHEMAS_TYPE_FACETSNEEDVALUE = (1 shl 21);
  479. (**
  480. * XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
  481. *
  482. * indicates that the type was typefixed
  483. *)
  484. XML_SCHEMAS_TYPE_INTERNAL_RESOLVED = (1 shl 22);
  485. (**
  486. * XML_SCHEMAS_TYPE_INTERNAL_INVALID:
  487. *
  488. * indicates that the type is invalid
  489. *)
  490. XML_SCHEMAS_TYPE_INTERNAL_INVALID = (1 shl 23);
  491. (**
  492. * XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
  493. *
  494. * a whitespace-facet value of "preserve"
  495. *)
  496. XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE = (1 shl 24);
  497. (**
  498. * XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
  499. *
  500. * a whitespace-facet value of "replace"
  501. *)
  502. XML_SCHEMAS_TYPE_WHITESPACE_REPLACE = (1 shl 25);
  503. (**
  504. * XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
  505. *
  506. * a whitespace-facet value of "collapse"
  507. *)
  508. XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE = (1 shl 26);
  509. (**
  510. * XML_SCHEMAS_TYPE_HAS_FACETS:
  511. *
  512. * has facets
  513. *)
  514. XML_SCHEMAS_TYPE_HAS_FACETS = (1 shl 27);
  515. (**
  516. * XML_SCHEMAS_TYPE_NORMVALUENEEDED:
  517. *
  518. * indicates if the facets (pattern) need a normalized value
  519. *)
  520. XML_SCHEMAS_TYPE_NORMVALUENEEDED = (1 shl 28);
  521. (**
  522. * XML_SCHEMAS_TYPE_FIXUP_1:
  523. *
  524. * First stage of fixup was done.
  525. *)
  526. XML_SCHEMAS_TYPE_FIXUP_1 = (1 shl 29);
  527. (**
  528. * XML_SCHEMAS_TYPE_REDEFINED:
  529. *
  530. * The type was redefined.
  531. *)
  532. XML_SCHEMAS_TYPE_REDEFINED = (1 shl 30);
  533. (**
  534. * XML_SCHEMAS_TYPE_REDEFINING:
  535. *
  536. * The type redefines an other type.
  537. *)
  538. (* XML_SCHEMAS_TYPE_REDEFINING = (1 shl 31); *)
  539. {$ENDIF}
  540. {$IFDEF TYPE}
  541. (**
  542. * _xmlSchemaType:
  543. *
  544. * Schemas type definition.
  545. *)
  546. xmlSchemaType = record
  547. _type : xmlSchemaTypeType; (* The kind of type *)
  548. next : xmlSchemaTypePtr; (* the next type if in a sequence ... *)
  549. name : xmlCharPtr;
  550. id : xmlCharPtr; (* Deprecated; not used *)
  551. ref : xmlCharPtr; (* Deprecated; not used *)
  552. refNs : xmlCharPtr; (* Deprecated; not used *)
  553. annot : xmlSchemaAnnotPtr;
  554. subtypes : xmlSchemaTypePtr;
  555. attributes : xmlSchemaAttributePtr; (* Deprecated; not used *)
  556. node : xmlNodePtr;
  557. minOccurs : cint; (* Deprecated; not used *)
  558. maxOccurs : cint; (* Deprecated; not used *)
  559. flags : cint;
  560. contentType : xmlSchemaContentType;
  561. base : xmlCharPtr; (* Base type's local name *)
  562. baseNs : xmlCharPtr; (* Base type's target namespace *)
  563. baseType : xmlSchemaTypePtr; (* The base type component *)
  564. facets : xmlSchemaFacetPtr; (* Local facets *)
  565. redef : xmlSchemaTypePtr; (* Deprecated; not used *)
  566. recurse : cint; (* Obsolete *)
  567. attributeUses : xmlSchemaAttributeLinkPtrPtr; (* Deprecated; not used *)
  568. attributeWildcard : xmlSchemaWildcardPtr;
  569. builtInType : cint; (* Type of built-in types. *)
  570. memberTypes : xmlSchemaTypeLinkPtr; (* member-types if a union type. *)
  571. facetSet : xmlSchemaFacetLinkPtr; (* All facets (incl. inherited) *)
  572. refPrefix : xmlCharPtr; (* Deprecated; not used *)
  573. contentTypeDef : xmlSchemaTypePtr; (* Used for the simple content of complex types.
  574. Could we use @subtypes for this? *)
  575. contModel : xmlRegexpPtr; (* Holds the automaton of the content model *)
  576. targetNamespace : xmlCharPtr;
  577. attrUses : pointer;
  578. end;
  579. {$ENDIF}
  580. {$IFDEF CONST}
  581. (*
  582. * xmlSchemaElement:
  583. * An element definition.
  584. *
  585. * xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
  586. * structures must be kept similar
  587. *)
  588. (**
  589. * XML_SCHEMAS_ELEM_NILLABLE:
  590. *
  591. * the element is nillable
  592. *)
  593. XML_SCHEMAS_ELEM_NILLABLE = (1 shl 0);
  594. (**
  595. * XML_SCHEMAS_ELEM_GLOBAL:
  596. *
  597. * the element is global
  598. *)
  599. XML_SCHEMAS_ELEM_GLOBAL = (1 shl 1);
  600. (**
  601. * XML_SCHEMAS_ELEM_DEFAULT:
  602. *
  603. * the element has a default value
  604. *)
  605. XML_SCHEMAS_ELEM_DEFAULT = (1 shl 2);
  606. (**
  607. * XML_SCHEMAS_ELEM_FIXED:
  608. *
  609. * the element has a fixed value
  610. *)
  611. XML_SCHEMAS_ELEM_FIXED = (1 shl 3);
  612. (**
  613. * XML_SCHEMAS_ELEM_ABSTRACT:
  614. *
  615. * the element is abstract
  616. *)
  617. XML_SCHEMAS_ELEM_ABSTRACT = (1 shl 4);
  618. (**
  619. * XML_SCHEMAS_ELEM_REF:
  620. *
  621. * the element is a reference to a type
  622. *)
  623. XML_SCHEMAS_ELEM_REF = (1 shl 6);
  624. (**
  625. * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
  626. *
  627. * this is set when "type", "ref", "substitutionGroup"
  628. * references have been resolved.
  629. *)
  630. XML_SCHEMAS_ELEM_INTERNAL_RESOLVED = (1 shl 8);
  631. (**
  632. * XML_SCHEMAS_ELEM_CIRCULAR:
  633. *
  634. * a helper flag for the search of circular references.
  635. *)
  636. XML_SCHEMAS_ELEM_CIRCULAR = (1 shl 9);
  637. (**
  638. * XML_SCHEMAS_ELEM_BLOCK_ABSENT:
  639. *
  640. * the "block" attribute is absent
  641. *)
  642. XML_SCHEMAS_ELEM_BLOCK_ABSENT = (1 shl 10);
  643. (**
  644. * XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
  645. *
  646. * disallowed substitutions are absent
  647. *)
  648. XML_SCHEMAS_ELEM_BLOCK_EXTENSION = (1 shl 11);
  649. (**
  650. * XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
  651. *
  652. * disallowed substitutions: "restriction"
  653. *)
  654. XML_SCHEMAS_ELEM_BLOCK_RESTRICTION = (1 shl 12);
  655. (**
  656. * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
  657. *
  658. * disallowed substitutions: "substituion"
  659. *)
  660. XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION = (1 shl 13);
  661. (**
  662. * XML_SCHEMAS_ELEM_FINAL_ABSENT:
  663. *
  664. * substitution group exclusions are absent
  665. *)
  666. XML_SCHEMAS_ELEM_FINAL_ABSENT = (1 shl 14);
  667. (**
  668. * XML_SCHEMAS_ELEM_FINAL_EXTENSION:
  669. *
  670. * substitution group exclusions: "extension"
  671. *)
  672. XML_SCHEMAS_ELEM_FINAL_EXTENSION = (1 shl 15);
  673. (**
  674. * XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
  675. *
  676. * substitution group exclusions: "restriction"
  677. *)
  678. XML_SCHEMAS_ELEM_FINAL_RESTRICTION = (1 shl 16);
  679. (**
  680. * XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
  681. *
  682. * the declaration is a substitution group head
  683. *)
  684. XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD = (1 shl 17);
  685. (**
  686. * XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
  687. *
  688. * this is set when the elem decl has been checked against
  689. * all constraints
  690. *)
  691. XML_SCHEMAS_ELEM_INTERNAL_CHECKED = (1 shl 18);
  692. {$ENDIF}
  693. {$IFDEF TYPE}
  694. xmlSchemaElement = record
  695. _type : xmlSchemaTypeType; (* The kind of type *)
  696. next : xmlSchemaTypePtr; (* Not used? *)
  697. name : xmlCharPtr;
  698. id : xmlCharPtr; (* Deprecated; not used *)
  699. ref : xmlCharPtr; (* Deprecated; not used *)
  700. refNs : xmlCharPtr; (* Deprecated; not used *)
  701. annot : xmlSchemaAnnotPtr;
  702. subtypes : xmlSchemaTypePtr; (* the type definition *)
  703. attributes : xmlSchemaAttributePtr;
  704. node : xmlNodePtr;
  705. minOccurs : cint; (* Deprecated; not used *)
  706. maxOccurs : cint; (* Deprecated; not used *)
  707. flags : cint;
  708. targetNamespace : xmlCharPtr;
  709. namedType : xmlCharPtr;
  710. namedTypeNs : xmlCharPtr;
  711. substGroup : xmlCharPtr;
  712. substGroupNs : xmlCharPtr;
  713. scope : xmlCharPtr;
  714. value : xmlCharPtr; (* The original value of the value constraint. *)
  715. refDecl : xmlSchemaElementPtr; (* This will now be used for the
  716. substitution group affiliation *)
  717. contModel : xmlRegexpPtr; (* Obsolete for WXS, maybe used for RelaxNG *)
  718. contentType : xmlSchemaContentType;
  719. refPrefix : xmlCharPtr; (* Deprecated; not used *)
  720. defVal : xmlSchemaValPtr; (* The compiled value contraint. *)
  721. idcs : pointer; (* The identity-constraint defs *)
  722. end;
  723. {$ENDIF}
  724. {$IFDEF CONST}
  725. (*
  726. * XML_SCHEMAS_FACET_UNKNOWN:
  727. *
  728. * unknown facet handling
  729. *)
  730. XML_SCHEMAS_FACET_UNKNOWN = (0);
  731. (*
  732. * XML_SCHEMAS_FACET_PRESERVE:
  733. *
  734. * preserve the type of the facet
  735. *)
  736. XML_SCHEMAS_FACET_PRESERVE = (1);
  737. (*
  738. * XML_SCHEMAS_FACET_REPLACE:
  739. *
  740. * replace the type of the facet
  741. *)
  742. XML_SCHEMAS_FACET_REPLACE = (2);
  743. (*
  744. * XML_SCHEMAS_FACET_COLLAPSE:
  745. *
  746. * collapse the types of the facet
  747. *)
  748. XML_SCHEMAS_FACET_COLLAPSE = (3);
  749. {$ENDIF}
  750. {$IFDEF TYPE}
  751. (**
  752. * A facet definition.
  753. *)
  754. xmlSchemaFacet = record
  755. _type : xmlSchemaTypeType; (* The kind of type *)
  756. next : xmlSchemaFacetPtr;(* the next type if in a sequence ... *)
  757. value : xmlCharPtr; (* The original value *)
  758. id : xmlCharPtr; (* Obsolete *)
  759. annot : xmlSchemaAnnotPtr;
  760. node : xmlNodePtr;
  761. fixed : cint; (* XML_SCHEMAS_FACET_PRESERVE, etc. *)
  762. whitespace : cint;
  763. val : xmlSchemaValPtr; (* The compiled value *)
  764. regexp : xmlRegexpPtr; (* The regex for patterns *)
  765. end;
  766. (**
  767. * A notation definition.
  768. *)
  769. xmlSchemaNotation = record
  770. _type : xmlSchemaTypeType; (* The kind of type *)
  771. name : xmlCharPtr;
  772. annot : xmlSchemaAnnotPtr;
  773. identifier : xmlCharPtr;
  774. targetNamespace : xmlCharPtr;
  775. end;
  776. {$ENDIF}
  777. {$IFDEF CONST}
  778. (*
  779. * TODO: Actually all those flags used for the schema should sit
  780. * on the schema parser context, since they are used only
  781. * during parsing an XML schema document, and not available
  782. * on the component level as per spec.
  783. *)
  784. (**
  785. * XML_SCHEMAS_QUALIF_ELEM:
  786. *
  787. * Reflects elementFormDefault == qualified in
  788. * an XML schema document.
  789. *)
  790. XML_SCHEMAS_QUALIF_ELEM = (1 shl 0);
  791. (**
  792. * XML_SCHEMAS_QUALIF_ATTR:
  793. *
  794. * Reflects attributeFormDefault == qualified in
  795. * an XML schema document.
  796. *)
  797. XML_SCHEMAS_QUALIF_ATTR = (1 shl 1);
  798. (**
  799. * XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
  800. *
  801. * the schema has "extension" in the set of finalDefault.
  802. *)
  803. XML_SCHEMAS_FINAL_DEFAULT_EXTENSION = (1 shl 2);
  804. (**
  805. * XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
  806. *
  807. * the schema has "restriction" in the set of finalDefault.
  808. *)
  809. XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION = (1 shl 3);
  810. (**
  811. * XML_SCHEMAS_FINAL_DEFAULT_LIST:
  812. *
  813. * the cshema has "list" in the set of finalDefault.
  814. *)
  815. XML_SCHEMAS_FINAL_DEFAULT_LIST = (1 shl 4);
  816. (**
  817. * XML_SCHEMAS_FINAL_DEFAULT_UNION:
  818. *
  819. * the schema has "union" in the set of finalDefault.
  820. *)
  821. XML_SCHEMAS_FINAL_DEFAULT_UNION = (1 shl 5);
  822. (**
  823. * XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
  824. *
  825. * the schema has "extension" in the set of blockDefault.
  826. *)
  827. XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION = (1 shl 6);
  828. (**
  829. * XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
  830. *
  831. * the schema has "restriction" in the set of blockDefault.
  832. *)
  833. XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION = (1 shl 7);
  834. (**
  835. * XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
  836. *
  837. * the schema has "substitution" in the set of blockDefault.
  838. *)
  839. XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION = (1 shl 8);
  840. (**
  841. * XML_SCHEMAS_INCLUDING_CONVERT_NS:
  842. *
  843. * the schema is currently including an other schema with
  844. * no target namespace.
  845. *)
  846. XML_SCHEMAS_INCLUDING_CONVERT_NS = (1 shl 9);
  847. {$ENDIF}
  848. {$IFDEF TYPE}
  849. (**
  850. * _xmlSchema:
  851. *
  852. * A Schemas definition
  853. *)
  854. xmlSchema = record
  855. name : xmlCharPtr; (* schema name *)
  856. targetNamespace : xmlCharPtr; (* the target namespace *)
  857. version : xmlCharPtr;
  858. id : xmlCharPtr; (* Obsolete *)
  859. doc : xmlDocPtr;
  860. annot : xmlSchemaAnnotPtr;
  861. flags : cint;
  862. typeDecl : xmlHashTablePtr;
  863. attrDecl : xmlHashTablePtr;
  864. attrgrpDecl : xmlHashTablePtr;
  865. elemDecl : xmlHashTablePtr;
  866. notaDecl : xmlHashTablePtr;
  867. schemasImports : xmlHashTablePtr;
  868. _private : pointer; (* unused by the library for users or bindings *)
  869. groupDecl : xmlHashTablePtr;
  870. dict : xmlDictPtr;
  871. includes : pointer; (* the includes, this is opaque for now *)
  872. preserve : cint; (* whether to free the document *)
  873. counter : cint; (* used to give ononymous components unique names *)
  874. idcDef : xmlHashTablePtr; (* All identity-constraint defs. *)
  875. volatiles : pointer; (* Obsolete *)
  876. end;
  877. {$ENDIF}
  878. {$IFDEF FUNCTION}
  879. procedure xmlSchemaFreeType(_type: xmlSchemaTypePtr); EXTDECL; external xml2lib;
  880. procedure xmlSchemaFreeWildcard(wildcard: xmlSchemaWildcardPtr); EXTDECL; external xml2lib;
  881. {$ENDIF}
  882. {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)