|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | + <!-- PDS4 Schematron for Name Space Id:disp Version:1.5.1.0 - Thu Oct 20 21:50:14 UTC 2022 --> |
| 3 | + <!-- Generated from the PDS4 Information Model Version 1.19.0.0 - System Build 13.0 --> |
| 4 | + <!-- *** This PDS4 schematron file is an operational deliverable. *** --> |
| 5 | +<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"> |
| 6 | + |
| 7 | + <sch:title>Schematron using XPath 2.0</sch:title> |
| 8 | + |
| 9 | + <sch:ns uri="http://www.w3.org/2001/XMLSchema-instance" prefix="xsi"/> |
| 10 | + <sch:ns uri="http://pds.nasa.gov/pds4/pds/v1" prefix="pds"/> |
| 11 | + <sch:ns uri="http://pds.nasa.gov/pds4/disp/v1" prefix="disp"/> |
| 12 | + |
| 13 | + <!-- ================================================ --> |
| 14 | + <!-- NOTE: There are two types of schematron rules. --> |
| 15 | + <!-- One type includes rules written for --> |
| 16 | + <!-- specific situations. The other type are --> |
| 17 | + <!-- generated to validate enumerated value --> |
| 18 | + <!-- lists. These two types of rules have been --> |
| 19 | + <!-- merged together in the rules below. --> |
| 20 | + <!-- ================================================ --> |
| 21 | + <sch:pattern> |
| 22 | + <sch:rule context="disp:Display_Direction/disp:horizontal_display_direction"> |
| 23 | + <sch:assert test=". = ('Left to Right', 'Right to Left')"> |
| 24 | + <title>disp:Display_Direction/disp:horizontal_display_direction/disp:horizontal_display_direction</title> |
| 25 | + The attribute disp:Display_Direction/disp:horizontal_display_direction must be equal to one of the following values 'Left to Right', 'Right to Left'.</sch:assert> |
| 26 | + </sch:rule> |
| 27 | + </sch:pattern> |
| 28 | + <sch:pattern> |
| 29 | + <sch:rule context="disp:Display_Direction/disp:vertical_display_direction"> |
| 30 | + <sch:assert test=". = ('Bottom to Top', 'Top to Bottom')"> |
| 31 | + <title>disp:Display_Direction/disp:vertical_display_direction/disp:vertical_display_direction</title> |
| 32 | + The attribute disp:Display_Direction/disp:vertical_display_direction must be equal to one of the following values 'Bottom to Top', 'Top to Bottom'.</sch:assert> |
| 33 | + </sch:rule> |
| 34 | + </sch:pattern> |
| 35 | + <sch:pattern> |
| 36 | + <sch:rule context="disp:Display_Settings"> |
| 37 | + <sch:let name="horizontal_display_axis" value="disp:Display_Direction/disp:horizontal_display_axis"/> |
| 38 | + <sch:let name="vertical_display_axis" value="disp:Display_Direction/disp:vertical_display_axis"/> |
| 39 | + <sch:let name="local_identifier_reference" value="pds:Local_Internal_Reference/pds:local_identifier_reference"/> |
| 40 | + <sch:assert test="//pds:*[pds:local_identifier=$local_identifier_reference]/pds:Axis_Array[pds:axis_name=$horizontal_display_axis]"> |
| 41 | + <title>disp:Display_Settings/Rule</title> |
| 42 | + The horizontal display axis (<sch:value-of select='$horizontal_display_axis'/>) in display direction must match the name of an axis in the referenced Array (<sch:value-of select='$local_identifier_reference'/>)</sch:assert> |
| 43 | + <sch:assert test="//pds:*[pds:local_identifier=$local_identifier_reference]/pds:Axis_Array[pds:axis_name=$vertical_display_axis]"> |
| 44 | + <title>disp:Display_Settings/Rule</title> |
| 45 | + The vertical display axis (<sch:value-of select='$vertical_display_axis'/>) in display direction must match the name of an axis in the referenced Array (<sch:value-of select='$local_identifier_reference'/>)</sch:assert> |
| 46 | + </sch:rule> |
| 47 | + </sch:pattern> |
| 48 | + <sch:pattern> |
| 49 | + <sch:rule context="disp:Display_Settings/pds:Local_Internal_Reference"> |
| 50 | + <sch:assert test="pds:local_identifier_reference = //pds:*/pds:*/(pds:Array|pds:Array_2D|pds:Array_2D_Image|pds:Array_2D_Map|pds:Array_2D_Spectrum|pds:Array_3D|pds:Array_3D_Image|pds:Array_3D_Movie|pds:Array_3D_Spectrum)/pds:local_identifier |
| 51 | + "> |
| 52 | + <title>disp:Display_Settings/pds:Local_Internal_Reference/Rule</title> |
| 53 | + Display Dictionary: In the pds:Local_Internal_Reference class, the value of the pds:local_identifier_reference must match the value of the pds:local_identifer of an Array class or sub-class within the File_Area. |
| 54 | + </sch:assert> |
| 55 | + <sch:assert test="pds:local_reference_type = 'display_settings_to_array' |
| 56 | + "> |
| 57 | + <title>disp:Display_Settings/pds:Local_Internal_Reference/Rule</title> |
| 58 | + Display_Dictionary: For Local_Internal_Reference in disp:Display_Settings, local_reference_type must equal 'display_settings_to_array'. |
| 59 | + </sch:assert> |
| 60 | + </sch:rule> |
| 61 | + </sch:pattern> |
| 62 | + <sch:pattern> |
| 63 | + <sch:rule context="disp:Movie_Display_Settings"> |
| 64 | + <sch:assert test="if (disp:loop_flag) then disp:loop_flag = ('true', 'false') else true()"> |
| 65 | + <title>disp:Movie_Display_Settings/disp:loop_flag</title> |
| 66 | + The attribute disp:loop_flag must be equal to one of the following values 'true', 'false'.</sch:assert> |
| 67 | + <sch:assert test="if (disp:loop_back_and_forth_flag) then disp:loop_back_and_forth_flag = ('true', 'false') else true()"> |
| 68 | + <title>disp:Movie_Display_Settings/disp:loop_back_and_forth_flag</title> |
| 69 | + The attribute disp:loop_back_and_forth_flag must be equal to one of the following values 'true', 'false'.</sch:assert> |
| 70 | + </sch:rule> |
| 71 | + </sch:pattern> |
| 72 | + <sch:pattern> |
| 73 | + <sch:rule context="disp:Movie_Display_Settings/disp:frame_rate"> |
| 74 | + <sch:assert test="@unit = ('frames/s')"> |
| 75 | + <title>disp:Movie_Display_Settings/disp:frame_rate/disp:frame_rate</title> |
| 76 | + The attribute @unit must be equal to one of the following values 'frames/s'.</sch:assert> |
| 77 | + </sch:rule> |
| 78 | + </sch:pattern> |
| 79 | + <sch:pattern> |
| 80 | + <sch:rule context="disp:Movie_Display_Settings/disp:loop_delay"> |
| 81 | + <sch:assert test="@unit = ('day', 'hr', 'julian day', 'microseconds', 'min', 'ms', 'ns', 's', 'yr')"> |
| 82 | + <title>disp:Movie_Display_Settings/disp:loop_delay/disp:loop_delay</title> |
| 83 | + The attribute @unit must be equal to one of the following values 'day', 'hr', 'julian day', 'microseconds', 'min', 'ms', 'ns', 's', 'yr'.</sch:assert> |
| 84 | + </sch:rule> |
| 85 | + </sch:pattern> |
| 86 | +</sch:schema> |
0 commit comments