2017-11-30 15 views
1

스키마에 대해 내 XML의 유효성을 검사하려고하지만 코드를 실행할 때 오류가 발생합니다. 는 XML (sample.xml) 인 :XML을 검증하고 유효성을 검사 할 때 "매개 변수가 잘못되었습니다"라는 오류가 발생하는 이유는 무엇입니까?

<?xml version="1.0" encoding="utf-8"?> 
<Catalog xmlns:dt="urn:schemas-microsoft-com:datatypes"> 
    <Rec> 
    <ITEMS dt:dt="string"/> 
    <QTY dt:dt="string">1</QTY> 
    <CATALOG dt:dt="string">1492</CATALOG> 
    <MFG dt:dt="string">BA</MFG> 
    <ASSYCODE dt:dt="string"/> 
    <DESC dt:dt="string">MCB 1 POLE 2A TYPE C</DESC> 
    <QUERY2 dt:dt="string">1MCB</QUERY2> 
    <QUERY3 dt:dt="string">2A</QUERY3> 
    <MISC1 dt:dt="string"/> 
    <MISC2 dt:dt="string"/> 
    <USER1 dt:dt="string">EAMCB122</USER1> 
    <USER2 dt:dt="string"/> 
    <USER3 dt:dt="string"/> 
    <TABNAM dt:dt="string">CB</TABNAM> 
    <TAGS dt:dt="string">Q2-4D</TAGS> 
    <DESC1 dt:dt="string"/> 
    <DESC2 dt:dt="string"/> 
    <DESC3 dt:dt="string"/> 
    <INST dt:dt="string"/> 
    <LOC dt:dt="string"/> 
    <UM dt:dt="string"/> 
    <HDL dt:dt="string">h=6706</HDL> 
    <DWGIX dt:dt="string">7</DWGIX> 
    <REF dt:dt="string">-4D</REF> 
    <SH dt:dt="string">2</SH> 
    <SOURCE dt:dt="string">ELECTRICAL</SOURCE> 
    </Rec> 
</Catalog> 

스키마 (sample.xsd)입니다 :

<?xml version="1.0" encoding="UTF-8"?> 
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> 
     <!-- XML Schema Generated from XML Document on Thu Nov 30 2017 16:39:38 GMT+0000 (GMT Standard Time) --> 
     <!-- with XmlGrid.net Free Online Service http://xmlgrid.net --> 
     <xs:element name="Catalog"> 
       <xs:complexType> 
        <xs:sequence> 
          <xs:element name="Rec" maxOccurs="unbounded"> 
           <xs:complexType> 
             <xs:sequence> 
              <xs:element name="ITEMS"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="QTY" type="xs:int"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="CATALOG" type="xs:int"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="MFG" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="ASSYCODE"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="DESC" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="QUERY2" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="QUERY3" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="MISC1"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="MISC2"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="USER1" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="USER2"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="USER3"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="TABNAM" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="TAGS" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="DESC1"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="DESC2"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="DESC3"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="INST"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="LOC"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="UM"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="HDL" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="DWGIX" type="xs:int"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="REF" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="SH" type="xs:int"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
              <xs:element name="SOURCE" type="xs:string"> 
                <xs:complexType> 
                 <xs:attribute name="dt:dt" type="xs:string"></xs:attribute> 
                </xs:complexType> 
              </xs:element> 
             </xs:sequence> 
           </xs:complexType> 
          </xs:element> 
        </xs:sequence> 
        <xs:attribute name="xmlns:dt" type="xs:string"></xs:attribute> 
       </xs:complexType> 
     </xs:element> 
    </xs:schema> 

내가 그래서 나는 합리적으로 확신 XML 파일을 사용하여 스키마를 온라인으로 생성이 안 거기에 어떤 오류가있을 수 있습니다. 내가 사용하고 VBA 코드는 다음과 같습니다

Sub test() 

    Dim xDoc As New MSXML2.DOMDocument60 
    Dim xLists As IXMLDOMElement 


    Const dir = "C:\" 
    Dim xSchema As New MSXML2.XMLSchemaCache60 
    Dim xSchemaErr As IXMLDOMParseError 

    Call xSchema.Add("urn:schemas-microsoft-com:datatypes", LoadXML(dir & "sample.xsd")) 

    Set xDoc = LoadXML(dir & "sample.xml") 
    Set xDoc.Schemas = xSchema 

    Set xSchemaErr = xDoc.Validate 

    Set xDoc = Nothing 

End Sub 

