16-1-9 Java Learning Note (2) XML constraints

Source: Internet
Author: User

Definition: In XML technology, you can write a document that constrains the writing of an XML document, which is called an XML constraint.

Function: Constrain the writing of XML documents and validate XML;

Common constraint Techniques: XML DTD (document type definition) documentation type definitions; XML Schema

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <!DOCTYPE Bookshelf SYSTEM "BOOK.DTD">3 <Bookshelf>4     <Book>5         <title>Employment Training Tutorials</title>6         <author>Zhang Xiaoxiang</author>7         <Price>39.00 USD</Price>8     </Book>9     <Book>Ten         <title>Web Development</title> One         <author>Zhang Xiaoxiang</author> A         <Price>29.00 USD</Price> -     </Book> - </Bookshelf>

Book.dtd

<! ELEMENT Bookshelf (book +) > <! ELEMENT Book (title, author, Price) > <! ELEMENT title (#PCDATA) > <! ELEMENT author (#PCDATA) > <! ELEMENT Price (#PCDATA) >

16-1-9 Java Learning Note (2) XML constraints

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.