Java EE and XML-related technologies

Source: Internet
Author: User

Since programming, it seems that in addition to the VB period, the. NET and Java periods have a crucial relationship with XML .. In net, both C/S and B/S are at least related to a *. config file. The essence is the XML file. In the Java era, the Web. xml file cannot be ignored. On the one hand. net is like a product, and many details do not need to be manually configured, but Java is more like a set of standards, and the integration of various operations and technologies is not high, not just to cultivate programming dummies; on the other hand, the flexibility of Java determines the position of XML.

After obtaining the Web. xml file in Java Web and comparing the. NET web. config file, you will find that the Web. xml file clearly points out its "XML formula file"-schema.

Schema describes the structure of an XML document and is considered as another standard to replace the DTD. The reasons are summarized as follows:

1. XML schema is richer and more effective than DTD.

2. XML schema is scalable for future additional content

3. XML schema is written in XML language

4. XML Schema supports data types

5. XML Schema supports namespaces.

XML Schema itself contains many elements used to describe the structure of XML documents. Several major introductions are as follows:

(1)
 
  
The root element of each XML schema file.
 
(2) element-defined attributes
(3) specifies the elements of the highest class for schema annotations.
(4)
 
  
Defines the text comment in the schema
 
(5)
 
  
Indicates that child elements must appear in a certain order. Each sub-element can appear any time
 
(6)
 
  
Only allow
  
   
An element in the declaration appears in the contained element.
  
 
(7)
 
  
Defines that an element or attribute value within the scope must be unique (no duplicates)
 
Now we open our Java Web project and find the Web. xml file. The simple display is as follows:
        
 
Its root node is
 
  
In this phase, some information is described as follows:
 
Xmlns specifies the namespace of the XML file, which works similar to the package in Java.
Xmlns: xsi specifies the specifications that the XML file complies.
Xsi: schemalocation refers to the schema resources used.
Now open the xsi: schemalocation specified URL, we will find that there are a lot of XSD files, where the schema file used in the XML file of our Java Web is a web-app_2_4.xsd, open it, we will see the web. XML file
 
  
Label definition and description. Based on the schema Knowledge mentioned above, believe this
 Web-app_2_4.xsd files we can roughly read, do not believe you read!
This article emphasizes the importance of XML and Its Related Technologies in software projects. No matter on that platform, no matter what type of projects it is, its role cannot be underestimated, understanding XML schema and other information can better configure our project. Of course, the application of XML and its related technologies is far more than this. For example, the application in data exchange and other aspects will also be encountered in the project practice.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.