This is a bit abstract, not easy to understand, and I have learned a little bit, but it is very remarkable. It brings us a lot of convenience in XML applications, the XML function has also been greatly improved, and I feel like it. Oh, there is something wrong with it. Don't laugh!
Before entering the subject, we will reference an example:
<Table>
<Tr>
<Td> Apples </td>
<Td> Bananas </td>
</Tr>
</Table>
In the above XML, it is a bit similar to the table function in HTML we have seen before. In fact, you can also think it is as simple as that;
<Table>
<Name> African Coffee Table </name>
<Width> 80 </width>
<Long> 120 </length>
</Table>
In this XML, we describe the information of a table. In this way, if we put the two XML into an XML file, we will encounter a naming conflict, so there is Name space.
XML namespace-the solution to the above problems:
I. Use a prefix to solve naming conflicts:
The above two files are changed to the following:
1 -- <H: tr>
<H: td> Apples <H: td> Bananas </H: tr>
</H: table> 2 -- <f: table>
<F: name> African Coffee Table </f: name>
<F: width> 80 </f: width>
<F: length> 120 </f: length>
</F: table> can two different types of information be clearly separated by <H: tr>
<H: td> Apples <H: td> Bananas </H: tr>
</H: table> 2 --- <f: table xmlns: f = "http://www.w3.org/TR/xsl">
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.