Private Function LoadXML(strFilename As String) As MSXML2.DOMDocument60 

    Dim xDoc As New MSXML2.DOMDocument60 
    Dim bLoadSucceeded As Boolean 
    Dim fso As New FileSystemObject 

    With xDoc 
     .async = False 
     .validateOnParse = False 
     .resolveExternals = False 
    End With 

    If (fso.FileExists(strFilename)) Then 
     bLoadSucceeded = xDoc.Load(strFilename) 
     If (bLoadSucceeded) Then 
      Set LoadXML = xDoc 
     Else 
      Call MsgBox("Load XML document failed", vbCritical, "Warning") 
      Set xDoc = Nothing 
      Exit Function 
     End If 
    Else 
     Call MsgBox("Unable to find specified XML file to load", vbCritical, "Warning") 
     Set xDoc = Nothing 
     Exit Function 
    End If 

    Set xDoc = Nothing 

End Function 

문제는 오류 The parameter is incorrect 여기

Call xSchema.Add("urn:schemas-microsoft-com:datatypes", LoadXML(dir & "sample.xsd")) 

발생하지만 문제의 원인이되는 매개 변수를 볼 수 없습니다. XMLSchemaCache60의 add 메소드에 대한 문서를 보면이 오류에 대한 언급이 없습니다.

누구에게 이것이 될 수 있는지 알고 있습니까?

감사

편집 : 음, 지난 몇 일 동안 이상을 궁리 한 후, 나는대로, 아직도 내가 완전히 XSD 그래서 거의 쓸모가 없었습니다 제시 한 의견 이외의 Michael Kay에서 의견을 이해 확실하지 않다 나는 xmlgrid.net만큼 쓸모가 없다. 나는 다른 것을 시도했다. 이 시간 https://devutilsonline.com/xsd-xml/generate-xsd-from-xml는 이것이 내가 가진 무엇입니까 : 그것은 가져 오기 스키마 문제를 해결 한 것처럼

<?xml version="1.0"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified"> 
    <xs:element name="Catalog" type="CatalogType"/> 
    <xs:complexType name="ITEMSType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="QTYType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:byte"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="CATALOGType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:short"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="MFGType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="ASSYCODEType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="DESCType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="QUERY2Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="QUERY3Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="MISC1Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="MISC2Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="USER1Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="USER2Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="USER3Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="TABNAMType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="TAGSType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="DESC1Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="DESC2Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="DESC3Type"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="INSTType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="LOCType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="UMType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="HDLType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="DWGIXType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:byte"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="REFType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:float"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="SHType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:byte"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="SOURCEType"> 
    <xs:simpleContent> 
     <xs:extension base="xs:string"> 
     <xs:attribute xmlns:urn="urn:schemas-microsoft-com:datatypes" ref="urn:dt"/> 
     </xs:extension> 
    </xs:simpleContent> 
    </xs:complexType> 
    <xs:complexType name="RecType"> 
    <xs:sequence> 
     <xs:element type="ITEMSType" name="ITEMS"/> 
     <xs:element type="QTYType" name="QTY"/> 
     <xs:element type="CATALOGType" name="CATALOG"/> 
     <xs:element type="MFGType" name="MFG"/> 
     <xs:element type="ASSYCODEType" name="ASSYCODE"/> 
     <xs:element type="DESCType" name="DESC"/> 
     <xs:element type="QUERY2Type" name="QUERY2"/> 
     <xs:element type="QUERY3Type" name="QUERY3"/> 
     <xs:element type="MISC1Type" name="MISC1"/> 
     <xs:element type="MISC2Type" name="MISC2"/> 
     <xs:element type="USER1Type" name="USER1"/> 
     <xs:element type="USER2Type" name="USER2"/> 
     <xs:element type="USER3Type" name="USER3"/> 
     <xs:element type="TABNAMType" name="TABNAM"/> 
     <xs:element type="TAGSType" name="TAGS"/> 
     <xs:element type="DESC1Type" name="DESC1"/> 
     <xs:element type="DESC2Type" name="DESC2"/> 
     <xs:element type="DESC3Type" name="DESC3"/> 
     <xs:element type="INSTType" name="INST"/> 
     <xs:element type="LOCType" name="LOC"/> 
     <xs:element type="UMType" name="UM"/> 
     <xs:element type="HDLType" name="HDL"/> 
     <xs:element type="DWGIXType" name="DWGIX"/> 
     <xs:element type="REFType" name="REF"/> 
     <xs:element type="SHType" name="SH"/> 
     <xs:element type="SOURCEType" name="SOURCE"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="CatalogType"> 
    <xs:sequence> 
     <xs:element type="RecType" name="Rec"/> 
    </xs:sequence> 
    </xs:complexType> 
