0

I am using XSD to define a XML schema and I need to have the following element as a possible child element of any other element in the document.

<include path="include1.xml"/>

Is there an elegant way of defining this? I don't want to define include as a child element for each of the elements already defined within the XSD.

Igor Ševo
  • 5,459
  • 3
  • 35
  • 80
  • [Similar question](http://stackoverflow.com/questions/31235281/set-attribute-to-all-types-in-xml-schema) using default attributes instead of default elements. – sergioFC Dec 28 '15 at 00:22

1 Answers1

0

I decided to use XML processing instructions for this purpose, since using a XML element would violate the Unique Particle Attribution rule. I replaced XML element <include path="include1.xml"> with the following processing instruction.

<?include include1.xml?>

The two related posts can help resolve similar issues:

  1. XSD: Allow any unknown element in any order
  2. XSD: Allow elements from different namespace anywhere in a sequence
Community
  • 1
  • 1
Igor Ševo
  • 5,459
  • 3
  • 35
  • 80