xsd使用参数验证url

时间:2016-05-12 09:31:04

标签: xml xsd

尝试验证字符串时遇到问题。该字符串应该是一个URL,因此它可以有参数。当我添加"&"要添加多个参数,我收到此错误:

  

形式不佳:对实体的引用" mysecondip"必须结束   ';'分隔符。

这是xml:

<url>http://www.google.com?myip=192.168.0.1&mysecondip=192.168.0.2</url>

和xsd

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="url" type="xs:string"/>
</xs:schema>

Sample

1 个答案:

答案 0 :(得分:0)

没关系,我发现了另一个同样问题的问题:

The reference to entity "foo" must end with the ';' delimiter

非常感谢,您可以关闭此问题或将其标记为重复。

相关问题