在 wsdl 文件中设置属性值时是否可以存在空格?

2 wsdl

wsdl文件中:如果space在设置 an 的值时存在a会出错attribute吗?例如 :

<soap:address location="http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)

如果我写的是错误:

<soap:address location = "http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)

或者

<soap:address location= "http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)

或者

<soap:address location ="http://192.168.1.123/imfmobile/webservice/InterfaceTransfererClient.php"/>
Run Code Online (Sandbox Code Playgroud)

Nul*_*ius 5

由于 WSDL 和 SOAP 遵循 XML 规范,因此等号之间是否有空格、制表符甚至换行符都没有关系:http : //www.w3.org/TR/2006/REC-xml11-20060816/# sec-white-space

但是,它可能是 XML 解析器不是 100% 符合 XML 规范。我建议不要在属性名称和它的值之间使用空格。

  • 可能比 XML 规范更易读的格式是以下文档:http://www.usingxml.com/Basics/XmlSpace (2认同)