xsi:schemaLocation backslash not allowed?

安稳与你 提交于 2019-12-11 19:28:37

问题


we are receiving an xml file that looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AuditResponse xmlns="http://www.tibco.com/MFT/JMS-XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tibco.com/MFT/JMS-XMLSchema C:\MFTIS\server\webapps\cfcc\WEB-INF/xsds/AuditResponse.xsd">
<ResponseType>TransferNotificationComplete</ResponseType>
<NumRecords>1</NumRecords>
   <AuditRecord>
      <AuditType>InternetServer</AuditType>
      <AuditID>A62540000004</AuditID>
      <CKPTInterval>5</CKPTInterval>
   </AuditRecord>
</AuditResponse>

However, we we try to parse the file it fails because of "invalid URI character '\' is not allowed.

Is backslash not allowed within the xsi:schemaLocation attribute?

Thanks!


回答1:


schemaLocationis defined to contain pairs of URIs, and \ is an excluded character according to RFC 2396. So, yes, the parser is kind of correct to barf on it. \ can be escaped, though.



来源:https://stackoverflow.com/questions/24406203/xsischemalocation-backslash-not-allowed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!