Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 XML - multiple base for derived type is not suppor

Author  Topic 

JeffT
Posting Yak Master

111 Posts

Posted - 2008-04-07 : 10:22:02
Hi,

Very basic beginner XML question. Is it possible to have an attribute name repeated in a schema ? I received an XML and XSD file for which I'm getting the error "multiple base for derived type on dte_effective is not supported." "dte_effective" is repeated under several elements. Is there a way to resolve this error by adding something to the schema to indicate that the date is specific to each element ? Can't figure this one out. I've googled the error and found nothing to resolve this.
XSD file sample is below...
Thanks, J.

<xs:element name="Element1">
<xs:complexType>
<xs:attribute name="dte_effective" "NewDate" use="optional">
<xs:annotation>
<xs:documentation>effective date field</xs:documentation>
</xs:annotation>
</xs:attribute>

<xs:element name="Element2">
<xs:complexType>
<xs:attribute name="dte_effective" type="NewDate" use="optional">
<xs:annotation>
<xs:documentation>effective date field</xs:documentation>
</xs:annotation>
</xs:attribute>


RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-04-07 : 10:25:40
Where does Element1 end?

Ryan Randall
www.monsoonmalabar.com London-based IT consultancy

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

JeffT
Posting Yak Master

111 Posts

Posted - 2008-04-07 : 10:35:23
There are a number of attribute fields I'm leaving out other than "dte_effective" but it ends
with
</xs:complexType>
</xs:element>
Do you need to assess the whole schema ? I can insert it if necessary. Thanks


<xs:element name="Element1">
<xs:complexType>
<xs:attribute name="dte_effective" "NewDate" use="optional">
<xs:annotation>
<xs:documentation>effective date field</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-04-07 : 10:48:23
Okay. Then I have another silly question...

> <xs:attribute name="dte_effective" "NewDate" use="optional">

What is NewDate attached to here?

Ryan Randall

Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

JeffT
Posting Yak Master

111 Posts

Posted - 2008-04-07 : 10:55:30
This is it below, thanks:

<xs:simpleType name="NewDate">
<xs:union memberTypes="xs:date">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="0000-00-00"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

Go to Top of Page

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-04-07 : 11:13:24
Thanks. What I meant though was that "NewDate" appears to be 'floating'. Should it be...

<xs:attribute name="dte_effective" type="NewDate" use="optional">

rather than...

<xs:attribute name="dte_effective" "NewDate" use="optional">

(I might be completely off - just guessing at possible problems.)


Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

JeffT
Posting Yak Master

111 Posts

Posted - 2008-04-07 : 11:16:49
Sorry, I think I must have accidentally deleted "type=" before "NewDate" when I pasted it in here. It is actually there in the original schema. Thanks
Go to Top of Page

JeffT
Posting Yak Master

111 Posts

Posted - 2008-04-07 : 14:35:43

Any thoughts would be most appreciated! More details can be supplied if necessary.
Thanks J.
Go to Top of Page
   

- Advertisement -