d040374fa0
Check when an <element> has its own "block" attribute (as opposed to the block being done by the type) Testsuite results: 1361 failures J302-043
Emmanuel Briot
2010-11-05 10:49:12 +00:00
a60d69c83a
Report substitutionGroup as unsupported for now. Testsuite results: 1374 failures J302-043
Emmanuel Briot
2010-11-05 10:49:09 +00:00
ea49754930
Check that a type substitution is valid Added simple type hierarchy, needed for the verification above. Testsuite results: 1442 results J302-043
Emmanuel Briot
2010-11-05 10:49:07 +00:00
f7bd7e6543
Added handling of "final" to prevent extensions or restrictions and to prevent unions and lists Testsuite results: 1485 failures J302-043
Emmanuel Briot
2010-11-05 10:49:05 +00:00
557e720698
Added support for <ur-Type> An element with no defined type accepts any number of children (to any depth level), any attribute, and mixed content (Dump_Dot_NFA): new subprogram Testsuite results: 1499 failures J302-043
Emmanuel Briot
2010-11-05 10:49:02 +00:00
e0300c2150
Fix handling of NMTOKENS and NCNames: we should not check the length of the string, but the number of elements in the list Testsuite results: 1512 failures J302-043
Emmanuel Briot
2010-11-05 10:49:00 +00:00
4ebc4d36be
Added support for "fixed" in <element> Also check that the value given in the XSD is valid, which was not checked on implementation before the state machine. Testsuite results: 1580 J302-043
Emmanuel Briot
2010-11-05 10:48:56 +00:00
d11e759153
(Normalize_Whitespace): fix handling of Collapse (Active_State_Iterator): replaces the generic procedure For_Each_Active_State. Added support for replacing the NFA type with the type specified in xsi:type Current testsuite result: 1583 J302-043
Emmanuel Briot
2010-11-05 10:48:54 +00:00
b4334ec705
Verify that a type given in xsi:type attribute exists Testsuite results: 1596 failues J302-043
Emmanuel Briot
2010-11-05 10:48:51 +00:00
e848728446
Adding validating of facets for a <union> Testsuite results: 1598 failures J302-043
Emmanuel Briot
2010-11-05 10:48:49 +00:00
fb7ec71838
Add validation of <list> facets (length, minLength and maxLength, as well as pattern and enumerations) Same for NMTOKENS and NCNames Testsuite results: 1810 failures J302-043
Emmanuel Briot
2010-11-05 10:48:48 +00:00
d32d9ed7ef
(Facets): add an explicit mask to find out which facets are implemented. Depending on a default value to indicate that a facet is unset will not work in practice, since the user might be using that special value. Testsuite results: 5715 failures J302-043
Emmanuel Briot
2010-11-05 10:48:46 +00:00
2d663930fb
Put back support for <anyAttribute> Properly store attributes defined in a <restriction> Handles use="prohibited" for attributes No remaining internal error in the testsuite. Results: 5736 failures J302-043
Emmanuel Briot
2010-11-05 10:48:44 +00:00
b8708c2464
Properly detect cases where length, minLength, maxLength, totalDigits or fractionDigits are not integers. Make the number of possible active states in a NFA matcher bigger than 256, needed for some tests (Override): raise error when the pattern is invalid Fixes all internal errors but 2 in the testsuite Current result: 5858 failures J302-043
Emmanuel Briot
2010-11-05 10:48:41 +00:00
00d7c42858
(Lookup_Simple_Type): flag error if the base type is not a simpleType Testsuite results: 6152 => 6148 failures J302-043
Emmanuel Briot
2010-11-05 10:48:39 +00:00
beffee042a
No store the type definitions directly in the NFA states. Instead, we use one level of indirection, and only store an index into a global table for each state. This results in a smaller state machine (since all dummy states do not take up space for nothing), but more importantly allows changing the type definition even after the states have been created. Needed for act_testsuites/F511-007, where a local element is a ref to a global element. The latter has been created before we know its full type, so that local ref also does not receive a type at the time of its creation. The global element's type was properly set later on, but never that of the ref. Do not create states in the NFA for simpleType. This also saves up on the number of states (768 states for the metaschema vs 904 before) Total failuers in schema testsuite: 6681 -> 6152 J302-043
Emmanuel Briot
2010-11-05 10:48:37 +00:00
22cb709dd3
(Schema_NFA): now stores the various htables to access the NFA, rather than storing those in the grammar. This will be used the number of parameters to pass around, and make for a nicer self-contained structure. J302-043
Emmanuel Briot
2010-11-05 10:48:34 +00:00
2d55dbbcab
(Process): when a nested NFA is terminated, we now also terminate the superstate. This fixes the handling of ignorable_whitespace: when we leave it active, it is returned by For_All_Active_States, and therefore the state we just existed (for instance because a tag was closed) will still influence the decision on whether to preserve the ignorable whitespaces. See test act_testsuite/F511-007 (Dump): Add support for ignoring some states in the output. Useful in particular since the grammar will always contain the big metaschema, and it is therefore more difficult to find the user-part of the NFA. (Finish_Extension): new subprogram. Fixes handling of <complexType><simpleContent><extension> In particular, fix handling of attributes in such a context (attributes defined in the extension were always ignored) (Create_Element_State): when an element is a ref, we need to copy the type information from the corresponding global element (which wasn't done, so a ref element never had a simpleType -- we already copied the complexType correctly) Total failures in schema testsuite: 6681 J302-043
Emmanuel Briot
2010-11-05 10:48:31 +00:00
678500dfc7
Fix internal error when finding <complexType><simpleContent> Handling of simpleContent is likely not complete yet J302-043
Emmanuel Briot
2010-11-05 10:48:29 +00:00
a95a7db8e0
Fix handling of form=unqualified local elements J302-043
Emmanuel Briot
2010-11-05 10:48:25 +00:00
7f0a004bf4
(Validate_Length_Facets): fix typo, we were never computing the length of the string for minLength and maxLength
Emmanuel Briot
2010-11-05 10:48:22 +00:00
d4bd73dd14
Added support for <pattern> Including freeing the allocated Pattern_Matcher on exit
Emmanuel Briot
2010-11-05 10:48:20 +00:00
64eeefab02
Minor optimization in the size of states for the state machine
Emmanuel Briot
2010-11-05 10:48:17 +00:00
05fc7e60b7
Fix various memory leaks and access to uninitialized variables, detected by valgrind on the schema testsuite (Locators): no longer store a locator in schema readers, but instead directly access the one in sax-readers. This avoids access to freed memory, since when Parse has finished (but before we create the NFA), the locator has been deallocated.
Emmanuel Briot
2010-11-05 10:48:15 +00:00
ed7b00695f
(Hash): copy new version from GNAT's namet, which is more efficient at avoiding name collisions (Locators): no longer a smart pointer, since a location itself is now much lighter wait. The call to Get() represented 6% of the total time when running the schema testsuite (96_267_440 calls) Running the schema testsuite went from 18s down to 13.268s, on par with the timing we had before the move to the state machine
Emmanuel Briot
2010-11-05 10:48:11 +00:00
457e7c1739
(Global_References): now implemented as Sax.HTable rather than GNAT.Dynamic_Htables, so that we can easily do partial cleanups. (Reset): put back support for preserving only the metaschema in the grammar, and reseting all the rest. This puts back the time to run the whole schema testsuite from 6.2min down to 34s
Emmanuel Briot
2010-11-05 10:48:08 +00:00
53c4c5f8ad
Parse schema.xsd for every test. This is slow, but enables more tests
Emmanuel Briot
2010-11-05 10:48:04 +00:00
d3cfec515e
Fix a few errors that occurred in the testsuite: One internal error, because we are not validating the XSD itself for now fractionDigits <= totalDigits should only be checked when both are specified by the user
Emmanuel Briot
2010-11-05 10:48:02 +00:00
dfd7a4d599
(Set_Locator, Locator): new subprogram Fixes resolution of URI when loading secondary XSD files
Emmanuel Briot
2010-11-05 10:48:00 +00:00
d0f4fc55b7
(Repeat): redo the implementation to avoid quadratic algorithm. We now need to traverse the nodes only once. In particular, major speed enhancements on cases like particlesZ005.xml For now, we limit the maximum value of maxOccurs, since otherwise we are creating huge NFA. These cases are mostly degenerate cases only in the testsuite, which are unlikely to occur in practice. To handle cases like maxOccurs="999999" we will need to avoid duplicating states in the NFA We are finally able to run the testsuite again, without blocking forever on some tests (most of these cases were simply not detecting before, because the mutually dependent types/groups/... were never used -- this was an error)
Emmanuel Briot
2010-11-05 10:47:58 +00:00
f87fd3e464
(Repeat): maxOccurs can be 0 in schemas (Mark_Active): fix subtle bug when the table of active states is resized during a recursive call, since we ended up with an unset access or a Storage_Error. Showed up in the schema testsuite for particlesZ005
Emmanuel Briot
2010-11-05 10:47:55 +00:00
48fc82c339
(Process_Details): fix possible infinite recursion when an extension is indirectly based on itself Similar fix for simpleType (a union has a member derived from this union) and for attributeGroup J302-043
Emmanuel Briot
2010-11-05 10:47:53 +00:00
fefb396870
Added support for an <element> with no "type" attribute and no local type. This defaults to <anyType> J302-043
Emmanuel Briot
2010-11-05 10:47:51 +00:00
f0e5d70757
Fix location of error messages for references to undefined attributeGroup J302-043
Emmanuel Briot
2010-11-05 10:47:49 +00:00
7c2584fd83
(Normalize_Whitespace): new subprogram Do whitespace normalization when analyzing the contents of elements J302-043
Emmanuel Briot
2010-11-05 10:47:47 +00:00
cbb564ac57
Put back check for type IDREF and IDREFS, unsupported for now Compared to the previous implementation, we now display the location for the error J302-043
Emmanuel Briot
2010-11-05 10:47:44 +00:00
ba878436e8
Added support for predefined attribute xml:space J302-043
Emmanuel Briot
2010-11-05 10:47:42 +00:00
4fa0be6306
Fix location of error messages for simpleType: for character content, we now point to the beginning of the content, rather than the beginning of the close tag as we did before; for attributes, this is the start of the attribute J302-043
Emmanuel Briot
2010-11-05 10:47:40 +00:00
89b8ca1990
Accept attributeGroup nested in another attributeGroup Correctly report errors that occur while loading a schemaLocation from an XML file (we used to properly raise the exception, but with no message) J302-043
Emmanuel Briot
2010-11-05 10:47:37 +00:00
039d67bbfa
Fix handling of <any>: we were missing a transition on <close> Fix handling of repeat: avoid code duplication, and properly handle cases where for instance the topmost <sequence> itself contains minOccurs or maxOccurs J302-043
Emmanuel Briot
2010-11-05 10:47:35 +00:00
2b6ae312e7
Improve support for ignorable whitespaces and character data (in particular ignore some of the states in the NFA when checking whether character data is expected) Added support for <simpleContent> and <complexContent> Improve support for <extension> when the base type was defined in another XSD (not complete yet, only simpleTypes are accepted for now) J302-043
Emmanuel Briot
2010-11-05 10:47:33 +00:00
9238a95c6e
Various fixes (check that mixed content is allowed, handle a <complexType> with no content and just attributes,...) J302-043
Emmanuel Briot
2010-11-05 10:47:31 +00:00
c786272269
(Validation_Error): store the error message as a symbol to avoid memory leaks (Free): removed, no longer needed J302-043
Emmanuel Briot
2010-11-05 10:47:29 +00:00
1419992397
Added support for local types in <union> and <list> J302-043
Emmanuel Briot
2010-11-05 10:47:26 +00:00
f872850c8b
An attribute with no specified type is a ur-type J302-043
Emmanuel Briot
2010-11-05 10:47:24 +00:00
1d07194fb9
Added support for <list> J302-043
Emmanuel Briot
2010-11-05 10:47:23 +00:00
d93bf21fa1
Added support for enumerations Added missing file in previous check ins (Schema.Simple_Types) J302-043
Emmanuel Briot
2010-11-05 10:47:20 +00:00
ddd44c8ae5
Added support for setting simple types facets from XSD files Added support for simpleType restrictions (including when the base type is defined later on in the XSD file) Added support for union J302-043
Emmanuel Briot
2010-11-05 10:47:17 +00:00
fb48ada9b2
Added support for global attributes in a schema J302-043
Emmanuel Briot
2010-11-05 10:47:15 +00:00
8fa797e87e
Added support for the remaining builtin simpleType J302-043
Emmanuel Briot
2010-11-05 10:47:12 +00:00
4c369db81c
(XML_Validator, XML_Type, XML_Element): removed, no longer used J302-043
Emmanuel Briot
2010-11-05 10:47:07 +00:00
ce7dda898a
Rewrite support for simpleType We no longer use an XML_Validator, but explicit case statements for the builtin primitive types defined by W3C. This removes all memory leaks when parsing test.xsd and test.xml, and simplifies memory management. This also removes a lot of code J302-043
Emmanuel Briot
2010-11-05 10:47:04 +00:00
c4722611f4
(Arbitrary_Precision_Number): reimplemented using symbols, rather than controlled types. This is much more efficient J302-043
Emmanuel Briot
2010-11-05 10:47:00 +00:00
19a2ebeaab
(XML_Grammar_NS): removed. We now only need the URI, in the form of a Symbol, and do not need to waste time allocating and looking up an extra XML_Grammar_NS type J302-043
Emmanuel Briot
2010-11-05 10:46:58 +00:00
8d457c5dd3
Make sure we use gnatmake -j appropriately. Apparently, gnatmake will ignore builder switches if they are defined in a shared project
Emmanuel Briot
2010-11-05 10:46:54 +00:00
bcd104740e
Store the attributes in a GNAT.Table, rather than through dynamic allocation. Since the lists of attributes get copied around when new states are created in the NFA, we ended up with memory leaks J302-043
Emmanuel Briot
2010-11-05 10:46:52 +00:00
159c912de3
We can now validate test.xsd from schema.xsd J302-043
Emmanuel Briot
2010-11-05 10:46:50 +00:00
a911d317bd
(State_Machine): remove support for the Nested_Must_Be_Final mode. It isn't used by the schema validator, and makes the machine slower when used. Better to force users to use the on_exit callbacks instead. J302-043
Emmanuel Briot
2010-11-05 10:46:48 +00:00
c344468b06
(state_machine): no longer use the Nested_Must_Be_Final mode when parsing schema. (Transition_Close_Nested): renamed to Transition_Close We now explicitly show all close tag events in the NFA, since otherwise the algorithm to emit it only when changing nesting level was incorrect (it should depend on whether we had a simpleType or complexType, for instance). J302-043
Emmanuel Briot
2010-11-05 10:46:45 +00:00
720aa411f5
(Repeat): fix handling of states with nested NFA Added corresponding testcase
Emmanuel Briot
2010-11-05 10:46:43 +00:00
8cd5231af9
(Initialize): new parameter States_Are_Statefull This changes the generated NFA for Repeat, so that when a transition is optional we end up on a neutral state, not one with callbacks for Validate_Characters. J302-043
Emmanuel Briot
2010-11-05 10:46:41 +00:00
2f11835f33
(NFA_Matcher): add support for modifying the state machine while a matcher is performed. Previous implementation would raise a CE if more states are added to the machine. This reduces the number of allocations for teststate from 83 down to 69 (although we do allocate a bit more due to the initial size of Matcher_State_Arrays). J302-043
Emmanuel Briot
2010-11-05 10:46:38 +00:00
45a943689a
When handling xsi:namespaceLocation, we are adding states to the NFA. As a result, existing matchers will not contain enough states, and therefore will eventually raise Constraint_Error. J302-043
Emmanuel Briot
2010-11-05 10:46:36 +00:00
8257a960c8
Fix handling of <input>, and sharing of the temporary htables. Otherwise, an element declared in an input XSD will not be found when generating the NFA J302-043
Emmanuel Briot
2010-11-05 10:46:34 +00:00
081317b3ea
Add support for global attributes Fix some cases of missing proper location in error messages (in particular for unsupported features) J302-043
Emmanuel Briot
2010-11-05 10:46:32 +00:00
d10ecb2225
Use XSD 1.1 version
Emmanuel Briot
2010-11-05 10:46:29 +00:00
e54a8f71b4
Fix handling of <include> (ie we must not try to create the NFA after parsing the included XSD, since it might require elements from the including XSD) This ensures we can parse the W3C schema.xsd and datatypes.xsd normative metaschema Report proper location when an attribute has an unknown type J302-043
Emmanuel Briot
2010-11-05 10:46:27 +00:00
a341f963a6
Use version for XSD 1.0 for now, since XSD 1.1 introduced new facets not supported yet J302-043
Emmanuel Briot
2010-11-05 10:46:24 +00:00
b6e828670e
(Location): new type Review use of locators. In particular, use symbols rather than string_access to store system_id and public_id, so that users do not have to free the Location. Eventually, we might be able to remove the use of smart pointers for Locator, although this might break the API J302-043
Emmanuel Briot
2010-11-05 10:46:22 +00:00
26fe5dc3dd
Added support for qualified names in DTD, needed to parse the W3C datatypes.xsd file J302-043
Emmanuel Briot
2010-11-05 10:46:18 +00:00
86473ce5f1
Review handling of attributes (remove Attribute_Validator, replaced by a standard record type). This removed support for <anyAttribute> temporarily J302-043
Emmanuel Briot
2010-11-05 10:46:12 +00:00
52e9990b74
Create simpleType only when creating the NFA. This avoids the need for forward declaration. Add support for loading multiple namespaces (through xsi:noNamespaceSchemaLocation for instance) into the same grammar. J302-043
Emmanuel Briot
2010-11-05 10:46:09 +00:00
fb74f568d2
Do not create a XML_Type for complex types, only for simple types. These were no longer used in any case, since complex types are handled through the state machine J302-043
Emmanuel Briot
2010-11-05 10:46:05 +00:00
49526caeca
(Context): now longer a list, to limit the number of allocations. Went from 758 allocs down to 703 on test.xsd/test.xml J302-043
Emmanuel Briot
2010-11-05 10:46:04 +00:00
ceb62459b2
Add support for <all> J302-043
Emmanuel Briot
2010-11-05 10:46:02 +00:00
482150e2cb
Added support for <restriction> of complexType J302-043
Emmanuel Briot
2010-11-05 10:45:59 +00:00
c8fe1a05de
Remove no longer needed code (no handled by the state machine) J302-043
Emmanuel Briot
2010-11-05 10:45:56 +00:00
5eab48f8a9
Added support for <extension> J302-043
Emmanuel Briot
2010-11-05 10:45:53 +00:00
f254706101
Remove support for XML_Group, already implemented in the state machine J302-043
Emmanuel Briot
2010-11-05 10:45:49 +00:00
ecd0821649
Added support for <attributeGroup> In particular, simplifies the check of attribute validity, since we no longer need to recurse over nested groups (the lists have been flatten) J302-043
Emmanuel Briot
2010-11-05 10:45:46 +00:00
1b1588eae3
Added support for <group> J302-043
Emmanuel Briot
2010-11-05 10:45:43 +00:00
6e80b9cb4b
Remove no longer needed code, superceded by the state machine. J302-043
Emmanuel Briot
2010-11-05 10:45:41 +00:00
4120bcce09
Added support for <any> J302-043
Emmanuel Briot
2010-11-05 10:45:37 +00:00
4a816f87da
Added support for checking characters within a tag J302-043
Emmanuel Briot
2010-11-05 10:45:35 +00:00
dc1b3f1af6
Put back support for attributes J302-043
Emmanuel Briot
2010-11-05 10:45:33 +00:00
736fec64c2
Fix memory leak in previous check in J302-043
Emmanuel Briot
2010-11-05 10:45:31 +00:00
1653c40f68
No longer create the NFA on the fly. This is much harder to do, since some elements and types might be referenced before they have been declared. Instead, we now create a temporary data structure to hold the whole schema (for a single NS), which is then to create the NFA more simply. (Sax.State_Machines): remove support for state aliases. They are no longer needed, and make the storage of states bigger J302-043
Emmanuel Briot
2010-11-05 10:45:28 +00:00
633f9fdebb
Remove old code to test particules, that is already partially replaced (and shortly will be fully replaced) by the state machine J302-043
Emmanuel Briot
2010-11-05 10:45:25 +00:00
878fbdc5e5
Initial support for validating attributes through the state machine (in fact, the attributes themselves are not validated through the state machine, since they could appear in any order and we need to check they appear only once, which would lead to an explosion in the number of states -- instead the list of valid attributes is stored in each state) J302-043
Emmanuel Briot
2010-11-05 10:45:21 +00:00
fb58ab22bf
Initial implementation of validating through the state machine. The new code correctly validated test.xml, but the old code fails here! J302-043
Emmanuel Briot
2010-11-05 10:45:18 +00:00
000851f259
Initial implementation of state aliases, to resolve element references (for instance when an element is referenced in a schema before it has been declared) J302-043
Emmanuel Briot
2010-11-05 10:45:15 +00:00
f955952376
(Sax.State_Machines): add support for custom state images. Useful when debugging state machines, in particular the ones for a grammar J302-043
Emmanuel Briot
2010-11-05 10:45:12 +00:00
1a0703e329
Rewrite the schema validator using an explicit state machine J302-043
Emmanuel Briot
2010-11-05 10:45:08 +00:00
e154a29df5
When xmlada-config is run with --cflags, output switches suitable for gcc (as documented), not gnatmake switches. Fixes JA21-015
Thomas Quinot
2010-10-22 14:21:03 +00:00