Errors Using XML Schema Collection (Msg 6913)

  • I am working with SQL Server 2008 Express and I am having issues with loading an XML schema in and then using it. I have loaded the following XML schema into my database (see attached CreateSchema.txt).

    and then I use the following SQL to create an XML variable using the schema (see UsesSchema.txt)

    and I get the following error

    Msg 6913, Level 16, State 1, Line 3

    XML Validation: Declaration not found for element 'ACORD'. Location: /*:ACORD[1]

    I found in another message about removing the targetmespace. I tried that and get

    Msg 2308, Level 16, State 1, Line 2

    Reference to an undefined name 'RqUID' within namespace 'http://tempuri.org/SA_ACORD11'

    Does anyone have any ideas? I am really stuck here!

    Thanks!:-D

    Michael

  • I've run into the same problem and do not know why.

    I've run this proc to view the schema and confirm the presence of the "missing" element and clearly the schema is registered and the element is present:

    EXEC sp_xml_schema_rowset @collection_name = 'YourSchemaNameHere';

    I'm not sure what to try next.

  • I see that the XSD from the original message above does not pass validation in XMLNotepad, so that is the first thing I'd suggest fixing.

    I found my own problem with Msg 6913.

    I did not include the xmlns parm in my xml to be validated.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply