0

How to write xsd schema that it would check if reference in xml to some element is valid?

Schema should mark error if "redbox" style would be absent in "styles". Code :

  <styles>
    <style name="www" color="#f0ff00" text-transform="uppercase"/>
    <style name="redbox" background-color="#ff0000" border="1"/>
  </styles>

Now I want make reference to use predefined attributes in my new element.

<div style="redbox" position="20 50 500 0" />

After 'decode' this div object would look like

<div background-color="#ff0000" border="1" position="20 50 500 0" />
Piotr M
  • 499
  • 3
  • 9
  • 27
  • which Language are you using? for c# you can serialize and then find specific element based on attribute and then check it is not null. – Umair M Jul 08 '15 at 11:15
  • c#, but I need to make xsd schema - I can't see how can I use c# here. – Piotr M Jul 08 '15 at 11:24
  • http://stackoverflow.com/questions/2015059/xsd-key-keyref-beginner-question This topic resolved my problem. – Piotr M Jul 08 '15 at 12:50

0 Answers0