xml架构的动态元素名称

时间:2021-07-05 17:17:41

I want to set element name dynamically that means it's come from database,

我想动态设置元素名称,这意味着它来自数据库,

for eg, Afdeling,Fabrikant,Promo etc.

例如,Afdeling,Fabrikant,Promo等。

How can i set this in xml schema currently i have set this static.

我如何在xml架构中设置此项目前我已将此设置为静态。

<xs:element minOccurs="0" maxOccurs="1"  name="Afdeling"    type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1"  name="Fabrikant"   type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1"  name="Promo"       type="xs:string" />

1 个解决方案

#1


0  

You can use an element wildcard: <xs:any>. You can't then constrain the element name any further in the schema (except to make it appear in a particular namespace) unless you use XSD 1.1 assertions.

您可以使用元素通配符: 。然后,除非使用XSD 1.1断言,否则不能在模式中进一步约束元素名称(除非使其出现在特定名称空间中)。

#1


0  

You can use an element wildcard: <xs:any>. You can't then constrain the element name any further in the schema (except to make it appear in a particular namespace) unless you use XSD 1.1 assertions.

您可以使用元素通配符: 。然后,除非使用XSD 1.1断言,否则不能在模式中进一步约束元素名称(除非使其出现在特定名称空间中)。