W
W
web_dev2015-07-04 12:56:55
Java
web_dev, 2015-07-04 12:56:55

Xml validation - all optional attributes?

Hello,
please tell me if it is possible and if possible, how to register in xsd so that xml does not check attributes during validation.
In one case, they may not be in the other, and not all attributes are known in advance, so that each one should be written in "optional". Therefore, I want to check only the presence of the necessary tags, and not attributes either.

schema = factory.newSchema(new StreamSource(xsdFileInputStream));
            Validator validator = schema.newValidator();
            validator.validate(new StreamSource(new StringReader(xmlString)));

I can't find how to do it.
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question