Required filed

C

Carlos

Hello everybody,

I have doubt, why is it required ('Cannot be blank') a field when is added
to the schema as base64Binay or Datetime?

here you have an example of my schema

Any suggestions will be apreciated,
Thanks, Carlos

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string" />
<xs:element name="LastName" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
 
C

Carlos

Thanks, yes it is, and I can show you another one made by Visual Studio
following an infopath lab where happens the same:

<?xml version="1.0" encoding="utf-8" ?>
- <DataSet xmlns="http://tempuri.org/">
- <xs:schema id="DataSet1"
targetNamespace="http://www.tempuri.org/DataSet1.xsd"
xmlns:mstns="http://www.tempuri.org/DataSet1.xsd"
xmlns="http://www.tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
attributeFormDefault="qualified" elementFormDefault="qualified">
- <xs:element name="DataSet1" msdata:IsDataSet="true" msdata:Locale="es-ES">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Purchases_Table">
- <xs:complexType>
- <xs:sequence>
<xs:element name="ID" msdata:ReadOnly="true" msdata:AutoIncrement="true"
type="xs:int" />
<xs:element name="Priority" type="xs:string" minOccurs="0" />
<xs:element name="Charge_To" type="xs:string" minOccurs="0" />
<xs:element name="Date_Requested" type="xs:dateTime" minOccurs="0" />
<xs:element name="Date_Required" type="xs:dateTime" minOccurs="0" />
<xs:element name="Submitted_By" type="xs:string" minOccurs="0" />
<xs:element name="Submitted_Email" type="xs:string" minOccurs="0" />
<xs:element name="Submitted_Phone" type="xs:string" minOccurs="0" />
<xs:element name="Supplier_Name" type="xs:string" minOccurs="0" />
<xs:element name="Supplier_Web" type="xs:string" minOccurs="0" />
<xs:element name="Ship_Method" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_To" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_Address_1" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_Address_2" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_Email" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_City" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_State" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_CP" type="xs:string" minOccurs="0" />
<xs:element name="Deliver_Country" type="xs:string" minOccurs="0" />
<xs:element name="File_Attached" type="xs:base64Binary" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
- <xs:unique name="Constraint1" msdata:primaryKey="true">
<xs:selector xpath=".//mstns:purchases_Table" />
<xs:field xpath="mstns:ID" />
</xs:unique>
</xs:element>
</xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <DataSet1 xmlns="http://www.tempuri.org/DataSet1.xsd">
- <Purchases_Table diffgr:id="Purchases_Table1" msdata:rowOrder="0">
<ID>10</ID>
<Priority>Low</Priority>
<Charge_To>pepe</Charge_To>
<Date_Requested>2005-12-21T00:00:00.0000000+01:00</Date_Requested>
<Date_Required>2005-12-17T00:00:00.0000000+01:00</Date_Required>
</Purchases_Table>
- <Purchases_Table diffgr:id="Purchases_Table2" msdata:rowOrder="1">
<ID>11</ID>
<Priority />
<Charge_To />
<Date_Requested>2006-01-05T00:00:00.0000000+01:00</Date_Requested>
<Date_Required>2006-01-27T00:00:00.0000000+01:00</Date_Required>
<Submitted_By>some</Submitted_By>
<Submitted_Email>man</Submitted_Email>
<Supplier_Name>who</Supplier_Name>
<Supplier_Web>eat</Supplier_Web>
<Ship_Method>chicken</Ship_Method>
<Deliver_To />
<Deliver_Address_1 />
<Deliver_Address_2 />
<Deliver_Email />
<Deliver_City />
<Deliver_State />
<Deliver_CP />
<Deliver_Country />

<File_Attached>x0lGQRQAAAABAAAAAAAAABwAAAALAAAAcgBvAGIAbwB0AHMALgB0AHgAdAAAAFVzZXItQWdlbnQ6ICoNCkRpc2FsbG93OiAvDQo=</File_Attached>
</Purchases_Table>
</DataSet1>
</diffgr:diffgram>
</DataSet>
 
B

Bob C.

Regarding my last post, minoccurs=0 for the element in the fields list seemed
to fix this.
 
B

Bob C.

Carlos,

Try a something like this...

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema
targetNamespace="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-23T11:58:56"
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-23T11:58:56" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="myFields">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="my:requiredname" minOccurs="0"/>
<xsd:element ref="my:SomeOptional64Field" minOccurs="0"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"
namespace="http://www.w3.org/XML/1998/namespace"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="requiredname" type="my:requiredString"/>
<xsd:simpleType name="requiredString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Optional64Binary">
<xsd:restriction base="xsd:base64Binary">
<xsd:minLength value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="requiredAnyURI">
<xsd:restriction base="xsd:anyURI">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="SomeOptional64Field" type="my:Optional64Binary"
nillable="true"/>
</xsd:schema>
 

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