D
D
DR_Demons2015-02-22 01:02:17
Java
DR_Demons, 2015-02-22 01:02:17

How to make validation of changing Xml on Xsd Java?

Good day! I am learning java and the next task is

xml file
<result xmlns="http://foobar.com">
<code>OK</code>
<books>
<book>
  <bookId>ISBN01213209</bookId>
  <author>Scott Mayers</author>
  <title>Effective C++</title>
  <cover>effective-cpp.png</cover>
</book>
<book>
  <bookId>ISBN0993209</bookId>
  <author>Joshua Bloch</author>
  <title>Effective Java</title>
  <cover>effective-java.png</cover>
</book>
</books>
</result>
and it needs to be validated against the xsd schema, but the problem is that it expands when new books are added. Therefore, this is either a very large xsd that describes all subsequent changes, but this option does not seem very successful.
How to do validation in this case?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
protven, 2015-02-23
@DR_Demons

What is the problem ? Generate .xsd from your xml using any online tool . Well, then you do the actual validation. Here, for example, is a banal example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question