Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help meunderstand how this translates into  RSS feed

 
Venkat Venkataramanan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I picked up this fragment from a DTD:


<xs:complexType name="oversight_info_struct">
<xs:sequence>
<xs:element name="authority" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="has_dmc" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

Does this mean:

1. The XML can have Zero-to-many instances of the element, authority"
2. Each authority element may or may not have an element, "has_dmc"

Venki
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the forums!

Venkat Venkataramanan wrote:I picked up this fragment from a DTD:


<xs:complexType name="oversight_info_struct">
<xs:sequence>
<xs:element name="authority" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="has_dmc" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

Does this mean:

1. The XML can have Zero-to-many instances of the element, authority"


The oversight_info_struct element type can have 0 or more child elements named "authority". Here's an example (assuming "oversight" element is of type oversight_info_struct):


Does this mean:

2. Each authority element may or may not have an element, "has_dmc"

No. Notice that the "oversight_info_struct" is being defined there and not the "authority" element. So it means that the oversight_info_struct type can have 0 or any number of child elements named "has_dmc".

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!