Hi
I've created a xsd file in VS2005 as below.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="ReportSetting" targetNamespace="
http://PopularERP/ReportSetting" elementFormDefault="qualif
ied" xmlns="
http://PopularERP/ReportSetting" xmlns:mstns="
http://PopularERP/ReportSetting" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:msprop="urn:schemas-
microsoft-
com:xml-ms
prop" version="1.0">
<xs:element name="ReportSetting">
<xs:complexType>
<xs:sequence>
<xs:element name="Report" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Parameter" minOccurs="0" maxOccurs="20">
<xs:complexType>
<xs:sequence />
<xs:attribute name="Name" type="xs:string" />
<xs:attribute name="Prompt" type="xs:string" use="optional" />
<xs:attribute name="ParameterValue" type="xs:string" msprop:nullValue="_empty" use="optional" />
<xs:attribute name="Visible" type="xs:boolean" default="true" />
<xs:attribute name="Type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="String" />
<xs:enumeration value="Integer" />
<xs:enumeration value="Date" />
<xs:enumeration value="Boolean" />
<xs:enumeration value="Decimal" />
<xs:enumeration value="CorporationId" />
<xs:enumeration value="Item" />
<xs:enumeration value="DetailAccount" />
<xs:enumeration value="SummaryAccount" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Description" type="xs:string" default="String.Empty" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="Name" type="xs:string" />
<xs:attribute name="PromptParameter" type="xs:boolean" />
<xs:attribute name="Format">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="html" />
<xs:enumeration value="pdf" />
<xs:enumeration value="xls" />
<xs:enumeration value="tiff" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Title" type="xs:string" />
<xs:attribute name="Folder" type="xs:string" />
<xs:attribute name="ReportType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="cs" />
<xs:enumeration value="rpx" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The problem is when I use the schema to create a new xml file as below, VS thought the xml has syntax error.
<?xml version="1.0" encoding="utf-8" ?>
<ReportSetting xmlns="
http://PopularERP/ReportSetting">
<Report Name="LOGI_02" Title="Inventory Value Report" Format="html" PromptParameter="true" ReportType="cs" Folder="Inventory">
<Description>Show total value of inventory as at a specific date.</Description>
<Parameter Name="corporationId" Prompt="CorporationId" Type="CorporationId" Visible="false"/>
<Parameter Name="atEndOfDate" Prompt="As at end of" Type="Date" Visible="true" />
</Report>
</ReportSetting>
When I add the first child under <Report>, the intellisense give me choices of <Description> and <Parameter>. After adding <Description>, there is no choices for <Parameter> any more. If I type the XML manually, the first <Parameter> is underlined saying "The element Report in namespace
http://PopularERP/ReportSetting has invalid child element Parameter in namespace
http://PopularERP/ReportSetting".
What I want to achieve is to have one or none <Description> and none and multiple <Parameter> under <Report>. Can you help me to correct my xsd if it is not defined properly?
Thanks
Edwin
Start Free Trial