Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Can this be done in XSD?

Back to Forum: Tech Off
  • User profile image
    Sven Groot

    I have the following XML document.
    <foo:Bar xmlns:foo="urn:foo-namespace">
      <SomeElt foo:id="test" foo:someparam="bar" someotherparam="someothervalue" />
    I want to create a schema for the foo namespace. The Bar element should be able to contain any element without a namespace. This is easily accomplished by using <xs:any namespace="##local" processContents="skip" />
    However, as you can see, these elements do contain attributes from the foo namespace. Is it possible to have these attributes validated. For instance if foo:someparam is a simpleType enumeration that allows only the values "foo" and "foo2", how would I have it trigger a schema exception on the above document? What do I need to write in my XSD to make it validate those attributes. Obviously processContents="skip" is wrong, but "lax" has the same results.
    Is there any way this can be done, and if so, how?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.