</xs:schema> 

것 같습니다 ????? 그러나 나는 이제 새로운 오류가 발생합니다 :

sample.xsd#/schema/complexType[17][@name = 'DESC2Type']/simpleContent[1]/extension[1]/attribute[1] 
Undeclared XSD attribute : '{urn:schemas-microsoft-com:datatypes}dt'. 

이 선언되지 않은 속성이 왜 내가 이해할 수없는 - 나에게 이것은 단지 다른 이름 불구하고 동일한 문서의 나머지 부분처럼 보인다!

+0

, 나는 "오류 구문 분석이 있었다 없다는 오류 'dt : dt'를 NCName 데이터 유형으로 사용하십시오. " (그러나 xml에 관해서는 알지 못하기 때문에 나는 당신의 문제와 어떻게 관련이 있는지 잘 모르겠습니다.) – YowE3K

+0

MSXML의 메소드 인'LoadXML()'의 이름을 바꾸라고 조언합니다. – Parfait

+0

그리고'Dir '은 VBA 함수입니다. – YowE3K

답변

0

스키마가 실제로 유효하지 않습니다. 즉, 선택한 온라인 도구는 버그가 있습니다 (실제로는 허위입니다).

첫째

,

<xs:attribute name="dt:dt" type="xs:string"> 

은 아주 잘못 다음 name 속성이 간단한의 NCName (노 콜론 이름)이어야합니다. 특성이 포함 된 요소와 다른 네임 스페이스에있는 경우 스키마는 해당 네임 스페이스에 대한 별도의 스키마 문서의 xs : import를 포함해야합니다. 속성이 가져온 스키마 문서에서 선언하고, ref 속성을 사용하여 기본 스키마 문서에서 참조 할 필요가 :

<xs:attribute ref="dt:dt"/> 

둘째, 요소 선언이 type 속성과 complexType 자식 요소 모두를 가질 수 없습니다.

XML Schema: Element with attributes containing only text?

난 당신이지고있는 오류 메시지가 말을 : 또한 속성을 가지고 있으며, 요소를 설명하는 올바른 방법은 여기에 설명 된 바와 같이 텍스트 내용은 "간단한 내용과 복합 형의"를 사용하고있다 꽤 나쁘다.색슨은 당신에게 형식의 메시지 목록을 제공합니다 : 양식의 메시지 목록은 다음

Error at xs:attribute on line 13 column 81 of test.xsd: 
    No namespace prefix is allowed in this name {dt:dt} 

:

Error at xs:element on line 16 column 66 of test.xsd: 
    A <complexType> element must not appear as a child of an <xs:element> with a @type attribute 
+0

이 글을 작성한 후에 스키마가 xmlgrid.net에 기인 한 것으로 나타났습니다. xmlgrid에 의해 생성 된 다른 스키마 (예 : https://stackoverflow.com/questions/17247978/how-to-validate-this-xml-input/17249033#17249033에서 같은 문제가있는 것 같습니다. xmlgrid 사이트에서 버그 보고서를 제출할 방법이 없기 때문에 버그가 수정되지 않으면 어쩌면 놀라운 일이 아닙니다. –

0

당신은 제대로 특히 API를 사용하여 작업 런타임 예외를 포착하는 당신의 방법으로 처리 된 오차 더라면 MSXML과 마찬가지로 스키마 관련 문제를 표시하는보다 적절한 오류 메시지가 표시됩니다.

Sub test() 
On Error GoTo ErrHandle 
    ... 


ExitHandle: 
    Set xDoc = Nothing 
    Exit Sub 

ErrHandle: 
    MsgBox Err.Number & " - " & Err.Description, vbCritical 
    Resume ExitHandle 
End Sub 

' CHANGED FCT NAME TO AVOID NAME CLASH WITH MSXML's LOADXML()  
Private Function ProcXML(strFilename As String) As MSXML2.DOMDocument60 
On Error GoTo ErrHandle 
    ... 

ExitHandle: 
    Set xDoc = Nothing 
    Exit Function 

ErrHandle: 
    MsgBox Err.Number & " - " & Err.Description, vbCritical 
    Resume ExitHandle 
End Function 

(I 스키마 파일 CatalogExcel.xsd 이름) 대화 메시지 내가 코드를 실행하려고하면

Error Message