【发布时间】:2014-12-08 23:15:23
【问题描述】:
是否可以在 XML 模式中执行此操作?
<xs:element name="A/B" type="xs:string"/>
看起来我们无法在架构元素名称中使用特殊字符“/”。特殊字符“/”引发错误。 我们还有其他方法可以实现吗?
下面的示例代码可用于重现错误。当保存为 Test.xsd 然后在 Jdeveloper 中打开时,这将产生错误消息“属性名称的值不是 NCName 类型”。
<?xml version="1.0" encoding="windows-1252" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="qualified">
<xs:element name="exampleElement">
<xs:complexType>
<xs:sequence>
<xs:element name="A/B" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
【问题讨论】: