1

I have a problem with a xsd which was given to me by a third party for their api. The message i get is: Cannot find the declaration of element 'Message'

Here is the first few lines of my request:

<?xml version="1.0" encoding="UTF-8"?>
    <Message xmlns="http://www.surescripts.com/messaging" version="010" release="006" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://aabrahams.staging.skycareehr.com/surescripts.xsd">
        <Header>
            --- more ---

And here is the beginning of the xsd:

<?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns="http://www.surescripts.com/messaging" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.surescripts.com/messaging" elementFormDefault="qualified">
        <xs:element name="Message" type="MessageType"/>
            <xs:complexType name="MessageType">
                <xs:sequence>
                    <xs:element name="Header" type="HeaderType"/>
                        <xs:element name="Body" type="BodyType"/>
                    </xs:sequence>
                    --- More ---

Any suggestions?

4

1 回答 1

1

(1)属性给出xsi:schemaLocation的XSD格式不正确:在第 1831 行,结束标记 ,/xs:element>缺少一个<字符。在那里修复它,或将其复制到本地并修复。

(2) 在 XML 文件中,更改:

xmlns:xsi="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

(3) 同样在 XML 文件中,更改:

xsi:schemaLocation="http://aabrahams.staging.skycareehr.com/surescripts.xsd"

xsi:schemaLocation="http://www.surescripts.com/messaging surescripts.xsd"

(或者,如果您能够http://aabrahams.staging.skycareehr.com/surescripts.xsd直接修复,您可以这样做:)

xsi:schemaLocation="http://www.surescripts.com/messaging http://aabrahams.staging.skycareehr.com/surescripts.xsd"

[应该可以,但是如果您有任何问题,请在下面发表评论,我们会解决。]

于 2013-11-01T23:10:32.020 回答