{"id":301183,"date":"2020-04-02T15:00:53","date_gmt":"2020-04-02T15:00:53","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=301183"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=301183","title":{"rendered":"\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f XML \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XSD, JAXB \u0438 Spring Framework"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495282\/\">\n<h2>\u041e\u0431\u0437\u043e\u0440<\/h2>\n<p>  <\/p>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 XML \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring Framework. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 web-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML-Java (unmarshalling) \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 XSD-\u0441\u0445\u0435\u043c\u0435. XML-\u0444\u0430\u0439\u043b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 Java \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 jar \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0414\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0435\u043d Apache ANSI Printer, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0448\u0440\u0438\u0444\u0442, \u0446\u0432\u0435\u0442 \u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 cmd.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 GitHub \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/github.com\/alexk11\/XmlProcessor\">XmlProcessor<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c. <\/p>\n<p>  <\/p>\n<h2>1. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0441\u0445\u0435\u043c\u044b<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c 2 XML \u0444\u0430\u0439\u043b\u0430 Address.xml \u0438 Client.xml.<\/p>\n<p>  <\/p>\n<p>Address.xml:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;        &lt;ns:Request xmlns:ns=&quot;http:\/\/www.tempuri.org\/types&quot;&gt;          &lt;Version&gt;V001.000.00&lt;\/Version&gt;          &lt;Address&gt;              &lt;Apartment&gt;50&lt;\/Apartment&gt;              &lt;House&gt;7&lt;\/House&gt;              &lt;Street&gt;Sadovaya&lt;\/Street&gt;              &lt;City&gt;SPB&lt;\/City&gt;              &lt;Country&gt;Russia&lt;\/Country&gt;              &lt;Index&gt;123456&lt;\/Index&gt;          &lt;\/Address&gt;        &lt;\/ns:Request&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>Client.xml:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">      &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;       &lt;ns:Request xmlns:ns=&quot;http:\/\/www.tempuri.org\/types&quot;&gt;          &lt;Version&gt;V001.000.00&lt;\/Version&gt;          &lt;Client&gt;              &lt;Id&gt;12&lt;\/Id&gt;              &lt;Name&gt;A&lt;\/Name&gt;          &lt;\/Client&gt;          &lt;Client&gt;              &lt;Id&gt;34&lt;\/Id&gt;              &lt;Name&gt;B&lt;\/Name&gt;          &lt;\/Client&gt;      &lt;\/ns:Request&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c XSD-\u0441\u0445\u0435\u043c\u044b XmlValidator.xsd, ComplexTypes.xsd \u0438 SimpleTypes.xsd \u0441<br \/>  \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 CombinedType \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 Address \u0438 Client:<\/p>\n<p>  <\/p>\n<p>XmlValidator.xsd:<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">     &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;      &lt;xsd:schema xmlns:ns=&quot;http:\/\/www.tempuri.org\/types&quot;           xmlns:xsd=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;           xmlns:ict=&quot;complextypes&quot;           targetNamespace=&quot;http:\/\/www.tempuri.org\/types&quot;           elementFormDefault=&quot;qualified&quot;&gt;           &lt;xsd:import namespace=&quot;complextypes&quot; schemaLocation=&quot;complextypes.xsd&quot;\/&gt;           &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;XSD structure&lt;\/xsd:documentation&gt;           &lt;\/xsd:annotation&gt;           &lt;xsd:element name=&quot;Combined&quot; type=&quot;ict:CombinedType&quot;&gt;               &lt;xsd:annotation&gt;                    &lt;xsd:documentation&gt;XML definition&lt;\/xsd:documentation&gt;               &lt;\/xsd:annotation&gt;           &lt;\/xsd:element&gt;      &lt;\/xsd:schema&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ComplexTypes.xsd<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;     &lt;xsd:schema xmlns:xsd=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;         xmlns=&quot;complextypes&quot;         xmlns:ist=&quot;simpletypes&quot;         targetNamespace=&quot;complextypes&quot;&gt;     &lt;xsd:import namespace=&quot;simpletypes&quot; schemaLocation=&quot;simpletypes.xsd&quot;\/&gt;          &lt;xsd:complexType name=&quot;CombinedType&quot;&gt;        &lt;xsd:sequence&gt;           &lt;xsd:element name=&quot;Version&quot; type=&quot;ist:VersionType&quot;&gt;                &lt;xsd:annotation&gt;                     &lt;xsd:documentation&gt;The version&lt;\/xsd:documentation&gt;                &lt;\/xsd:annotation&gt;           &lt;\/xsd:element&gt;           &lt;xsd:choice&gt;              &lt;xsd:element name=&quot;Address&quot; type=&quot;AddressType&quot; maxOccurs=&quot;1&quot;&gt;                  &lt;xsd:annotation&gt;                      &lt;xsd:documentation&gt;Address type&lt;\/xsd:documentation&gt;                  &lt;\/xsd:annotation&gt;              &lt;\/xsd:element&gt;              &lt;xsd:element name=&quot;Client&quot; type=&quot;ClientType&quot; maxOccurs=&quot;unbounded&quot;&gt;                   &lt;xsd:annotation&gt;                      &lt;xsd:documentation&gt;Client type&lt;\/xsd:documentation&gt;                   &lt;\/xsd:annotation&gt;              &lt;\/xsd:element&gt;           &lt;\/xsd:choice&gt;        &lt;\/xsd:sequence&gt;     &lt;\/xsd:complexType&gt;      &lt;xsd:complexType name=&quot;AddressType&quot;&gt;        &lt;xsd:sequence&gt;           &lt;xsd:element name=&quot;Apartment&quot; type=&quot;ist:ApartmentType&quot;&gt;              &lt;xsd:annotation&gt;                 &lt;xsd:documentation&gt;Apartment number&lt;\/xsd:documentation&gt;              &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;House&quot; type=&quot;ist:HouseNumberType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;House number&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;Street&quot; type=&quot;ist:StreetType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;Street name&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;City&quot; type=&quot;ist:CityType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;City name&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;Country&quot; type=&quot;ist:CountryType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;Country name&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;Index&quot; type=&quot;ist:IndexType&quot; minOccurs=&quot;0&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;Postal index&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;       &lt;\/xsd:sequence&gt;    &lt;\/xsd:complexType&gt;     &lt;xsd:complexType name=&quot;ClientType&quot;&gt;       &lt;xsd:sequence&gt;          &lt;xsd:element name=&quot;Id&quot; type=&quot;ist:IdType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;The id&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;          &lt;xsd:element name=&quot;Name&quot; type=&quot;ist:NameType&quot;&gt;             &lt;xsd:annotation&gt;                &lt;xsd:documentation&gt;The name&lt;\/xsd:documentation&gt;             &lt;\/xsd:annotation&gt;          &lt;\/xsd:element&gt;       &lt;\/xsd:sequence&gt;    &lt;\/xsd:complexType&gt;  &lt;\/xsd:schema&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SimpleTypes.xsd<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt; &lt;xsd:schema xmlns:xsd=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;  \t\t\txmlns=&quot;simpletypes&quot;  \t\t\ttargetNamespace=&quot;simpletypes&quot;&gt; \t \t&lt;xsd:simpleType name=&quot;VersionType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;V000.000.00&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:string&quot;&gt; \t\t\t&lt;xsd:maxLength value=&quot;11&quot;\/&gt; \t\t\t&lt;xsd:pattern value=&quot;V[0-9]{3}.[0-9]{3}.[0-9]{2}&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt;\t\t              &lt;xsd:simpleType name=&quot;IdType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;Int, 10 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:nonNegativeInteger&quot;&gt; \t\t\t&lt;xsd:totalDigits value=&quot;10&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;NameType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;String, 50 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:string&quot;&gt; \t\t\t&lt;xsd:maxLength value=&quot;50&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;ApartmentType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;Int, 4 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:nonNegativeInteger&quot;&gt; \t\t\t&lt;xsd:totalDigits value=&quot;4&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t\t\t \t&lt;xsd:simpleType name=&quot;HouseNumberType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;Int, 3 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:nonNegativeInteger&quot;&gt; \t\t\t&lt;xsd:totalDigits value=&quot;3&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;StreetType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;String, 40 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:string&quot;&gt; \t\t\t&lt;xsd:maxLength value=&quot;40&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;CityType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;City, 40 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:string&quot;&gt; \t\t\t&lt;xsd:maxLength value=&quot;40&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;CountryType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;Country, 30 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:string&quot;&gt; \t\t\t&lt;xsd:maxLength value=&quot;30&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt; \t \t&lt;xsd:simpleType name=&quot;IndexType&quot;&gt; \t\t&lt;xsd:annotation&gt; \t\t\t&lt;xsd:documentation&gt;Int, 10 max&lt;\/xsd:documentation&gt; \t\t&lt;\/xsd:annotation&gt; \t\t&lt;xsd:restriction base=&quot;xsd:nonNegativeInteger&quot;&gt; \t\t\t&lt;xsd:totalDigits value=&quot;10&quot;\/&gt; \t\t&lt;\/xsd:restriction&gt; \t&lt;\/xsd:simpleType&gt;\t \t &lt;\/xsd:schema&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <strong>&lt;xsd:choice&gt;<\/strong> \u0432 CombinedType \u0441\u0445\u0435\u043c\u044b ComplexTypes.xsd. \u041e\u043d \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e xml-\u0444\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0442\u0438\u043f\u0430 Address, \u043b\u0438\u0431\u043e \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 Client.<\/p>\n<p>  <\/p>\n<h2>2. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Spring<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 spring-config.xml \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0438\u043d\u043e\u0432 Printer,<br \/>  FileReader, Marshaller, XMLService. \u041f\u043e\u043c\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u043d\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0444\u0438\u043b\u044c\u0442\u0440 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439<br \/>  FileNameExtensionFilter, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e xml-\u0444\u0430\u0439\u043b\u044b.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">spring-config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;             xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;             xmlns:util=&quot;http:\/\/www.springframework.org\/schema\/util&quot;             xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans          http:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.0.xsd          http:\/\/www.springframework.org\/schema\/util          http:\/\/www.springframework.org\/schema\/util\/spring-util-2.0.xsd&quot;&gt;  &lt;!-- Printer --&gt; &lt;bean id=&quot;printer&quot; class=&quot;com.xmlprocessor.service.impl.AnsiConsolePrinter&quot;\/&gt;  &lt;!-- FilenameExtensionFilter --&gt; &lt;bean id=&quot;filenameExtensionFilter&quot;class=                              &quot;com.xmlprocessor.util.FilenameExtensionFilter&quot;&gt;     &lt;constructor-arg index=&quot;0&quot;&gt;        &lt;list&gt;           &lt;value&gt;xml&lt;\/value&gt;        &lt;\/list&gt;    &lt;\/constructor-arg&gt; &lt;\/bean&gt;  &lt;!-- FileReader --&gt; &lt;bean id=&quot;fileReader&quot; class=&quot;com.xmlprocessor.service.impl.FileReader&quot;&gt;    &lt;property name=&quot;filenameFilter&quot; ref=&quot;filenameExtensionFilter&quot; \/&gt; &lt;\/bean&gt;  &lt;!-- Marshaller --&gt; &lt;bean id=&quot;marshaller&quot; class=&quot;org.springframework.oxm.jaxb.Jaxb2Marshaller&quot;&gt;    &lt;property name=&quot;classesToBeBound&quot;&gt;       &lt;list&gt;          &lt;value&gt;com.xmlprocessor.types.CombinedType&lt;\/value&gt;       &lt;\/list&gt;    &lt;\/property&gt;    &lt;property name=&quot;schemas&quot;&gt;       &lt;list&gt;          &lt;value&gt;xmlvalidator.xsd&lt;\/value&gt;          &lt;value&gt;complextypes.xsd&lt;\/value&gt;          &lt;value&gt;simpletypes.xsd&lt;\/value&gt;      &lt;\/list&gt;    &lt;\/property&gt;    &lt;property name=&quot;marshallerProperties&quot;&gt;       &lt;map&gt;         &lt;entry&gt;           &lt;key&gt;             &lt;util:constant static-field=                          &quot;javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT&quot;\/&gt;           &lt;\/key&gt;           &lt;value type=&quot;java.lang.Boolean&quot;&gt;true&lt;\/value&gt;         &lt;\/entry&gt;      &lt;\/map&gt;    &lt;\/property&gt; &lt;\/bean&gt;  &lt;!-- XmlService --&gt; &lt;bean id=&quot;xmlService&quot; class=&quot;com.xmlprocessor.service.impl.XmlService&quot;&gt;     &lt;property name=&quot;printer&quot; ref=&quot;printer&quot; \/&gt;     &lt;property name=&quot;marshaller&quot; ref=&quot;marshaller&quot; \/&gt;     &lt;property name=&quot;unmarshaller&quot; ref=&quot;marshaller&quot; \/&gt; &lt;\/bean&gt;  &lt;\/beans&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>3. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML-Java<\/h2>\n<p>  <\/p>\n<p>\u0412 \u0442\u043e\u0447\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f XmlProcessorDrv \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b<br \/>  \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0437\u0430\u0442\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043b\u0430\u0441\u0441\u0430 Compositor \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0438\u043d\u044b printer,<br \/>  fileReader \u0438 xmlService. \u0414\u0430\u043b\u0435\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c xml-\u0444\u0430\u0439\u043b\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432<br \/>  \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 CLI_OPTION_DIRECTORY.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <\/p>\n<pre><code class=\"java\">xmlService.validate(xmlFiles)<\/code><\/pre>\n<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">XmlProcessorDrv<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\"> package com.xmlprocessor.main;  import java.io.File; import java.util.List; import com.xmlprocessor.config.Compositor; import com.xmlprocessor.service.api.PrinterInt; import com.xmlprocessor.service.api.XmlServiceInt; import com.xmlprocessor.util.CommandLineArgs;  public class XmlProcessorDrv {    \/** Name of the program *\/    private static final String PROG_NAME = XmlProcessorDrv.class.getSimpleName();    \/** Version of the Program *\/    private static final String PROG_VERSION = &quot;1.0 (XmlProcessor v1.000)&quot;;    \/** Exit Status {@value} for OK. *\/    private static final int EXIT_STATUS_OK = 0;    \/** Exit Status {@value} for not OK. *\/    private static final int EXIT_STATUS_NOT_OK = -1;    \/**      * Main entry point.      * Evaluates command line args and validates provided xml files      *      * @param args      * Command line arguments  *\/   public static void main(String[] args) {         \/\/ execution status         int exitStatus;         \/\/ get printer object         PrinterInt printer = Compositor.getPrinter();         \/\/ read command line args         CommandLineArgs cmdLineArgs = new CommandLineArgs(args);         \/\/ Show version         if (cmdLineArgs.hasOption(CommandLineArgs.CLI_OPTION_VERSION)) {            printer.printf(&quot;%s v%s\\n&quot;, PROG_NAME, PROG_VERSION);         }         \/\/ Show help         if (cmdLineArgs.hasOption(CommandLineArgs.CLI_OPTION_HELP)) {            cmdLineArgs.printHelp(PROG_NAME);         }         \/\/ Check if the directory name is passed in args         if (!cmdLineArgs.hasOption(CommandLineArgs.CLI_OPTION_DIRECTORY)) {           cmdLineArgs.printHelp(PROG_NAME);           return;         }             String dir = cmdLineArgs.getOptionValue(CommandLineArgs.CLI_OPTION_DIRECTORY);        printer.printf(&quot;\\n%s %s&quot;,&quot;Folder with XML files: &quot;, dir);        List&lt;File&gt; xmlFiles;        XmlServiceInt xmlService = Compositor.getXmlService();        try {           xmlFiles = Compositor.getFileReader().readFiles(dir);           printer.bold(&quot;\\n\\nStart validating XML files:\\n&quot;);           xmlService.validate(xmlFiles);           exitStatus = EXIT_STATUS_OK;       } catch (Exception ex) {           printer.errorln(&quot;\\n&quot; + ex.getMessage());           exitStatus = EXIT_STATUS_NOT_OK;       }        System.exit(exitStatus);    } \/\/ main  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430 validate \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">XmlService.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">  ...  \/** {@inheritDoc} *\/  public void validate(List&lt;File&gt; xmlFiles) throws Exception {      int fileCount = xmlFiles.size();     File currentFile;     FileInputStream fileInputStream = null;     Source xmlFileSource;     CombinedType combinedType;     AddressType addressType;         for (int count = 0; count &lt; fileCount; count++) {       currentFile = xmlFiles.get(count);       printer.boldln(&quot;Current file: &quot;).println(currentFile.getPath());              try {          fileInputStream = new FileInputStream(currentFile);          xmlSource = new StreamSource(fileInputStream);                    combinedType = (CombinedType)unmarshaller.unmarshal(xmlSource);                    printer.boldln(&quot;Xml file [&quot; + currentFile.getName() + &quot;] validation success!\\n&quot;);          printer.boldln(&quot;Version: &quot;).println(combinedType.getVersion());          addressType = combinedType.getAddress();            if (addressType != null) {             printer.boldln(&quot;Address: &quot;).println(addressType.toString());          } else if (combinedType.getClients() != null) {             int i=0;              for (ClientType client : combinedType.getClients()) {                printer.boldln(&quot;Client&quot;).println(&quot;[&quot; + ++i + &quot;]&quot; +                client.toString());             }          }      } catch(Exception e) {        printer.fatalln(&quot;Xml file [&quot; + currentFile.getName() + &quot;] validation error: \\n&quot; + e.getMessage());     } finally {          if (fileInputStream != null) {             fileInputStream.close();          }     }  }   printer.boldln(&quot;Validating complete.&quot;); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML-Java \u0438\u043b\u0438 unmarshalling \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">combinedType = (CombinedType)unmarshaller.unmarshal(xmlSource); <\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u043b\u0438 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437 XML \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c java-\u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 CombinedType, \u0442\u043e<br \/>  XML \u043f\u0440\u0438\u0437\u043d\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p>Unmarshaller-\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u043b\u044f<br \/>  \u044d\u0442\u043e\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JAXB \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u044b AddressType.java, ClientType.java, CombinedType.java<br \/>  \u0412 IDE Eclipse: \u043f\u0440\u0430\u0432\u044b\u0439 \u043a\u043b\u0438\u043a \u043f\u043e XSD -&gt; <b>Generate -&gt; JAXB Classes\u2026<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5d\/xr\/0m\/5dxr0mj0ebgp7o0jwg9gcb9_mii.png\"\/>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">AddressType.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\"> package com.xmlprocessor.types; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; \/** * &lt;p&gt;Java class for AddressType complex type.&lt;\/p&gt; *\/ @SuppressWarnings(&quot;restriction&quot;) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = &quot;AddressType&quot;, propOrder = {  &quot;apartment&quot;,  &quot;street&quot;,  &quot;house&quot;,  &quot;city&quot;,  &quot;country&quot;,  &quot;index&quot; }) public class AddressType {    @XmlElement(name = &quot;Apartment&quot;, required = true)    protected Integer apartment;    @XmlElement(name = &quot;House&quot;, required = true)    protected BigInteger house;    @XmlElement(name = &quot;Street&quot;, required = true)    protected String street;    @XmlElement(name = &quot;City&quot;, required = true)    protected String city;    @XmlElement(name = &quot;Country&quot;, required = true)    protected String country;    @XmlElement(name = &quot;Index&quot;)    protected BigInteger index;    public Integer getApartment() {      return apartment;   }    public void setApartment(Integer value) {      this.apartment = value;   }   public String getStreet() {      return street;   }   public void setStreet(String value) {      this.street = value;   }   public BigInteger getHouse() {      return house;   }   public void setHouse(BigInteger value) {      this.house = value;   }   public String getCity() {      return city;   }   public void setCity(String value) {      this.city = value;   }   public String getCountry() {      return country;   }   public void setCountry(String value) {      this.country = value;   }   public BigInteger getIndex() {      return index;   }   public void setIndex(BigInteger value) {     this.index = value;   }   public boolean isSetIndex() {     return (this.index!= null);   }    @Override   public String toString() {      StringBuilder sb = new StringBuilder();      sb.append(&quot;\\nApartment#: &quot; + apartment);      sb.append(&quot;\\nHouse#: &quot; + house);      sb.append(&quot;\\nStreet: &quot; + street);      sb.append(&quot;\\nCity: &quot; + city);      sb.append(&quot;\\nCountry: &quot; + country);      if (this.isSetIndex()) {       sb.append(&quot;\\nIndex: &quot; + index);     }      return sb.toString();    } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ClientType.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\"> package com.xmlprocessor.types; import java.math.BigInteger; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @SuppressWarnings(&quot;restriction&quot;) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = &quot;ClientType&quot;, namespace = &quot;http:\/\/www.tempuri.org\/complextypes&quot;,      propOrder = {       &quot;id&quot;,       &quot;name&quot; }) public class ClientType {    @XmlElement(name = &quot;Id&quot;, required = true)    protected BigInteger id;    @XmlElement(name = &quot;Name&quot;, required = true)    protected String name;    public BigInteger getId() {       return id;    }    public void setId(BigInteger value) {       this.id = value;    }    public String getName() {       return name;    }    public void setName(String value) {       this.name = value;    }    @Override    public String toString() {       StringBuilder sb = new StringBuilder();       sb.append(&quot;\\nId: &quot; + id);       sb.append(&quot;\\nName: &quot; + name);       return sb.toString();    }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CombinedType.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\"> package com.xmlprocessor.types; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; \/** * &lt;p&gt;Java class for CombinedType complex type. *\/ @SuppressWarnings(&quot;restriction&quot;) @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = &quot;CombinedType&quot;, propOrder = {  &quot;version&quot;,  &quot;clients&quot;,  &quot;address&quot; }) @XmlRootElement(name = &quot;Combined&quot;, namespace = &quot;http:\/\/www.tempuri.org\/types&quot;) public class CombinedType {    @XmlElement(name = &quot;Version&quot;, required = true)    protected String version;    @XmlElement(name = &quot;Client&quot;)    protected List&lt;ClientType&gt; clients;    @XmlElement(name = &quot;Address&quot;)    protected AddressType address;    public String getVersion() {       return version;    }    public void setVersion(String value) {       this.version = value;    }    public List&lt;ClientType&gt; getClients() {       if (clients == null) {          clients = new ArrayList&lt;ClientType&gt;();       }       return this.clients;   }   public AddressType getAddress() {       return address;   }   public void setAddress(AddressType value) {       this.address = value;   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>4. \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0444\u0430\u0439\u043b Readme \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0446\u0438\u0439 \u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439<br \/>  \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">    XmlProcessor v1.0     Usage: java -jar XmlProcessorDrv [-d &lt;Dir&gt;] [-h] [-v]      -h,--help Display this help     -v Version of the program     -d &lt;Dir&gt; Folder with XML files to be validated      Example: java -jar xmlProcessor.jar --help -v -d &quot;C:\\\\XmlSample&quot; <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0437 cmd \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c jar, \u0432\u044b\u0437\u0432\u0430\u0432 Maven build package \u043d\u0430 pom.xml, \u0438 \u0432<br \/>  cmd \u0432\u0432\u0435\u0434\u0435\u043c \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">java -jar xmlProcessor.jar -h -v -d \u00abC:\\XmlSample\u00bb<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f C:\\XmlSample \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432\u0438\u0434\u0430 Address.xml \u0438<br \/>  Client.xml. \u0424\u0430\u0439\u043b\u044b \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c \u043d\u0435 xml \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2g\/ma\/qi\/2gmaqi3regyzwbwukmkk_aiv-30.png\"\/><\/p>\n<p>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u043f\u043e\u043b\u044f \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 SimpleTypes.xsd \u043f\u0440\u0435\u0434\u0435\u043b, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0443\u0437\u043b\u0430, \u0438\u0442\u0434. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u0430\u043a AApartment:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Address_with_error<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;     &lt;ns:Combined xmlns:ns=&quot;http:\/\/www.tempuri.org\/types&quot;&gt; \t&lt;Version&gt;V001.000.00&lt;\/Version&gt; \t&lt;Address&gt; \t\t&lt;AApartment&gt;50&lt;\/Apartment&gt; \t\t&lt;House&gt;7&lt;\/House&gt; \t\t&lt;Street&gt;Sadovaya&lt;\/Street&gt; \t\t&lt;City&gt;Saint Petersburg&lt;\/City&gt; \t\t&lt;Country&gt;Russia&lt;\/Country&gt; \t\t&lt;Index&gt;123456&lt;\/Index&gt; \t&lt;\/Address&gt;\t    &lt;\/ns:Combined&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ti\/wa\/g6\/tiwag6_kzv3irfdwoa3z-tfnel4.png\"\/><\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/495282\/\"> https:\/\/habr.com\/ru\/post\/495282\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/495282\/\">\n<h2>\u041e\u0431\u0437\u043e\u0440<\/h2>\n<p>  <\/p>\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435! \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 XML \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring Framework. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 web-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML-Java (unmarshalling) \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 XSD-\u0441\u0445\u0435\u043c\u0435. XML-\u0444\u0430\u0439\u043b \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 XML \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 Java \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 jar \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0414\u043b\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u043f\u0440\u0438\u043a\u0440\u0443\u0447\u0435\u043d Apache ANSI Printer, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0448\u0440\u0438\u0444\u0442, \u0446\u0432\u0435\u0442 \u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 cmd.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 GitHub \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/github.com\/alexk11\/XmlProcessor\">XmlProcessor<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-301183","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=301183"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/301183\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=301183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=301183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=301183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}