当前位置:网站首页>XML schema record
XML schema record
2022-06-23 06:53:00 【Small code 2016】
advantage
- Better readability
- It supports specifying data types for element contents or attribute values , More functions 、 More powerful
- It can be expanded for future needs
Root element
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
</xs:schema>
xmlns[:xxx] Property is used to specify XML Documents introduce semantic constraints . The attribute value of the attribute is the namespace corresponding to the semantic constraint used by the text .xxx Is an arbitrary Hu ID name , Prefixes all elements defined by the constraint
xmlns:xs="http://www.w3.org/2001/XMLSchema" Is each schema Documentation
Specify the namespace
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.w3school.com.cn"
xmlns="http://www.w3school.com.cn">
</xs:element>
targetNamespace="http://www.w3school.com.cn" Specify the schema Target namespace for . When it is necessary to quote this XML schema The definition of schema When the component , Usually, you need to use the prefix corresponding to the command space as the qualification xmlns="http://www.w3school.com.cn" Specify the use of http://www.w3school.com.cn Namespace , No prefix is required to qualify
Whether it's XML The document is still XML schema file , Its root element can accept any number of xmlns[:xxx] attribute , among [:xxx] Part is optional ,xxx It can be any legal identification name .
xmlns:[xxx]="schameNamespace" Specify the use of schameNamespace Namespace , You should use xxx Prefix as qualification
Besides , It can be for schema Element specifies the following two attributes :
elementFormDerfault: The attribute value can be qualified or unqualified, Is used to specify the XML The document uses this schema Whether namespace qualification is required for local elements defined in
attributeFormDerfault: The attribute value can be qualified or unqualified, Is used to specify the XML The document uses this schema Whether namespace qualification is required for local attributes defined in
xml introduce schema
Reference namespace free schema
Add the following two attributes to the document root element :
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:noNamespaceSchemaLocation: Appoint XML Schema Of documents URI
Reference a namespace schema
- Every time a namespace is introduced schema, for XML Add a... To the root element xmlns[:xxx] attribute
If XML There is already... In the root element xsi:schemaLocation attribute (xsi The prefix is variable ), Then the attribute value is followed by the XML Schema Add one item , Additional items should be kept schemaNamespace schemaURI The format of .
If XML The root element does not yet have xsi:schemaLocation attribute , Add this attribute to it , And set the attribute value to schemaNamespace schemaURI
One copy XML At most one namespace free... Is introduced into the document XML Schema
data type
schema Not only is there a wealth of built-in data types , It also allows developers to derive new data types from built-in data types .
schema The supported data types fall into two broad categories :
Simple type : It can be used as XML Type of element , It can also be used as XML Type of attribute
Complex type : Only as XML Type of element
The simple type classification :
done
边栏推荐
- Haas506 2.0 development tutorial - Advanced Component Library -modem Sim (only supports versions above 2.2)
- Numerical calculation method chapter7 Calculating eigenvalues and eigenvectors of matrices
- Cloud box is deeply convinced to create a smart dual-mode teaching resource sharing platform for Nanjing No. 1 middle school
- mysql 优化
- 将TensorFlow1.x改写为pytorch
- English grammar_ Adjective comparative - Level 3 change
- Get to know webassembly quickly
- [saison de remise des diplômes · technologie agressive er] votre choix, agenouillez - vous et partez
- ffplay实现自定义输入流播放
- 图解三次握手四次挥手,小白都能看懂
猜你喜欢

Functions and basic structure of CPU

C语言学习总结

mysql 优化

20220621 Dual Quaternion

haas506 2.0开发教程-高级组件库-modem.sms(仅支持2.2以上版本)

Haas506 2.0 development tutorial - Advanced Component Library -modem SMS (only supports versions above 2.2)

Data indicators and data analysis models that designers need to understand

Haas506 2.0 development tutorial -hota (only supports versions above 2.2)

Haas 506 2.0 Tutoriel de développement - bibliothèque de composants avancés - modem. SMS (ne prend en charge que les versions supérieures à 2,2)

Get to know webassembly quickly
随机推荐
mongodb 记录
【毕业季·进击的技术er】自己的选择,跪着也要走
system 权限程序不能访问sd卡问题
Linux安装mysql8.0.25
js中if逻辑过多,常见优化
20220620 uniformly completely observable (UCO)
VS2013 FFMPEG环境配置及常见错误处理
了解学习 JSX 的工作方式
Cetos7 record
phpStudy设置301重定向
二叉树的遍历及相关知识
MySQL5.6 (5.7-8) 基于shardingsphere5.1.1 Sharding-Proxy模式读写分离
C# 获取DPI和真实分辨率的方式(可以解决一直是96的问题)
haas506 2.0开发教程-hota(仅支持2.2以上版本)
Sword finger offer 42 Maximum sum of successive subarrays
直播带货这么火,如何在小程序中实现视频通话及直播互动功能?
Termux
746. climbing stairs with minimum cost - Dynamic Planning
ssm + ftp +ueditor
Miscellaneous things