September 27, 2007 at 7:38 am
Help! I've created a simple XML schema, required all the attributes, and when I go to validate it with an XML variable, it tells me that I'm missing a required attribute when I'm not... I'm so CONFUSED.
Help appreciated. Code pasted below:
CREATE XML SCHEMA COLLECTION ClaimPymtCalcDetails AS '
'
--The above uploads fine "Command(s) completed successfully"
--I'm using random values in the below just to validate the schema
--collection
Declare @MyXML as XML (ClaimPymtCalcDetails)
Set @MyXML = '
'
--The error message I get is:
--Msg 6906, Level 16, State 1, Line 2
--XML Validation: Required attribute 'SettlementAmt' is missing.
--Location: /*:ClmCalcDetails[1]
Thing is, if I remove the 'use="required"' statement from SettlementAmt, it then complains about a total different attribute with the same error message.
Does anyone have any idea what is wrong? I've counted to make sure I have all my attributes, I've done a side-by-side compare to make sure they're all in the same order, I've verified the datatypes compared to the values I'm trying to stick in.
HELP! Thanks in advance.
September 27, 2007 at 2:26 pm
I couldnot see your schema and xml in your post. So not sure what's happening
September 28, 2007 at 5:03 am
Well, gosh darnit! The webpage probably parsed it funny... And I forgot to preview it.. Let me try again.
Hmmm, double-quotes won't work. I'm going to try to attach a text file here with the code in it and see if that works.
September 28, 2007 at 5:04 am
WHOOHOO! Text file worked. At least, it opens for me and displays my code correctly. Let me know if you can't see it.
September 28, 2007 at 6:04 am
Your schema requires more than 10 attributes. Your document has elements.
<ClmCalcDetails LendPayoff="1.00" CLRefund="2.00"
.... with other elements as attributes here ...
></ClmCalcDetails>
Russel Loski, MCSE Business Intelligence, Data Platform
September 28, 2007 at 6:09 am
Oh, DUH! I thought I had to list the attributes separately with an open & close....
Thanks. I'll try again. @=)
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply