Skip to content

Добавить схему xsd #30

Description

@Defm

Использую, удобно, нравится
Хотелось бы:

  • При работе с xml на "публику" нужна схема xsd, де-факто это стандарт

Могу предложить свою, она вполне проходит проверку например здесь

<?xml version="1.0" encoding="UTF-8"?> <schema attributeFormDefault="unqualified" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:gen="http://www.xmlgenerator.org/ru" targetNamespace="http://www.xmlgenerator.org/ru"> <element name="calendar" type="gen:calendarType"/> <complexType name="holidayType"> <simpleContent> <extension base="string"> <attribute type="byte" name="id" use="optional"/> <attribute type="string" name="title" use="optional"/> </extension> </simpleContent> </complexType> <complexType name="holidaysType"> <sequence> <element type="gen:holidayType" name="holiday" maxOccurs="unbounded" minOccurs="0"/> </sequence> </complexType> <complexType name="dayType"> <simpleContent> <extension base="string"> <attribute type="string" name="d" use="optional"/> <attribute type="byte" name="t" use="optional"/> <attribute type="byte" name="h" use="optional"/> <attribute type="string" name="f" use="optional"/> </extension> </simpleContent> </complexType> <complexType name="daysType"> <sequence> <element type="gen:dayType" name="day" maxOccurs="unbounded" minOccurs="0"/> </sequence> </complexType> <complexType name="calendarType"> <sequence> <element type="gen:holidaysType" name="holidays"/> <element type="gen:daysType" name="days"/> </sequence> <attribute type="short" name="year"/> <attribute type="string" name="lang"/> <attribute type="string" name="date"/> </complexType> </schema>

Для работы в XML должно быть указано пространство, ровно такое как в схеме
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions