Jump to content

Schema errors, don't know what they mean.

- - - - -

  • Please log in to reply
4 replies to this topic

#1
jessticular

jessticular

    Newbie

  • Members
  • Pip
  • 3 posts
I'm using DecisionSoft to validate my XML & schema files. I've been able to sort through all the errors & figure out what they mean except for these three:

Validation 8, 24 cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[A-Z]' for type 'MiddleInitialType'.

Validation 8, 24 cvc-type.3.1.3: The value '' of element 'middle' is not valid.

Validation 27, 12 cvc-complex-type.2.4.a: Invalid content was found starting with element 'author'. One of '{publishedDate}' is expected.

Any sort of help would be greatly appreciated!

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Without seeing what you actually have, it's hard to say. You may have middle initial defined as char(1), which means you CANNOT have an empty string, for example.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
jessticular

jessticular

    Newbie

  • Members
  • Pip
  • 3 posts
I have it defined as string. Here's what I have:

<xsd:complexType name="AuthorType">
<xsd:sequence>
<xsd:element name="first" type="xsd:string"/>
<xsd:element name="middle" type="MiddleInitialType" minOccurs="0"/>
<xsd:element name="last" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="MiddleInitialType">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[A-Z]"/>
<xsd:length value="1"/>
</xsd:restriction>
</xsd:simpleType>

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
You haven't posted everything. I don't see "author" or {publishedDate}
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
jessticular

jessticular

    Newbie

  • Members
  • Pip
  • 3 posts
I removed the pattern from middleInitial because it wasn't necessary which solved the middleInitial problem & changed Author to maxOccurs="unbounded" which solved the publishedDate problem. I think it was only expecting one author per book which made it confused when there was more than one author to a book instead of the publishedDate immediately after the first author. But the problems are solved now. Validation came back valid once I made those changes.

<xsd:complexType name="BookType">
<xsd:sequence>
<xsd:element name="title" type="TitleType"/>
<xsd:element name="edition" type="xsd:byte" minOccurs="0"/>
<xsd:element name="author" type="AuthorType" minOccurs="1" maxOccurs="unbounded"/>
<xsd:element name="publishedDate" type="PublishedDateType"/>
<xsd:element name="type" type="TypeType"/>
<xsd:element name="price" type="PriceType"/>
</xsd:sequence>
<xsd:attribute name="isbn" type="xsd:ID" use="required"/>
</xsd:complexType>

<xsd:complexType name="AuthorType">
<xsd:sequence>
<xsd:element name="first" type="xsd:string"/>
<xsd:element name="middle" type="MiddleInitialType" minOccurs="0"/>
<xsd:element name="last" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="PublishedDateType">
<xsd:sequence>
<xsd:element name="month">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedByte">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="12"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="day">
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedByte">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="31"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="year" type="xsd:gYear"/>
</xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="MiddleInitialType">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1"/>
</xsd:restriction>
</xsd:simpleType>




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users