1
美好的一天!支持不同名称空间的XSD
我生成的XML文件如下:
<object xmlns:el="elements_namespace" xmlns:vlprops="vl_props_namespace"
xmlns:vlsvc="vl_svc_params_namespace" xmlns:p="general_params_namespace">
<el:BTN vlprops:link="../clientdb/#abn/fl" vlprops:btnType="hist"
vlprops:linkInTab="true" p:nm_title="some_text"
p:vl_order="0" p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="null">
<vlprops:linkCols><![CDATA[[]]]></vlprops:linkCols>
<p:window_BTN />
</el:BTN>
<el:GRID vlprops:rows="15" p:nm_title="null" p:vl_order="3"
p:nm_service="some_text" p:pr_visible="true" p:nm_endpoint="CLDB"
p:nm_logical_id="some_text" p:nm_description="some_text">
<vlsvc:vars><![CDATA[["vl_params"]]]></vlsvc:vars>
<vlsvc:consts><![CDATA[{"in_function": "mdTotalTags"}]]></vlsvc:consts>
<p:columns_GRID>
<el:GRDCOL vlprops:rows="15" p:nm_title="null" p:vl_order="0"
p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="some_text">
<vlprops:linkCols><![CDATA[["id_client"]]]></vlprops:linkCols>
</el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text"
p:vl_order="1" p:nm_service="null" p:pr_visible="true"
p:nm_endpoint="null" p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text" p:vl_order="2"
p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text"
p:vl_order="3" p:nm_service="null" p:pr_visible="true"
p:nm_endpoint="null" p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text" p:vl_order="4"
p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text" p:vl_order="5"
p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text"
p:vl_order="6" p:nm_service="null" p:pr_visible="true"
p:nm_endpoint="null" p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text почта"
p:vl_order="7" p:nm_service="null" p:pr_visible="true"
p:nm_endpoint="null" p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
<el:GRDCOL vlprops:rows="15" p:nm_title="some_text" p:vl_order="8"
p:nm_service="null" p:pr_visible="true" p:nm_endpoint="null"
p:nm_logical_id="null" p:nm_description="null"></el:GRDCOL>
</p:columns_GRID>
<p:footDetail_GRID />
<p:rowDetail_GRID />
</el:GRID>
</object>
现在我需要生成XSD方案,我GOOGLE在互联网一些信息,遇到一些例子来。他们都只有一个名字空间。像
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.my.com/book"
elementFormDefault="qualified">
<xs:element name="book">
<xs:complexType>
<xs:attribute name="author" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>
它包含XS:唯一的命名空间,我不知道如果我能,将涵盖所有的命名空间在我的XML一个XSD文件
(
el="elements_namespace"
xmlns:vlprops="vl_props_namespace"
xmlns:vlsvc="vl_svc_params_namespace"
xmlns:p="general_params_namespace"
)
如果这是可能你能不能给我一个小例子用我的xml?在此先感谢
不要采取这种错误的方式,但为什么在两个独立的命名空间中有所述元素的元素和属性?在大多数情况下,命名空间在大多数情况下都是过度杀伤性的,为什么要将膨胀加倍?你也可以考虑不包含“空”属性。 –
我必须编写一个解析器来创建必要的插入语句,因为有些问题我不得不用不同的名称空间来分隔项目。此外,我必须跟踪这个值是否为null,是否为空,或者根本不传递。 –