2

I have created the following XML file which is based on the XTCE standard. However, when I try to validate it, I see an error message,

Cannot Find The Declaration Of Element 'xtce:SpaceSystem'., Line '3', Column '81'

I do not see why, because the SpaceSystem element is part of both XSD schema file and XTCE documentation as a root element. Is there a problem with the header of the element or the link to the XSD scheme? And how can I update the file to make it valid?

<?xml version="1.0" encoding="UTF-8"?>
<xtce:SpaceSystem xmlns:xtce="http://www.omg.org/space/xtce"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="XTCE_V12_UT"
    xsi:schemaLocation="https://www.omg.org/spec/XTCE/20180204/SpaceSystem.xsd">
  <xtce:CommandMetaData>
    <ParameterTypeSet>
      <xtce:IntegerParameterType name="1ByteInteger" sizeInBits="8" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="14BitInteger" sizeInBits="14" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="11BitInteger" sizeInBits="11" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="10BitInteger" sizeInBits="10" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="6BitInteger" sizeInBits="6" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="5BitInteger" sizeInBits="5" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="4BitInteger" sizeInBits="4" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="3BitInteger" sizeInBits="3" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="2BitInteger" sizeInBits="2" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
      <xtce:IntegerParameterType name="1BitInteger" sizeInBits="1" signed="false">
        <xtce:UnitSet />
      </xtce:IntegerParameterType>
    </ParameterTypeSet>
    <xtce:ParameterSet>
      <xtce:Parameter parameterTypeRef="2BitInteger" name="CSP_PR" />
      <xtce:Parameter parameterTypeRef="5BitInteger" name="CSP_SRC" />
      <xtce:Parameter parameterTypeRef="5BitInteger" name="CSP_DEST" />
      <xtce:Parameter parameterTypeRef="6BitInteger" name="CSP_SRC_P" />
      <xtce:Parameter parameterTypeRef="6BitInteger" name="CSP_DEST_P" />
      <xtce:Parameter parameterTypeRef="4BitInteger" name="CSP_RES" />
      <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_HMAC" />
      <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_XTEA" />
      <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_RDP" />
      <xtce:Parametera parameterTypeRef="1BitInteger" name="CSP_CRC" />
    </xtce:ParameterSet>
    <xtce:ArgumentTypeSet>
      <xtce:EnumeratedArgumentType name="TimerStartStopType" sizeInBits="32">
        <xtce:UnitSet />
        <xtce:EnumerationList>
          <xtce:Enumeration label="TIMER_STOP" value="0" />
          <xtce:Enumeration label="TIMER_START" value="1" />
        </xtce:EnumerationList>
      </xtce:EnumeratedArgumentType>
    </xtce:ArgumentTypeSet>
    <xtce:CommandContainerSet>
      <xtce:CommandContainer name="CSPPacket" shortDescription="CSP Packet">
        <xtce:EntryList>
          <xtce:ContainerRefEntry containerRef="CSPPacketHeader" />
        </xtce:EntryList>
      </xtce:CommandContainer>
      <xtce:CommandContainer name="CSPPacketHeader" shortDescription="CCSDS TC Frame Header" abstract="true">
        <xtce:EntryList>
          <xtce:ParameterRefEntry parameterRef="CSP_PR" />
          <xtce:ParameterRefEntry parameterRef="CSP_SRC" />
          <xtce:ParameterRefEntry parameterRef="CSP_DEST" />
          <xtce:ParameterRefEntry parameterRef="CSP_SRC_P" />
          <xtce:ParameterRefEntry parameterRef="CSP_DEST_P" />
          <xtce:ParameterRefEntry parameterRef="CSP_RES" />
          <xtce:ParameterRefEntry parameterRef="CSP_XTEA" />
          <xtce:ParameterRefEntry parameterRef="CSP_RDP" />
          <xtce:ParameterRefEntry parameterRef="CSP_CRC" />
        </xtce:EntryList>
      </xtce:CommandContainer>
    </xtce:CommandContainerSet>
    <xtce:MetaCommandSet>
      <xtce:MetaCommand name="TimerStartStopCommand" shortDescription="Timer Start Stop Command">
        <xtce:ArgumentList>
          <xtce:Argument argumentTypeRef="TimerStartStopType" name="TimerStartStop" />
        </xtce:ArgumentList>
        <xtce:CommandContainer name="TimerStartStopCommand" shortDescription="Command TimerStartStopCommand Packet">
          <xtce:EntryList>
            <xtce:ArgumentRefEntry argumentRef="TimerStartStopType">
              <xtce:LocationInContainerInBits referenceLocation="containerStart">
                <xtce:FixedValue>0</xtce:FixedValue>
              </xtce:LocationInContainerInBits>
            </xtce:ArgumentRefEntry>
          </xtce:EntryList>
        </xtce:CommandContainer>
        <xtce:DefaultSignificance consequenceLevel="none" />
        <xtce:VerifierSet />
      </xtce:MetaCommand>
    </xtce:MetaCommandSet>
  </xtce:CommandMetaData>
</xtce:SpaceSystem>
kjhughes
  • 106,133
  • 27
  • 181
  • 240
Jiří Pešík
  • 324
  • 1
  • 4
  • 14

2 Answers2

3

As @kjhughes correctly pointed out, there is an incorrect namespaces handling.

I adjusted your XML namespaces declarations.

It still has few errors. But it will be easy for you to fix them now.

XML

