Menu ▾ ▴

#199 Schematron uses prefix plcs:

closed-fixed
None
Schematron
fixed
5
2013-08-19
2013-05-23
No

The Schematron file uses the prefix plcs: in the schematron rules.
E.g.
<sch:rule context="//plcs:LifeCycleStage"></sch:rule>

As the XSD is elementFormDefault="unqualified" remove the prefix.

Also, the XPATH in a number of rules has an additional @uidRef=
E.g.

test="./plcs:Definition[not(@uidRef=(@uidRef=//plcs:ExternalItem/@uid or @uidRef=//plcs:ExternalOwlObject/@uid))]"

Discussion

  • Mike Ward

    Mike Ward - 2013-05-23

    fixed in:
    plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.6 and
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.25

     
  • Mike Ward

    Mike Ward - 2013-05-23

    and in:
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.26
    plcslib/xsl/generate_sch/plcs_psm_config.xml revision: 1.4

     
  • Rob Bodington

    Rob Bodington - 2013-05-24
    • Group: v1.1 --> plcs-plcslib-v1.0-cs03
     
  • Rob Bodington

    Rob Bodington - 2013-05-24

    In addition the schematron is not checking for the elements that are defined by @xsi:type

    E.g in XML

    <Product xsi:type="psm:ProductAsIndividual" uid="id015">
    

    The rule:

    <sch:rule context="//ProductDesignToIndividual">
        <sch:report test="./IndividualProduct[not(@uidRef=//ProductAsIndividual/@uid )]"
                >ProductDesignToIndividual: IndividualProduct/@uidRef=<sch:value-of select="./IndividualProduct[not(@uidRef=//ProductAsIndividual/@uid)]/@uidRef"/> declared for which there is no
                corresponding ProductAsIndividual/@uid</sch:report>
        </sch:rule>
    

    Fails as it is looking for <productdesigntoindividual> which will never exist
    It needs to be:</productdesigntoindividual>

    <sch:report test="./IndividualProduct[not(@uidRef=//ProductAsIndividual/@uid or @uidRef=//Product[@xsi:type='ProductAsIndividual']/@uid)]"
    
     

    Last edit: Rob Bodington 2013-05-24
  • Rob Bodington

    Rob Bodington - 2013-05-28

    A further issue is the rule

    <sch:rule context="//Classification">
            <sch:report
                test="not(./@classRef=//ExternalClass/@uid or ./@classRef=//ExternalOwlClass/@uid )"
    

    This assumes that Classification is a Property of type ExternalClass
    In fact the Block SecurityClassificationAssignment has a Property Classification of type SecurityClassification

     
  • Mike Ward

    Mike Ward - 2013-06-07

    <sch:rule context="//Classification"> changed to <sch:rule context="//ClassifiedAs/Classification"> and <sch:rule context="//Identifier"> changed to <sch:rule context="//Id/Identifier"> in plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.7
    and
    plcslib/xsl/generate_sch/plcs_psm_config.xml revision: 1.5
    and
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.27

     

    Last edit: Mike Ward 2013-06-07
    • Mike Ward

      Mike Ward - 2013-06-11

      These changes <sch:rule context="//Classification"> changed to <sch:rule context="//ClassifiedAs/Classification"> and <sch:rule context="//Identifier"> changed to <sch:rule context="//Id/Identifier"> reverted in:</sch:rule></sch:rule></sch:rule></sch:rule>

      plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.7
      and
      plcslib/xsl/generate_sch/plcs_psm_config.xml revision: 1.5
      and
      plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.28

       
  • plcs-ccb-admin

    plcs-ccb-admin - 2013-06-10
    • status: open-remind --> open
    • Resolution: none --> accepted
    • Group: plcs-plcslib-v1.0-cs03 --> plcs-plcslib-v1.0-csprd02
     
  • plcs-ccb-admin

    plcs-ccb-admin - 2013-06-10

    CCB Call 2013-06-10
    Accepted

     
  • Mike Ward

    Mike Ward - 2013-06-14

    fixed to cope with xsi:type declarations - eg:

    <sch:rule context="//AnalysisAssignment">
    <sch:report test="./AssignedAnalysis&lt;span&gt;[not(\@uidRef=//ProductVersion[substring-after(\@xsi:type, ':')='AnalysisVersion']/\@uid)]&lt;/span&gt;">AnalysisAssignment: AssignedAnalysis/@uidRef declared for which there is no
    corresponding ProductVersion/@xsi:type='AnalysisVersion' @uid</sch:report>
    </sch:rule>

    plcslib/xsl/generate_sch/plcs_psm_config.xml revision: 1.6
    plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.8
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.29

     
  • Rob Bodington

    Rob Bodington - 2013-06-16

    BaseRootObjects should NOT use xsi:type.
    E.g.

    <Product xsi:type="psm:ProductAsIndividual" uid="id015">
    

    Should be

    <ProductAsIndividual" uid="id015">
    

    There should be a schematron rule that enforces this:

        <sch:rule context="//PlcsDataContainer|DataContainer[@xsi:type='psm:PlcsDataContainer']/*">
            <sch:report test="@xsi:type">
                The element <name/> is defined by @xsi:type <value-of select="@xsi:type"/>. 
                Do not use @xsi:type for BaseRootObjects
                The element should be: [<value-of select="substring-after(@xsi:type,':')"/>]
            </sch:report>
        </sch:rule>
    
     

    Last edit: Rob Bodington 2013-06-16
  • Rob Bodington

    Rob Bodington - 2013-06-17
    • status: open --> pending
     
  • Mike Ward

    Mike Ward - 2013-06-17

    abstract blocks removed from xsi:typed element tests and pattern added that prevents creation of top level elements cotaining xsi:type -->
    <sch:pattern id="user-content-XsiPattern">
    <sch:rule context="//PlcsDataContainer|DataContainer/*">
    <sch:report test="@xsi:type"> The element <name> is defined by @xsi:type <value-of select="@xsi:type">. Do not use @xsi:type for BaseRootObjects The element
    should be: [<value-of select="substring-after(@xsi:type,':')">]</value-of> </value-of></name></sch:report>
    </sch:rule>
    </sch:pattern>
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.32
    plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.9

     
  • Mike Ward

    Mike Ward - 2013-06-17

    plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl,v <-- plcs_psm_xmi2sch.xsl
    psm prefix changed back to plcs:

    plcslib/plcslib/xsl/generate_sch/plcs_psm_xmi2sch.xsl revision: 1.10
    plcslib/data/PLCS/psm_model/plcs_psm.sch revision: 1.33

     
  • plcs-ccb-admin

    plcs-ccb-admin - 2013-08-19
    • Status: pending --> closed-fixed
    • Resolution: accepted --> fixed
     

Log in to post a comment.