Jump to content

echotrain

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About echotrain

  • Rank
    Newbie
  1. I have run my application with the xs:choice structure, and it does the job! It's clearer to me now, having seeing it in action - it's like restricting an element to a string or an integer, but in the case of xs:choice, the type is one of the element definitions. Thanks for the ideas, boen_robot, especially the one that worked.
  2. You are right, boen_robot. I will run my application against this model Monday and post back, but I see no reason it should not work.
  3. xs:choice does not meet my requirement that both OptionalElementOne and OptionalElementTwo be permitted. It allows any number of one or the other, but not both.
  4. OK, here is what I came up with. It's not pretty, but it validates. I'll try it out on the application Monday and report back. <xs:element name="Record"> <xs:complexType> <xs:sequence> <xs:element name="RequiredElementOne"/> <xs:element name="RequiredElementTwo"/> <xs:element name="Holder" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="OneHolder" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element name="OptionalElementOne" minOccurs="0" maxOccurs="unbounded"/> </xs:seq
  5. I am using Visual Studio, and consequently the MSXML engine: 0, 1 or left blank is all it will accept. I did some searching on this and found these references: http://connect.microsoft.com/VisualStudio/feedback/details/122890/xsd-xml-editor-incorrectly-complains-about-maxoccurs-1-in-xs-all-compositor That page refers to W3.org: http://www.w3.org/TR/xmlschema-1/#declare-contentModel Stylus Studio makes the same complaint, and I found this on their site: http://www.stylusstudio.com/xmldev/200110/post90460.html Thanks very much for your help. I feel a solution is lurking out there. More brain
  6. Thanks for your reply, boen_robot. I could live with that, but I couldn't get it to work. I could not get my parser to accept xs:all nested inside xs:group, however it did work nested in xs:complexType. So far, so good. But, now I find that the maxOccurs limit on elements within xs:all is 1. Since the minOccurs on my OptionalElements is 0 and the maxOccurs is unbounded, a Record element could have any number of ElementHolders that each hold only one element. As might be imagined, the production data structure is considerably more complex than these examples, and could easily become clutte
  7. I am having trouble building a schema that will validate sequential required elements followed by randomly ordered optional elements. This XML snippet is an example: <Record> <RequiredElementOne>Must be first</RequiredElementOne> <RequiredElementTwo>Must be second</RequiredElementTwo> <OptionalElementOne>0-unbounded in any order</OptionalElementOne> <OptionalElementTwo>0-unbounded in any order</OptionalElementTwo></Record> Either of the OptionalElements may or may not be present, in any quantity, in any order, and they must fol
×
×
  • Create New...