<?xml version="1.0" encoding="UTF-8"?>
<xtce:SpaceSystem xmlns:xtce="http://www.omg.org/spec/XTCE/20180204"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  name="XTCE_V12_UT"
                  xsi:schemaLocation="http://www.omg.org/spec/XTCE/20180204 https://www.omg.org/spec/XTCE/20180204/SpaceSystem.xsd">
    <xtce:CommandMetaData>
        <xtce:ParameterTypeSet>
            <xtce:IntegerParameterType name="1ByteInteger" sizeInBits="8"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="14BitInteger" sizeInBits="14"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="11BitInteger" sizeInBits="11"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="10BitInteger" sizeInBits="10"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="6BitInteger" sizeInBits="6"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="5BitInteger" sizeInBits="5"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="4BitInteger" sizeInBits="4"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="3BitInteger" sizeInBits="3"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="2BitInteger" sizeInBits="2"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
            <xtce:IntegerParameterType name="1BitInteger" sizeInBits="1"
                                       signed="false">
                <xtce:UnitSet/>
            </xtce:IntegerParameterType>
        </xtce:ParameterTypeSet>
        <xtce:ParameterSet>
            <xtce:Parameter parameterTypeRef="2BitInteger" name="CSP_PR"/>
            <xtce:Parameter parameterTypeRef="5BitInteger" name="CSP_SRC"/>
            <xtce:Parameter parameterTypeRef="5BitInteger" name="CSP_DEST"/>
            <xtce:Parameter parameterTypeRef="6BitInteger" name="CSP_SRC_P"/>
            <xtce:Parameter parameterTypeRef="6BitInteger" name="CSP_DEST_P"/>
            <xtce:Parameter parameterTypeRef="4BitInteger" name="CSP_RES"/>
            <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_HMAC"/>
            <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_XTEA"/>
            <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_RDP"/>
            <xtce:Parameter parameterTypeRef="1BitInteger" name="CSP_CRC"/>
        </xtce:ParameterSet>
        <xtce:ArgumentTypeSet>
            <xtce:EnumeratedArgumentType name="TimerStartStopType"
                                         sizeInBits="32">
                <xtce:UnitSet/>
                <xtce:EnumerationList>
                    <xtce:Enumeration label="TIMER_STOP" value="0"/>
                    <xtce:Enumeration label="TIMER_START" value="1"/>
                </xtce:EnumerationList>
            </xtce:EnumeratedArgumentType>
        </xtce:ArgumentTypeSet>
        <xtce:CommandContainerSet>
            <xtce:CommandContainer name="CSPPacket"
                                   shortDescription="CSP Packet">
                <xtce:EntryList>
                    <xtce:ContainerRefEntry containerRef="CSPPacketHeader"/>
                </xtce:EntryList>
            </xtce:CommandContainer>
            <xtce:CommandContainer name="CSPPacketHeader"
                                   shortDescription="CCSDS TC Frame Header"
                                   abstract="true">
                <xtce:EntryList>
                    <xtce:ParameterRefEntry parameterRef="CSP_PR"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_SRC"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_DEST"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_SRC_P"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_DEST_P"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_RES"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_XTEA"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_RDP"/>
                    <xtce:ParameterRefEntry parameterRef="CSP_CRC"/>
                </xtce:EntryList>
            </xtce:CommandContainer>
        </xtce:CommandContainerSet>
        <xtce:MetaCommandSet>
            <xtce:MetaCommand name="TimerStartStopCommand"
                              shortDescription="Timer Start Stop Command">
                <xtce:ArgumentList>
                    <xtce:Argument argumentTypeRef="TimerStartStopType"
                                   name="TimerStartStop"/>
                </xtce:ArgumentList>
                <xtce:CommandContainer name="TimerStartStopCommand"
                                       shortDescription="Command TimerStartStopCommand Packet">
                    <xtce:EntryList>
                        <xtce:ArgumentRefEntry argumentRef="TimerStartStopType">
                            <xtce:LocationInContainerInBits referenceLocation="containerStart">
                                <xtce:FixedValue>0</xtce:FixedValue>
                            </xtce:LocationInContainerInBits>
                        </xtce:ArgumentRefEntry>
                    </xtce:EntryList>
                </xtce:CommandContainer>
                <xtce:DefaultSignificance consequenceLevel="none"/>
                <xtce:VerifierSet/>
            </xtce:MetaCommand>
        </xtce:MetaCommandSet>
    </xtce:CommandMetaData>
</xtce:SpaceSystem>
Yitzhak Khabinsky
  • 18,471
  • 2
  • 15
  • 21
1

Two problems1 are preventing the XML from being associated with the XSD:

  1. The value of xsi:schemaLocation should be space-separated pairs of an XML namespace and its associated XSD URI,

  2. The namespace of the root element of your XML must match the target namespace of the governing XSD.

So change

xsi:schemaLocation="https://www.omg.org/spec/XTCE/20180204/SpaceSystem.xsd">

to

xsi:schemaLocation="http://www.omg.org/spec/XTCE/20180204
                    https://www.omg.org/spec/XTCE/20180204/SpaceSystem.xsd">

to hint to the validator to look in https://www.omg.org/spec/XTCE/20180204/SpaceSystem.xsd for components in the http://www.omg.org/spec/XTCE/20180204 namespace.

and change

xmlns:xtce="http://www.omg.org/space/xtce"

to

xmlns:xtce="http://www.omg.org/spec/XTCE/20180204"

to place the root element in the target namespace of the governing XSD.

See also


1 Credit: Second problem was first caught by @YitzhakKhabinsky – upvote his answer!

kjhughes
  • 106,133
  • 27
  • 181
  • 240