Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337232 - Certain schema causes elements to be our of order in corresponding xml files
Summary: Certain schema causes elements to be our of order in corresponding xml files
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ling Hao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-15 12:36 EST by Shenxue Zhou CLA
Modified: 2021-11-19 09:22 EST (History)
2 users (show)

See Also:


Attachments
The schema files (7.66 KB, application/zip)
2011-02-15 12:36 EST, Shenxue Zhou CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2011-02-15 12:36:32 EST
Created attachment 189024 [details]
The schema files

Using attached schema, I created an xml file with root element of "adfc-config" which contains "task-flow-definition" element using sapphire based editor. After adding a few "views" and some control flow rules, I noticed "view" elements are placed after "control-flow-rule" elements. Here is the xml:

<?xml version="1.0" encoding="UTF-8"?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/adf/controller http://xmlns.oracle.com/adf/controller/1.0">
    <task-flow-definition id="first">
        <control-flow-rule>
            <from-activity-id>view0</from-activity-id>
            <control-flow-case>
                <from-outcome>success</from-outcome>
                <to-activity-id>view1</to-activity-id>
            </control-flow-case>
            <control-flow-case>
                <from-outcome>failure</from-outcome>
                <to-activity-id>view2</to-activity-id>
            </control-flow-case>
        </control-flow-rule>
        <control-flow-rule>
            <from-activity-id>view2</from-activity-id>
            <control-flow-case>
                <from-outcome>success</from-outcome>
                <to-activity-id>view3</to-activity-id>
            </control-flow-case>
        </control-flow-rule>
        <view id="view1"></view>
        <view id="view2"></view>
        <view id="view0"></view>
        <view id="view3"></view>
    </task-flow-definition>
</adfc-config>

This results in xml validation errors since in the schema, "view" elements are supposed to be ahead of "control-flow-rule" elements.
Comment 1 Konstantin Komissarchik CLA 2011-02-16 15:16:25 EST
Please go ahead and work on debugging and fixing this. Ping me if you get stuck. The schema parser is located in XmlDocumentSchema class.
Comment 2 Ling Hao CLA 2011-05-02 18:06:59 EDT
Out of order caused by abstract and subsitutionGroup attributes not supported. 

Added unit test case
Verify insertion of view is now ahead of control-flow-rule element
Verify Coherence cache config
Comment 3 Konstantin Komissarchik CLA 2011-05-02 23:15:06 EDT
TestXmlXsd0001 is getting too overloaded. Its original purpose was to test handling of just the redefine directive. I'd like to keep it to that. Please create separate numbered tests to test handling of the include directive and substitution groups. Go ahead and create separate schemas for these too. That should make the test cases simpler and easier to understand.
Comment 4 Ling Hao CLA 2011-05-03 11:46:49 EDT
unit tests refactored
Comment 5 Shenxue Zhou CLA 2011-05-03 17:11:39 EDT
Verified the fix. Thanks Ling!