Fields set as required & "cannot be blank" but optional in Schema

I

I. Fuchs

In the schema fragment below, the component elements for "bond" ("coupon
rate", "maturity" have attribute of minoccur=0, making them optional. In the
InfoPath form the default values are fixed as "required" with the nodes set
as "cannot be blank" (which cannot be changed. Why is this happening?


<xsd:element name="bond">
<xsd:annotation>
<xsd:documentation xml:lang="en">Defines the
underlying asset when it is a bond.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="UnderlyingAsset">
<xsd:sequence>
<xsd:element
name="relatedExchangeId" type="ExchangeId" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="de">Eindeutiges Kürzel einer relevanten Börse.
Fehlt dieses Element, gilt die Hauptbörse, an der börsengehandelte Futures-
und Optionskontrakte auf den Basiswert notiert sind, als "Börse" im Sinne der
ISDA-Definitionen zu Aktienderivaten von 2002.</xsd:documentation>

<xsd:documentation xml:lang="en">A short form unique identifier for a related
exchange. If the element is not present then the exchange shall be the
primary exchange on which listed futures and options on the underlying are
listed. The term "Exchange" is assumed to have the meaning as defined in the
ISDA 2002 Equity Derivatives Definitions.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="issuerName" type="xsd:string" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the issuer name of a fixed income
security or convertible bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="couponRate" type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the coupon rate (expressed in
percentage) of a fixed income security or convertible
bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="maturity"
type="xsd:date" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">The date when the principal amount of a
security becomes due and payable.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="parValue"
type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the nominal amount of a fixed
income security or convertible bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="faceAmount" type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the total amount of the issue.
Corresponds to the par value multiplied by the number of issued
security.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="paymentFrequency" type="Interval" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the frequency at which the bond
pays, e.g. 6M.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="dayCountFraction" type="DayCountFractionEnum" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">The day count basis for the
bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
 
J

jb

Quite correct!

For minOccurs=0, you will need to use an Optional Section. User chooses
whether to have it included or not. *If* he chooses included, then it will
be compulsory.

Greg Collins said:
This is a common misconception... Please read the InfoPath Dev: Dev Nugget titled, "The Difference Between Optional and Not Required".

--
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com



In the schema fragment below, the component elements for "bond" ("coupon
rate", "maturity" have attribute of minoccur=0, making them optional. In the
InfoPath form the default values are fixed as "required" with the nodes set
as "cannot be blank" (which cannot be changed. Why is this happening?


<xsd:element name="bond">
<xsd:annotation>
<xsd:documentation xml:lang="en">Defines the
underlying asset when it is a bond.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="UnderlyingAsset">
<xsd:sequence>
<xsd:element
name="relatedExchangeId" type="ExchangeId" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="de">Eindeutiges Kürzel einer relevanten Börse.
Fehlt dieses Element, gilt die Hauptbörse, an der börsengehandelte Futures-
und Optionskontrakte auf den Basiswert notiert sind, als "Börse" im Sinne der
ISDA-Definitionen zu Aktienderivaten von 2002.</xsd:documentation>

<xsd:documentation xml:lang="en">A short form unique identifier for a related
exchange. If the element is not present then the exchange shall be the
primary exchange on which listed futures and options on the underlying are
listed. The term "Exchange" is assumed to have the meaning as defined in the
ISDA 2002 Equity Derivatives Definitions.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="issuerName" type="xsd:string" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the issuer name of a fixed income
security or convertible bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="couponRate" type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the coupon rate (expressed in
percentage) of a fixed income security or convertible
bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="maturity"
type="xsd:date" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">The date when the principal amount of a
security becomes due and payable.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="parValue"
type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the nominal amount of a fixed
income security or convertible bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="faceAmount" type="xsd:decimal" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the total amount of the issue.
Corresponds to the par value multiplied by the number of issued
security.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="paymentFrequency" type="Interval" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">Specifies the frequency at which the bond
pays, e.g. 6M.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element
name="dayCountFraction" type="DayCountFractionEnum" minOccurs="0">
<xsd:annotation>

<xsd:documentation xml:lang="en">The day count basis for the
bond.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top