Nowadays, it seems that any software development is inseparable from XML technical support. XML is widely used in graphic images, databases, encryption security, software engineering, network education, e-commerce, and voice technologies, the XML application tide has arrived.
C.M., founding member of the XML Team. sperberg-McQueen believes: "The biggest impact of XML is the rise of XML software: XML analyzer, XML program language library, XSLT processor, xsl fo processor, and database acceptance of XML-more than that, web browsers also accept XML." That's why big companies such as IBM, Microsoft, SUN, HP, and Oracle entered the market.
After learning XGen and other object binding tools, I believe you are already eager to try it. I hope to use XGen to practice it immediately and try out the advantages of XML object binding. The following describes the XML applications that I often use.
1. XML configuration file
Every system may need a large or small configuration file to initialize system parameters through the configuration file. The benefits are not described in detail. Generally, the configuration file is in the following format:
1. ini files in window system and Properties files used in Java
2. XML files
3. Other format files
The first type of configuration file is a plain text file, which uses the "key = value" format to record various parameters for easy manual writing and reading.
XML Schema-based XML files are easy to read and can display the hierarchical and constrained relationships between each element. Compared with configuration files in xml format, INI file format has the following advantages:
1.1. Hierarchical configuration
1.2. Check the value validity
1.3. Supports linked list, enumeration, and complex data types
1.4. Configuration files can be nested
1.5. It is very convenient to edit the configuration file with XML editing tools such as XML Spy.
1.6. There are a large number of third-party XML object binding tools, which are powerful and easy to develop. For example, Java XGen, JAXB, and C ++ tool XBind
Now let's start to use XML as the configuration file for the program.
1.1. Design the XSD file (XML Schema)
XGen needs to compile the XSD file, which is an outline file used to describe the specified type of XML file and a plain text file. You can create and edit the XSD file by using the editing tool in this article. However, you can use some XML editing tools to write the XSD more efficiently. I have also used some XML editing tools, but only XML SPY is the most powerful and easy to use.
Some features of XML Spy:
L prompt input is available when editing XML, XSD, and other files, which can be easily selected.
L at the same time, it has the XML file validity check function to determine whether the value of the Element value complies with the schema definition.
L supports conversion between DTD and XSD
L provides the XML instance File function for XSD samples.
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.