我想要一个像这样的页面:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:m="mine.xsd">
<m:dialog m:title="Hello">Hi there!</m:dialog>
</html>
我该如何编写"mine.xsd"?
我想要一个像这样的页面:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:m="mine.xsd">
<m:dialog m:title="Hello">Hi there!</m:dialog>
</html>
我该如何编写"mine.xsd"?
以下是一个简单的例子:
XMLSchema1.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Types"
targetNamespace="http://tempuri.org/"
elementFormDefault="qualified"
xmlns="http://tempuri.org/"
xmlns:mstns="http://tempuri.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="Types">
<xs:annotation>
<xs:documentation>.NET types</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="String" />
<xs:enumeration value="Int16" />
<xs:enumeration value="Int32" />
<xs:enumeration value="Int64" />
<xs:enumeration value="DateTime" />
<xs:enumeration value="Double" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="DataSize">
<xs:annotation>
<xs:documentation>Number of bytes of the data</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:int" />
</xs:simpleType>
<!-- ... -->
</xs:schema>
<?xml version="1.0" encoding="utf-8" ?>
<ValueSet
xmlns="http://tempuri.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tempuri.org/ XMLSchema1.xsd">
<Values>
<Value Name="Stats" Type="Int32" DataSize="4" />
<Value Name="Time" Type="DateTime" DataSize="4" />
<Value Name="Some" Type="Double" DataSize="4" />
<Value Name="Other" Type="Double" DataSize="4" />
</Values>
</ValueSet>
<html>
元素中? - JSPDeveloper01xsd:annotation/xsd:appinfo
来完成增强。https://dev59.com/HJXfa4cB1Zd3GeqPgYle#36289758 - Andreas Covidiot