首先,请原谅我,因为我对 xml/xsd 完全陌生。
我的 xml 文件中的一个节点看起来像这样......
<root>
  <XmlDetails>
    <XmlName>SomeName</XmlName>
    ....
    <XmlPath>path/SomeName</XmlPath>
    ...
  </XmlDetails>
  <XmlDetails>
    ...
</root
其中 XmlPath 将包含一些序言字符串(例如“path/”),后跟该节点的 XmlName 值。有没有办法在 xsd 文件中强制执行此操作?
我查看了 union 但我不确定如何获取 XmlName 元素的值。
<xs:element name="XmlPath"
  <xs:simpleType>
    <xs:union memberTypes="prolog epilog" />
  </xs:simpleType>
</xs:element>
<xs:simpleType name="prolog">
  <xs:restriction base="xs:string">
    <xs:enumeration value="path/"/>
    <xs:enumeration value="path2/"/>
    <xs:enumeration value="path3/"/>
  </xs:restriction>
</xs:simpleType> 
<xs:??? name="epilog">
  How to get the value of XmlName
</xs:??>
我正在尝试在 xsd 文件中执行的操作是否可行?