Re: Problems for XML schema
- From: Joe Kesselman <keshlam-nospam@xxxxxxxxxxx>
- Date: Mon, 10 Apr 2006 20:48:06 -0400
M. Fernandez wrote:
I have some problems in the design of my XML Schema. i don't really understand the difference between Type and element.
I'm not sure I understand the question.
Element is an XML concept. It means a unit represented by paired start-element and end-element tags (or a single tag which represents both. In your example,
<employee>
<firstname>John</firstname>
<lastname>Smith</lastname>
</employee>
employee, firstname, and lastname are all elements. This is independent of whether you use schemas, DTDs, or don't have a formal specification for the document at all.
Datatype is an XML Schema concept. When you define what an element can legally contain by writing a schema definition for it, you are deciding what its type will be. That may be a complex type (a structural description describing the possible attributes and children) or a simple type (a simple text string that conforms to one of Schema's built-in data representations, possibly constrained by "facets" to indicate which specific values are acceptable).
W3C's introduction to XML Schemas -- which, unfortunately, is still not the most readable document in the world -- can be found at
http://www.w3.org/TR/2004/REC-xmlschema-0-20041028/
Step-by-step tutorials in XML Schema -- and other XML topics -- can be found at many other websites. Of course I need to insert my standard plug for IBM's DeveloperWorks, http://www.ibm.com/xml
(BTW, I don't always agree with all the articles published on DeveloperWorks -- they operate as a semi-independent web magazine, which means that they'll sometimes publish stuff that goes in directions IBM officially disagrees with -- but for that very reason they're a useful place to find a good mix of advice and opinions.)
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
.
- References:
- Problems for XML schema
- From: M. Fernandez
- Problems for XML schema
- Prev by Date: Re: reading elements
- Next by Date: Re: reading elements
- Previous by thread: Problems for XML schema
- Index(es):
Relevant Pages
|