|
Исправить схему.
|
|||
---|---|---|---|
#18+
Добрый день! Не ругайте пожалуйста сильно подскажите где неправильно? Работа горит <?xml version="1.0" encoding="UTF-8"?><export><xsd:schema xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="AAAtypes" xmlns:schema="urn:schemas-microsoft-com:sql:SqlRowSet1" targetNamespace="urn:schemas-microsoft-com:sql:SqlRowSet1"> <xsd:annotation> <xsd:documentation xml:lang="en">AAA</xsd:documentation> </xsd:annotation> <!-- Global types and attributes that can be used for schema annotations. --> <xsd:simpleType name="sqlDbTypeEnum"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="BigInt"/> <xsd:enumeration value="Binary"/> <xsd:enumeration value="Bit"/> <xsd:enumeration value="Char"/> <xsd:enumeration value="Date"/> <xsd:enumeration value="DateTime"/> <xsd:enumeration value="DateTimeOffset"/> <xsd:enumeration value="DateTime2"/> <xsd:enumeration value="Decimal"/> <xsd:enumeration value="Float"/> <xsd:enumeration value="Image"/> <xsd:enumeration value="Int"/> <xsd:enumeration value="Money"/> <xsd:enumeration value="NChar"/> <xsd:enumeration value="NText"/> <!-- --> <xsd:enumeration value="NVarChar"/> <xsd:enumeration value="Real"/> <xsd:enumeration value="SmallDateTime"/> <xsd:enumeration value="SmallInt"/> <xsd:enumeration value="SmallMoney"/> <xsd:enumeration value="Structured"/> <xsd:enumeration value="Text"/> <xsd:enumeration value="Time"/> <xsd:enumeration value="Timestamp"/> <xsd:enumeration value="TinyInt"/> <xsd:enumeration value="Udt"/> <xsd:enumeration value="UniqueIdentifier"/> <xsd:enumeration value="VarBinary"/> <xsd:enumeration value="VarChar"/> <xsd:enumeration value="Variant"/> <xsd:enumeration value="Xml"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="sqlCompareOptionsEnum"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="Default"/> <xsd:enumeration value="None"/> <xsd:enumeration value="IgnoreCase"/> <xsd:enumeration value="IgnoreNonSpace"/> <xsd:enumeration value="IgnoreKanaType"/> <xsd:enumeration value="IgnoreWidth"/> <xsd:enumeration value="BinarySort"/> <xsd:enumeration value="BinarySort2"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="sqlCompareOptionsList"> <xsd:list itemType="sqltypes:sqlCompareOptionsEnum"/> </xsd:simpleType> <xsd:attribute default="NVarChar" name="sqlDbType" type="sqltypes:sqlDbTypeEnum"/> <xsd:attribute name="clrTypeName" type="xsd:string"/> <xsd:attribute default="1" name="maxLength" type="xsd:long"/> <xsd:attribute default="-1" name="localeId" type="xsd:int"/> <xsd:attribute default="Default" name="sqlCompareOptions" type="sqltypes:sqlCompareOptionsList"/> <xsd:attribute default="0" name="sqlCollationVersion" type="xsd:int"/> <xsd:attribute default="0" name="sqlSortId" type="xsd:int"/> <xsd:attribute default="0" name="scale" type="xsd:unsignedByte"/> <xsd:attribute default="18" name="precision" type="xsd:unsignedByte"/> <xsd:attribute name="xmlSchemaCollection" type="xsd:string"/> <xsd:attribute name="sqlTypeAlias" type="xsd:string"/> <xsd:attribute default="false" name="supplementaryCharacters" type="xsd:boolean"/> <!-- Global types that describe the base SQL types. --> <xsd:simpleType name="char"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="nchar"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="varchar"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="nvarchar"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="text"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="ntext"> <xsd:restriction base="xsd:string"/> </xsd:simpleType> <xsd:simpleType name="varbinary"> <xsd:restriction base="xsd:base64Binary"/> </xsd:simpleType> <xsd:simpleType name="binary"> <xsd:restriction base="xsd:base64Binary"/> </xsd:simpleType> <xsd:simpleType name="image"> <xsd:restriction base="xsd:base64Binary"/> </xsd:simpleType> <xsd:simpleType name="timestamp"> <xsd:restriction base="xsd:base64Binary"> <xsd:maxLength value="8"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="timestampNumeric"> <!-- The timestampNumeric type supports a legacy format of timestamp. --> <xsd:restriction base="xsd:long"/> </xsd:simpleType> <xsd:simpleType name="decimal"> <xsd:restriction base="xsd:decimal"/> </xsd:simpleType> <xsd:simpleType name="numeric"> <xsd:restriction base="xsd:decimal"/> </xsd:simpleType> <xsd:simpleType name="bigint"> <xsd:restriction base="xsd:long"/> </xsd:simpleType> <xsd:simpleType name="int"> <xsd:restriction base="xsd:int"/> </xsd:simpleType> <xsd:simpleType name="smallint"> <xsd:restriction base="xsd:short"/> </xsd:simpleType> <xsd:simpleType name="tinyint"> <xsd:restriction base="xsd:unsignedByte"/> </xsd:simpleType> <xsd:simpleType name="bit"> <xsd:restriction base="xsd:boolean"/> </xsd:simpleType> <xsd:simpleType name="float"> <xsd:restriction base="xsd:double"/> </xsd:simpleType> <xsd:simpleType name="real"> <xsd:restriction base="xsd:float"/> </xsd:simpleType> <xsd:simpleType name="datetime"> <xsd:restriction base="xsd:dateTime"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))T(([01][0-9])|(2[0-3]))(:[0-5][0-9]){2}(\.[0-9]{2}[037])?"/> <xsd:maxInclusive value="9999-12-31T23:59:59.997"/> <xsd:minInclusive value="1753-01-01T00:00:00.000"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="smalldatetime"> <xsd:restriction base="xsd:dateTime"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))T(([01][0-9])|(2[0-3]))(:[0-5][0-9])(:00)"/> <xsd:maxInclusive value="2079-06-06T23:59:00"/> <xsd:minInclusive value="1900-01-01T00:00:00"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="date"> <xsd:restriction base="xsd:date"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))"/> <xsd:maxInclusive value="9999-12-31"/> <xsd:minInclusive value="0001-01-01"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="time"> <xsd:restriction base="xsd:time"> <xsd:pattern value="(([01][0-9])|(2[0-3]))(:[0-5][0-9]){2}(\.[0-9]+)?"/> <xsd:minInclusive value="00:00:00"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="datetime2"> <xsd:restriction base="xsd:dateTime"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))T(([01][0-9])|(2[0-3]))(:[0-5][0-9]){2}(\.[0-9]+)?"/> <xsd:minInclusive value="0001-01-01T00:00:00"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="datetimeoffset"> <xsd:restriction base="xsd:dateTime"></xsd:restriction> </xsd:simpleType> <xsd:simpleType name="money"> <xsd:restriction base="xsd:decimal"> <xsd:totalDigits value="19"/> <xsd:fractionDigits value="4"/> <xsd:maxInclusive value="922337203685477.5807"/> <xsd:minInclusive value="-922337203685477.5808"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="smallmoney"> <xsd:restriction base="xsd:decimal"> <xsd:totalDigits value="10"/> <xsd:fractionDigits value="4"/> <xsd:maxInclusive value="214748.3647"/> <xsd:minInclusive value="-214748.3648"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="uniqueidentifier"> <xsd:restriction base="xsd:string"> <xsd:pattern value="([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})|(\{[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\})"/> </xsd:restriction> </xsd:simpleType> <!-- sql_variant directly maps to xsd:anyType --> <xsd:complexType name="xml" mixed="true"> <xsd:sequence> <xsd:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/> </xsd:sequence> </xsd:complexType> <!-- the following type is for FOR XML binary URL results only --> <xsd:simpleType name="dbobject"> <xsd:restriction base="xsd:anyURI"/> </xsd:simpleType> <xsd:element name="list"> <xsd:complexType> <xsd:attribute name="dt" type="sqltypes:date"/> <xsd:attribute name="sm"><xsd:simpleType> <xsd:restriction base="sqltypes:decimal"><xsd:totalDigits value="18"/> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute><xsd:attribute name="smchk"><xsd:simpleType> <xsd:restriction base="sqltypes:decimal"> <xsd:totalDigits value="18"/> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:schema> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-05" sm="16648410.40" smchk="184089.33"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-06" sm="24920334.09"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-07" sm="13471064.39"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-08" sm="12726993.50"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-09" sm="1364418.37" smchk="848000.00"/> </export> ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 06:25 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Вот это что за ерунда? xmlns:sqltypes="AAAtypes" На нее ссылается куча дефиниций типа <xsd:list itemType="sqltypes:sqlCompareOptionsEnum"/> Чтобы они работали, пространство имен AAAtypes должно быть описано в отдельном xsd-файле, который должен быть импортирован через xsd:import namespace="AAAtypes" /> ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 08:47 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Спасибо за ответ, а если сократить файл без "xmlns:sqltypes="AAAtypes"" до указанного внизу, тоже ошибка. Не распознает тип type="date" , хотя на вверху расписываю [u] " <xsd:simpleType name="date"> <xsd:restriction base="xsd:date"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))"/> <xsd:maxInclusive value="9999-12-31"/> <xsd:minInclusive value="0001-01-01"/> </xsd:restriction> </xsd:simpleType> " [/u] Я в xml чайник прошу если задаю не корректный вопрос направить меня в правильное русло. Если зададите вопрос почему сразу не использовать type="xsd:date" вместо type="date", то <xsd:element name="list"> формирует sql автоматический и вместо ссылки на http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd хотел внедрить схему сразу в один файл с данными. Сокращенный файл: <?xml version="1.0" encoding="UTF-8"?> <export> <xsd:schema xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:schema="urn:schemas-microsoft-com:sql:SqlRowSet1" targetNamespace="urn:schemas-microsoft-com:sql:SqlRowSet1"> <xsd:annotation> <xsd:documentation xml:lang="en">AAA</xsd:documentation> </xsd:annotation> <!-- Global types and attributes that can be used for schema annotations. --> <xsd:simpleType name="decimal"> <xsd:restriction base="xsd:decimal"/> </xsd:simpleType> <xsd:simpleType name="date"> <xsd:restriction base="xsd:date"> <xsd:pattern value="((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9]{2})|([1-9][0-9]{3}))-((0[1-9])|(1[012]))-((0[1-9])|([12][0-9])|(3[01]))"/> <xsd:maxInclusive value="9999-12-31"/> <xsd:minInclusive value="0001-01-01"/> </xsd:restriction> </xsd:simpleType> <xsd:element name="list"> <xsd:complexType> <xsd:attribute name="dt" type="date"/> <xsd:attribute name="sm"> <xsd:simpleType> <xsd:restriction base="decimal"> <xsd:totalDigits value="18"/> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> <xsd:attribute name="smchk"> <xsd:simpleType> <xsd:restriction base="decimal"> <xsd:totalDigits value="18"/> <xsd:fractionDigits value="2"/> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> </xsd:schema> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-05" sm="16648410.40" smchk="184089.33"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-06" sm="24920334.09"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-07" sm="13471064.39"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-08" sm="12726993.50"/> <list xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" dt="2014-02-09" sm="1364418.37" smchk="848000.00"/> </export> ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 09:07 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Конечная цель состоит в том что вместо http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd внедрить саму схему в автоматический формируемый xml-файл в SQL запросе вида Select * From [usertable] For Xml Auto, XmlSchema ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 09:25 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
в первом варианте исправить xmlns:sqltypes=" http://schemas.microsoft.com/sqlserver/2004/sqltypes" добавить <xsd:import namespace=" http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation=" http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" /> и все заработает ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 10:40 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Спасибо за ответ, как раз я хочу удалить строчку <xsd:import namespace=" http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation=" http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" /> и включить в файл схему. Для чего? Когда загружаешь полученный XML от SQL в DataSet (C#) программа начинает подгружать схему ( http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd). Все хорошо все идеально работает, пока у системы есть доступ на прямую в интернет, но когда все работает через прокси сервер вот здесь начинается самое интересное. Сам xml-файл можно загрузить с интернета через прокси, там проблем нет, но когда XML - загружается в DataSet, там уже загрузка не управляется, система требует прямого доступ к интернету. А большие фирмы работают все через прокси и прямого доступа не дадут, поэтому хочу избавиться от схемы http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd и сразу включить схему в саму xml - файл без лишних скачиваний. И плюсом еще будет скорость работы программы, но это уже второй вопрос, самое главное внедрить схему в сам xml-файл. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 10:59 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Ерундой не занимайтесь. Скачайте схему, поменяйте schemaLocation на локальный путь и будет датасету щастье. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 11:30 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
Программа установлен не только у меня, но и у наших клиентов а их свыше 1000 пользователей. Всем скачивать на локальный диск будет проблематично, чтобы в схеме указать schemaLocation у всех тогда путь должен быть одинаковым, будет ли у всех права на запись файла, создание папки не знаю (региональным сотрудникам права урезают сильно администраторы), а программа должна работать наверняка. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 17:06 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
serega82 у всех тогда путь должен быть одинаковымне должен. меняйте путь в schemaLocation на локальный перед загрузкой xml в датасет. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 17:19 |
|
Исправить схему.
|
|||
---|---|---|---|
#18+
serega82 Программа установлен не только у меня, но и у наших клиентов а их свыше 1000 пользователей.И программа никогда не обновляется? serega82 будет ли у всех права на запись файлаправа нужны те же, что для установки программы. один раз установили, напрягутся и еще раз. если для установки использовать clickonce, то достаточно юзерских прав. и обновляться будет автоматически. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.03.2014, 17:22 |
|
|
start [/forum/topic.php?fid=14&msg=38579306&tid=1332389]: |
0ms |
get settings: |
10ms |
get forum list: |
15ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
174ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
50ms |
get tp. blocked users: |
1ms |
others: | 245ms |
total: | 517ms |
0 / 0 |