Pregunta

I have xml that could be

<group>
  <location/>
  <persistent/>
</group>

or

<group>
  <ui-location/>
  <persistent/>
</group>

Is there a way to have a wildcard for ui- part or is there some way to say that the element that appear there can be either location or ui-location?

¿Fue útil?

Solución

in answer to the 2nd part of your question. You can use xsd:choice:

element that appear there can be either location or ui-location

<xsd:sequence>
    <xsd:choice minOccurs="1" maxOccurs="1">
        <xsd:element name="location" type="xsd:string"/>
        <xsd:element name="ui-location" type="xsd:string"/>
    </xsd:choice>
</xsd:sequence>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top