xsd自动补全和提示

1.把xml和xsd放在同一文件夹下

   xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified" attributeFormDefault="qualified">
	<xsd:element name="cmsversion">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:choice minOccurs="0" maxOccurs="unbounded">
					<xsd:element name="keyprom">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element ref="content" />
							</xsd:sequence>
							<xsd:attribute ref="name" use="required" />
						</xsd:complexType>
					</xsd:element>
					<xsd:element name="group">
						<xsd:complexType>
							<xsd:sequence>
								<xsd:element ref="content" />
							</xsd:sequence>
							<xsd:attribute ref="name" use="required" />
						</xsd:complexType>
					</xsd:element>
				</xsd:choice>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="content">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="entry" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:complexContent>
							<xsd:restriction base="xsd:anyType">
								<xsd:attribute name="templetCode" type="xsd:string"
									use="required">
									<xsd:annotation>
										<xsd:documentation>
											名称
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>

								<xsd:attribute name="sort" type="xsd:boolean" use="required">
									<xsd:annotation>
										<xsd:documentation>
											是否支持排序
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="repeat" type="xsd:boolean"
									use="required">
									<xsd:annotation>
										<xsd:documentation>
											是否支持重复
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
								<xsd:attribute name="close" type="xsd:boolean"
									use="required">
									<xsd:annotation>
										<xsd:documentation>
											是否支持关闭
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:restriction>
						</xsd:complexContent>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:attribute name="name" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>
				key的名称
			</xsd:documentation>
		</xsd:annotation>
	</xsd:attribute>
</xsd:schema>

    xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<cmsversion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="cms_version.xsd">
	<!-- demo start -->
	<group name="1">
		<content>
			<entry templetCode="1" sort="true" repeat="true" close="true" />
			<entry templetCode="11" sort="false" repeat="true" close="true" />
		</content>
	</group>

	<group name="2">
		<content>
			<entry templetCode="2" sort="true" repeat="false" close="true" />
		</content>
	</group>

	<keyprom name="3">
		<content>
			<entry templetCode="3" sort="true" repeat="true" close="false" />
		</content>
	</keyprom>
	<!-- demo end -->
</cmsversion>


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值