Re: Problems for XML schema



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
.



Relevant Pages

  • Re: Typed Dataset from xsd-File
    ... XDR to XSD ... Generates an XML schema from an XML-Data-Reduced schema file. ... Generates common language runtime DataSet classes from an XSD schema file. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: XML from Commerce server 2002 -> Biztalk 2004
    ... sample XML file from your CS2002 developers and use it to create a BTS2004 ... "A BizTalk Enthusiast" ... > files generated by Commerce Server 2002. ... > database and then generate the XML and XML schema corresponding to the ...
    (microsoft.public.biztalk.general)
  • [ANN] CodeSynthesis XSD/e 3.2.0 released
    ... licenses), dependency-free XML Schema to C++ compiler for mobile, embedded, ... It provides XML parsing, serialization, XML ... Support for schema evolution using substitution groups. ... Improved support for XML Schema facet validation, ...
    (comp.arch.embedded)
  • [ANN] CodeSynthesis XSD/e 3.2.0 released
    ... licenses), dependency-free XML Schema to C++ compiler for mobile, embedded, ... It provides XML parsing, serialization, XML ... Support for schema evolution using substitution groups. ... Improved support for XML Schema facet validation, ...
    (comp.os.linux.embedded)
  • [ANN] CodeSynthesis XSD/e 3.2.0 released
    ... licenses), dependency-free XML Schema to C++ compiler for mobile, embedded, ... It provides XML parsing, serialization, XML ... Support for schema evolution using substitution groups. ... Improved support for XML Schema facet validation, ...
    (microsoft.public.windowsce.embedded)