For namespaces, it should be relatively simple to understand OO ideas, especially for those who have learned C ++.
But many of my friends who read my previous articles seem not very clear about the namespace in their communication with me,
The following describes how to use namespaces in XML Schema and WSDL.
Let's take a look at a piece of JAVA code:
Package com. hongsoft. test. pkg1;
Import com. hongsoft. test. pkg2.Test1;
Import com. hongsoft. test. pkg2.Test2;
In this file, we set com. hongsoft. test. pkg2.Test1 and
Com. hongsoft. test. pkg2.Test2 is called the source class, and this class is called the target class.
Other classes in the com. hongsoft. test. pkg1 package are called default classes.
Then let's take a look at the usage of a namespace in XML Schema:
<Schema targetNamespace = 'http: // www.SampleStore.com/Account'
Xmlns = 'http: // www.w3.org/5o/xmlschema'
Xmlns: ACC = 'http: // www.SampleStore.com/Account'
Xmlns: PART = 'http: // www.PartnerStore.com/PartsCatalog'>
Here, we set xmlns: ACC = 'http: // www.samplestore.com/account' and
Xmlns: PART = 'http: // www.partnerstore.com/partscatalog' is called the source name space,
Call targetNamespace = 'http: // www.samplestore.com/account' as the target namespace.
Xmlns = 'http: // www.w3.org/5o/xmlschema' is the alias Space (we did not name it ).
Smart, do you already know what the namespace is?
Schema has been specified in the default namespace xmlns = 'http: // www.w3.org/5o/xmlschema '.
Therefore, you do not need to mark the namespace before it.
The method for directly using other classes in this package is the same. Therefore, when defining XML Schema, the default value is
All namespaces are xmlns = 'http: // www.w3.org/5o/xmlschema'. Of course, they are not specified.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.