RE: Defining content based on attributes

Hi Jeni

Thanks for the response, I had started to come to realise that my initial
assumption that this would be easy were wrong.

For the suggestions - thanks - the xsi:type could be a good way to go (if I
cant get what I need with keys - see below).  I want to stay within the
boundaries of XSD so would rather transform to a unique named elements style
syntax and validate that rather than using schematron or switching to Relax
NG.

I have 2 questions (well, a comment and a question)

1 - Has anyone found a way round this using keys?  My thought was that I
could at least define which fileds must not be null using Keys - this
right??  Anyone found any cunning ways to define a bit more using this or is
non-null as good as it gets?  (would just about do for my current purposes)

2 - Isn't this a bit of an obvious flaw in XSD and is a fix / enhancement
intended - essentially (as I see it, anyway), you can only do useful
validation of data (rather than just structure) IF you have unique element
names in your XML?  I see one of the key benefits of XML as being is
flexibility - by using common element names processing templates and
functions are MUCH simpler - yes, there are work arounds but is it that big
an ask to have XSD able to define type by element name and then, say, extend
it depending on an attribute type (have NO idea how complex this would make
an implementation...)

Anyway - thanks for the suggestion sand clarification
Steve

Received on Monday, 22 September 2003 11:02:19 UTC