Home Products Consulting About Us White Papers Careers Contact Us Tutorials
 

 Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)

Tutorials - How to Declare an XML Namespace
Page 1 of 2

XML Namespaces are significant because they allow us to “disambiguate” XML names. For instance, suppose two different schemas define types with the same name. It’s important that there be some way indicate which data type we’re referring to when creating an instance of that type. This lesson describes how to go about declaring a namespace, making it available for use.

In order to use an XML namespace we must first declare it, associating that namespace’s URI with a prefix, usually a string between one and three characters in length. This is accomplished using the “register” keyword. To register a namespace follow the keyword “register with the keyword “namespace,” a prefix string, and the namespace URI.

 

 

In the example shown above, the namespace “www.cretaceossoftware.com/examples/education” is paired with the prefix “edu,” which may now be used a “shortcut” associated with the namespace. In this case, it is used to indicate that an instancing target “school-el” belongs to the namespace, allowing the target to be properly identified.

 

 

The target “school-el” is an element definition in the schema “education,” shown above.


 Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
Next Step

Move On To Next Step - "We Declared a Namespace, Now What?"

View Entire Code Sample

Read a Detailed Product Description

Read About Delve and XML-Schema Documents in Detail

Browse Product White Papers

 
Home Products Consulting About Us White Papers Careers Contact Us Tutorials