Community-Credit.com | NonProfitWays.com | SOAPitstop.com   Skin:   
      User: Not logged in 
Home
Newsletter Signup
XSLT Library
Latest XML Blogs
Featured Examples
Presentations
Featured Articles
Book Chapters
Training Courses
Events
NewsGroups
 
Discussions
Examples
Tutorials
Tools
Articles
Resources
Websites
 
Sign In
My Profile
My Articles
My Examples
My Favorites
My Resources
Add a Resource
Logout
 
About Me
My Blog
HeadGeek Articles
Talking Portfolio
Resume
Pictures
World Trip Pics

Reply: Regarding Schema Namespace ()

Date Posted:12/20/2006 9:24 AM
Posted by:
Mike Parker

   I am looking at tutorials for XML schemas.


The example xml code is listed below. I have had troubles digesting the meaning/purpose of the "namespace for the XML Schema Recommendation". I went to the address that is listed for this example, http://www.w3.org/2001/XMLSchema , and see that it is a documentation page. My question is, do i need to include the  <schema xmlns =  > attribute, or is this just  documentation which is used by convention. (thank you very much for any input)


<?xml version = "1.0" ?>


<schema xmlns = "http://www.w3.org/2001/XMLSchema">


   <element name = "Customer">


      <complexType>


         <sequence>


            <element name = "FirstName" type = "string" />


            <element name = "MiddleInitial" type = "string" />


            <element name = "LastName" type = "string" />


         </sequence>


      </complexType>


   </element>


</schema>


Date Posted:12/21/2006 3:44 PM
Posted by:
Gerald Schmidt
The namespace declaration is necessary. If, as in your case, the root element defines the default namespace xmlns="http://www.w3.org/2001/XMLSchema", the parser prefixes each tag in your document with the string http://www.w3.org/2001/XMLSchema.

Namespace-aware parsers will now report the start tag <element>, for example,  as <http://www.w3.org/2001/XMLSchema:element>. Without, the xmlns attribute, <element> would not be recognised and the schema itself would be invalid.

Similarly, if you begin the schema as follows:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

A namespace-aware parser will report the start tag <xs:element> as <http://www.w3.org/2001/XMLSchema:element>.






Fans of "The Office"
Dwight Bobbleheads are here!
  “It's me! I'm the bobblehead! Yes!”



Advertise on XMLPitstop

Advertise on XMLPitstop


EggHead Cafe
Web Servicee development
DotNetSlackers
Buy links on this site!
internet backup
Prada sunglasses
Video Surveillance
Web Designers
Color Laser Printer
Buy links on this site!

Interested in Text ads?
2,277 Total Members
42 members(last 30 days)
13 members(last 7 days)
3 members(today)

1,629 Total Discussions
17 Posts(last 30 days)
2 Posts(last 7 days)
1 Posts(today)

20,047 Total Blog Posts
2,133 Blogs(last 30 days)
573 Blogs(last 7 days)
56 Blogs(today)

8,699 Newsgroup Posts
0 Posts(last 30 days)
0 Posts(last 7 days)
0 Posts(today)

13,802 Total Resources
16 Resources(last 30 days)
1 Resources(last 7 days)
0 Resources(today)


 

David Silverlight's XMLPitstop.com| 2801 Florida Ave #225|Miami, FL 33133|Ph:305-447-1139