MakeMusic
SmartMusic Finale Garritan MusicXML

Are complexTypes Elements? (drowning in xsd)

Moderator: Michael Good

Are complexTypes Elements? (drowning in xsd)

Postby Matthew.James.Briggs » Fri Aug 29, 2014 6:06 pm

In xml schema tutorials I find a lot of examples that look like this

Code: Select all
<xs:element name="note">
  <xs:complexType>
    <xs:sequence>
  <xs:element name="to" type="xs:string"/>
  <xs:element name="from" type="xs:string"/>
  <xs:element name="heading" type="xs:string"/>
  <xs:element name="body" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>


This is pretty easy to follow. In the musicxml.xsd document though, unless I'm missing something, the only xs:element objects defined are score-partwise and score-timewise.

There are many complexTypes in the specification, here's an example:
Code: Select all
<xs:complexType name="system-margins">
      <xs:annotation>
         <xs:documentation>[...]</xs:documentation>
      </xs:annotation>
      <xs:group ref="left-right-margins"/>
   </xs:complexType>


Is "system-margins" an element? If so, why is it not declared <xs:element name="system-margins">?

I'm having trouble understanding exactly what is an element in the specification since nothing is declared as an xs:element.

Help!

p.s. Currently I am only reading from musicxml.xsd and I am not referencing "attributes.mod", "barline.mod", etc. Maybe this is my problem? Is it required to read the .mod documents to define the music xml specification?
“Now that things are so simple, there's so much to do.” - Morton Feldman
http://matthewjamesbriggs.com
User avatar
Matthew.James.Briggs
 
Posts: 23
Joined: May, 2014
Location: Seattle, WA, USA
Reputation: 0
Software Owned:
Max OS X, Finale, Logic Pro, XCode, Xmplify, Sublime Text

Re: Are complexTypes Elements? (drowning in xsd)

Postby Matthew.James.Briggs » Fri Aug 29, 2014 6:14 pm

oops, I just realize that there are a lot of things declared as xs:element, just not many types are surrounded with <xs:element name="somename> </xs:element>

The crux of my question still stands though. I'm having trouble understanding what it means to have a complexType that is not surrounded by <xs:element></xs:element>.
“Now that things are so simple, there's so much to do.” - Morton Feldman
http://matthewjamesbriggs.com
User avatar
Matthew.James.Briggs
 
Posts: 23
Joined: May, 2014
Location: Seattle, WA, USA
Reputation: 0
Software Owned:
Max OS X, Finale, Logic Pro, XCode, Xmplify, Sublime Text

Re: Are complexTypes Elements? (drowning in xsd)

Postby Matthew.James.Briggs » Fri Aug 29, 2014 8:15 pm

I now see that a complexType can be used as the type="_" attribute of an xs:element.

Sorry for my nonsensical thread, I'm finding this very difficult to learn!
“Now that things are so simple, there's so much to do.” - Morton Feldman
http://matthewjamesbriggs.com
User avatar
Matthew.James.Briggs
 
Posts: 23
Joined: May, 2014
Location: Seattle, WA, USA
Reputation: 0
Software Owned:
Max OS X, Finale, Logic Pro, XCode, Xmplify, Sublime Text

Re: Are complexTypes Elements? (drowning in xsd)

Postby Michael Good » Tue Sep 02, 2014 11:03 am

No problem - XSD is not the easiest to learn or to read. Relax NG schemas are a lot easier but alas are not as widely implemented in XML toolkit software, though that's better now than before.
Michael Good
VP of MusicXML Technologies
MakeMusic, Inc.
User avatar
Michael Good
 
Posts: 2197
Joined: March, 2014
Reputation: 0

Who is online

Users browsing this forum: No registered users and 1 guest