PDA

View Full Version : XML Extnet Schema to avoid Information Error in web.config



equiman
Dec 27, 2013, 8:24 PM
I'm not expert on this area, but maybe this can help others.
I receive a request to remove all error in one my applications (yes, even info errors :S ).

<extnet> tag in web.config show info error because there aren't scheme for this.

7424

Then I add this code before </xs:schema> tag into DotNetConfig.xsd schema.
(I create the element based on 2.4.0 README File. http://examples2.ext.net/#/Getting_Started/Release_Documents/README/ )


<?xml version="1.0" encoding="us-ascii"?>
<xs:element name="extnet" vs:help="configuration/extnet">
<xs:complexType>
<xs:attribute name="ajaxViewStateMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Exclude" />
<xs:enumeration value="Include" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cleanResourceUrl" type="small_boolean_Type" use="optional" />
<xs:attribute name="dateTimeZoneHandling" type="xs:string" use="optional" />
<xs:attribute name="disableViewState" type="small_boolean_Type" use="optional" />
<xs:attribute name="directEventUrl" type="xs:string" use="optional" />
<xs:attribute name="directMethodProxy" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Include" />
<xs:enumeration value="Ignore" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="directMethodNamespace" type="xs:string" use="optional" />
<xs:attribute name="glyphFontFamily" type="xs:string" use="optional" />
<xs:attribute name="gzip" type="small_boolean_Type" use="optional" />
<xs:attribute name="idMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Client" />
<xs:enumeration value="Explicit" />
<xs:enumeration value="Ignore" />
<xs:enumeration value="Inherit" />
<xs:enumeration value="Legacy" />
<xs:enumeration value="Parent" />
<xs:enumeration value="Predictable" />
<xs:enumeration value="Static" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="initScriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Inline" />
<xs:enumeration value="Linked" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="licenseKey" type="xs:string" use="optional" />
<xs:attribute name="locale" type="xs:string" use="optional" />
<xs:attribute name="namespace" type="xs:string" use="optional" />
<xs:attribute name="renderScripts" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="renderStyles" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="resourcePath" type="xs:string" use="optional" />
<xs:attribute name="resourcesStrategyType" type="xs:string" use="optional" />
<xs:attribute name="resetStyles" type="small_boolean_Type" use="optional" />
<xs:attribute name="rethrowAjaxExceptions" type="small_boolean_Type" use="optional" />
<xs:attribute name="rtl" type="small_boolean_Type" use="optional" />
<xs:attribute name="scriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Release" />
<xs:enumeration value="Debug" />
<xs:enumeration value="Development" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="showWarningOnAjaxFailure" type="small_boolean_Type" use="optional" />
<xs:attribute name="sourceFormatting" type="small_boolean_Type" use="optional" />
<xs:attribute name="stateProvider" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="PostBack" />
<xs:enumeration value="Cookie" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="submitDisabled" type="small_boolean_Type" use="optional" />
<xs:attribute name="theme" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Access" />
<xs:enumeration value="Gray" />
<xs:enumeration value="Neptune" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="themePath" type="xs:string" use="optional" />
<xs:attribute name="quickTips" type="small_boolean_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>
</xs:element>

Now ... I have no error in my projects :D

7425

and have extnet Intellisense on web.config :D

7426

Comments and corrections are welcome. Hope it helps other.

I'm try to create my own extnet.xsd schema but I don't found the way to import DotNetConfig.xsd schema, because need include extnet tag into configuration. If any body knows please let me know... in future I like see an extnet.xsd file on instalation files :D

Daniil
Dec 30, 2013, 4:41 PM
Thank you. We will investigate.

equiman
Jan 09, 2014, 4:10 PM
This is my own ExtNet schema file... but I can make it work, because they don't import correctlly the DotNetConfig.xsd shema.


<?xml version="1.0" encoding="us-ascii"?>
<xs:schema xmlns:tns="urn:schemas-microsoft-com:asm.v1" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="urn:schemas-microsoft-com:asm.v1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas\DotNetConfig.xsd"/>
<xs:element name="extnet" vs:help="configuration/extnet">
<xs:complexType>
<xs:attribute name="ajaxViewStateMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Exclude" />
<xs:enumeration value="Include" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cleanResourceUrl" type="small_boolean_Type" use="optional" />
<xs:attribute name="dateTimeZoneHandling" type="xs:string" use="optional" />
<xs:attribute name="disableViewState" type="small_boolean_Type" use="optional" />
<xs:attribute name="directEventUrl" type="xs:string" use="optional" />
<xs:attribute name="directMethodProxy" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Include" />
<xs:enumeration value="Ignore" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="directMethodNamespace" type="xs:string" use="optional" />
<xs:attribute name="glyphFontFamily" type="xs:string" use="optional" />
<xs:attribute name="gzip" type="small_boolean_Type" use="optional" />
<xs:attribute name="idMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Client" />
<xs:enumeration value="Explicit" />
<xs:enumeration value="Ignore" />
<xs:enumeration value="Inherit" />
<xs:enumeration value="Legacy" />
<xs:enumeration value="Parent" />
<xs:enumeration value="Predictable" />
<xs:enumeration value="Static" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="initScriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Inline" />
<xs:enumeration value="Linked" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="licenseKey" type="xs:string" use="optional" />
<xs:attribute name="locale" type="xs:string" use="optional" />
<xs:attribute name="namespace" type="xs:string" use="optional" />
<xs:attribute name="renderScripts" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="renderStyles" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="resourcePath" type="xs:string" use="optional" />
<xs:attribute name="resourcesStrategyType" type="xs:string" use="optional" />
<xs:attribute name="resetStyles" type="small_boolean_Type" use="optional" />
<xs:attribute name="rethrowAjaxExceptions" type="small_boolean_Type" use="optional" />
<xs:attribute name="rtl" type="small_boolean_Type" use="optional" />
<xs:attribute name="scriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Release" />
<xs:enumeration value="Debug" />
<xs:enumeration value="Development" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="showWarningOnAjaxFailure" type="small_boolean_Type" use="optional" />
<xs:attribute name="sourceFormatting" type="small_boolean_Type" use="optional" />
<xs:attribute name="stateProvider" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="PostBack" />
<xs:enumeration value="Cookie" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="submitDisabled" type="small_boolean_Type" use="optional" />
<xs:attribute name="theme" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Access" />
<xs:enumeration value="Gray" />
<xs:enumeration value="Neptune" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="themePath" type="xs:string" use="optional" />
<xs:attribute name="quickTips" type="small_boolean_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>
</xs:element>
</xs:schema>

equiman
Mar 17, 2015, 4:29 PM
An update to VS 2013. Using Ext.Net 2:


<?xml version="1.0" encoding="utf-8"?>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="entityFramework">
<xs:complexType>
<xs:all>
<xs:element name="defaultConnectionFactory" type="ElementWithTypeAndParameters_Type" minOccurs="0" maxOccurs="1" />
<xs:element name="providers" type="ProviderList_Type" minOccurs="0" maxOccurs="1" />
<xs:element name="contexts" type="ContextList_Type" minOccurs="0" maxOccurs="1" />
<xs:element name="interceptors" type="InterceptorList_Type" minOccurs="0" maxOccurs="1" />
</xs:all>
<xs:attribute name="codeConfigurationType" type="NonEmptyString_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>
</xs:element>

<xs:complexType name="ProviderList_Type">
<xs:sequence>
<xs:element name="provider" type="Provider_Type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="Provider_Type">
<xs:attribute name="invariantName" type="NonEmptyString_Type" use="required" />
<xs:attribute name="type" type="NonEmptyString_Type" use="required" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="ContextList_Type">
<xs:sequence>
<xs:element name="context" type="Context_Type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="Context_Type">
<xs:choice>
<xs:element name="databaseInitializer" type="ElementWithTypeAndParameters_Type" minOccurs="0" maxOccurs="1" />
</xs:choice>
<xs:attribute name="type" type="NonEmptyString_Type" use="required" />
<xs:attribute name="disableDatabaseInitialization" type="SmallBoolean_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="InterceptorList_Type">
<xs:sequence>
<xs:element name="interceptor" type="ElementWithTypeAndParameters_Type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="ElementWithTypeAndParameters_Type">
<xs:choice>
<xs:element name="parameters" type="ParameterList_Type" minOccurs="0" maxOccurs="1" />
</xs:choice>
<xs:attribute name="type" type="NonEmptyString_Type" use="required" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="ParameterList_Type">
<xs:sequence>
<xs:element name="parameter" type="Parameter_Type" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:complexType name="Parameter_Type">
<xs:attribute name="value" type="NonEmptyString_Type" use="required" />
<xs:attribute name="type" type="NonEmptyString_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>

<xs:simpleType name="SmallBoolean_Type">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="false" />
<xs:enumeration value="true" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NonEmptyString_Type">
<xs:restriction base="xs:string">
<xs:minLength value="1" />
</xs:restriction>
</xs:simpleType>

<xs:element name="extnet">
<xs:complexType>
<xs:attribute name="ajaxViewStateMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Exclude" />
<xs:enumeration value="Include" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cleanResourceUrl" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="dateTimeZoneHandling" type="xs:string" use="optional" />
<xs:attribute name="disableViewState" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="directEventUrl" type="xs:string" use="optional" />
<xs:attribute name="directMethodProxy" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Include" />
<xs:enumeration value="Ignore" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="directMethodNamespace" type="xs:string" use="optional" />
<xs:attribute name="glyphFontFamily" type="xs:string" use="optional" />
<xs:attribute name="gzip" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="idMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Client" />
<xs:enumeration value="Explicit" />
<xs:enumeration value="Ignore" />
<xs:enumeration value="Inherit" />
<xs:enumeration value="Legacy" />
<xs:enumeration value="Parent" />
<xs:enumeration value="Predictable" />
<xs:enumeration value="Static" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="initScriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Inline" />
<xs:enumeration value="Linked" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="licenseKey" type="xs:string" use="optional" />
<xs:attribute name="locale" type="xs:string" use="optional" />
<xs:attribute name="namespace" type="xs:string" use="optional" />
<xs:attribute name="renderScripts" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="renderStyles" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="resourcePath" type="xs:string" use="optional" />
<xs:attribute name="resourcesStrategyType" type="xs:string" use="optional" />
<xs:attribute name="resetStyles" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="rethrowAjaxExceptions" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="rtl" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="scriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Release" />
<xs:enumeration value="Debug" />
<xs:enumeration value="Development" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="showWarningOnAjaxFailure" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="sourceFormatting" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="stateProvider" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="PostBack" />
<xs:enumeration value="Cookie" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="submitDisabled" type="SmallBoolean_Type" use="optional" />
<xs:attribute name="theme" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Access" />
<xs:enumeration value="Gray" />
<xs:enumeration value="Neptune" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="themePath" type="xs:string" use="optional" />
<xs:attribute name="quickTips" type="SmallBoolean_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>
</xs:element>

</xs:schema>

If you want to edit this schema file with visual studio or see all the properties.

In web.config file, context menu over the code and choose properties.
The copy path (for me: "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Xml\Schemas\DotNetConfig40.xsd") in Schemas attribute and open it with VS.

Daniil
Mar 19, 2015, 3:25 PM
@equiman, we much appreciate your contribution. Thank you!