Javaweb Learning Summary viii. (XML Constraints <dtd and Schema>)

Source: Internet
Author: User

One: XML constraint concept

XML constraints: You can write a document to constrain the writing specification of an XML file.

XML language format is more rigorous, it is impossible for programmers to write freely, so must have constraints.

Second: Common XML constraint techniques

1:dtd,document type definition

2: Verifying the legitimacy of XML files

A: Using the Parse tool

B: Using IDE tools, such as: Eclipse

Books.html

1 <?XML version= "1.0"?>2 <!DOCTYPE Bookstore SYSTEM "BOOK.DTD">3 <Bookstore>4     < Book>5         <name>Thinking in Java</name>6         <author>Tom</author>7         < Price>105.0</ Price>8     </ Book>9     < Book>Ten         <name>Thinking in C</name> One         <author>Jack</author> A         < Price>85.0</ Price> -     </ Book> - </Bookstore>

Books.dtd

1 <! ELEMENT Bookstore (book+) > 2     <! ELEMENT Book (name,author,price) > 3     <! ELEMENT name (#PCDATA) > 4     <! ELEMENT author (#PCDATA) > 5     <! ELEMENT Price (#PCDATA) >

Javaweb Learning Summary VIII (XML constraints <DTD and schema>)

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.