When should you use xml schemes (.xsd) when reading xml?

I have an XML file that contains configuration data for data sources and related queries stored in dataseries data items.

Since I really do not need domain objects made up of XML, I just need the settings read and used to configure connections, etc. I was wondering if there are any advantages to using the XML schema that I defined?

I use LINQ to XML to read my XML, and initially thought it would be nice to use strongly typed XML.

Should I use .xsd or is it too much?

Layout XML file:

 <?xml version="1.0" encoding="utf-8" ?>
<datasource name=" Datasource" cache="true">
  <database>
    <connection>
      <provider-name>sqlServer6.0</provider-name>
      <source name="E5"
            connectionString=""/>
    </connection>
    <update-interval>30</update-interval>
    <minimum-update-interval>2</minimum-update-interval>
  </database>
  <dataseries name="" identifier="e5">
    <graph-type></graph-type>
      <query>
        SELECT Period, Price
        FROM PriceUS
        WHERE Date = @date
      </query>
  </dataseries>
  <dataseries name="" identifier="e52">
    <graph-type></graph-type>
    <query>
      SELECT Period, Price
      FROM PriceUS
      WHERE Date = @date
    </query>
  </dataseries>
</datasource>
+3
source share
3 answers

"" XML-: . , XML, valid , . XML , , .

, XML- XML-. , . XSD XML-, .

+4

XML . , (DTD), SGML-. W3C, XSD, .

, , , XML , DTD, , .

, , DTD .

+1

, XML, , , . , XML, XML # - xsd.exe #, marshaled unmarshaled XML.

0

Source: https://habr.com/ru/post/1709150/


All Articles