is it possible to validate xml via xsd with no sequence and ignoring extra tags

StackOverflow https://stackoverflow.com/questions/16469986

  •  21-04-2022
  •  | 
  •  

Вопрос

how to validate xml using xsd without sequence and if any unknown or extra tag is present then that should be skipped(no validation error should be thrown). But for the tags which is present in xsd I should be able to check max,min occurrence and validate them with data type and length etc. any hint?

Это было полезно?

Решение 2

Instead of using ANY with different namespace which I thought wont be that much successful in my case. Also solution look like a workaround. I thought of using XSL transformation and prepare the xml in which my XSD would like to parse the file. If any incorrect file is sent then new xml created using xsl transformation would also fail validation.

Другие советы

How about using "Any" tag with different namespace .

Please refer to this thread XSD any element

http://www.w3schools.com/schema/schema_complex_any.asp

Hope you find this useful

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top