Validating xml string
A schema is analogous to a grammar for a language; a schema defines what the vocabulary for the language may be and what a valid "sentence" is.
There are historic and current XML schema languages: The main ones (see also the ISO 19757's endorsed languages) are described below.
Validation of an instance document against a schema can be regarded as a conceptually separate operation from XML parsing.
In practice, however, many schema validators are integrated with an XML parser.
This may be by mapping the XSD-defined types to types in a programming language such as Java ("data binding") or by enriching the type system of XML processing languages such as XSLT and XQuery (known as "schema-awareness").
This means which elements can reside in which other elements, which attributes are and are not legal to have on a particular element, and so forth.RELAX NG has no ability to apply default attribute data to an element's list of attributes (i.e., changing the XML info set), while W3C XML Schema does.Again, this design is intentional and is to separate validation and augmentation.The association may be achieved via markup within the XML document itself, or via some external means.The process of checking to see if a XML document conforms to a schema is called validation, which is separate from XML's core concept of syntactic well-formedness.
For WXS validators that will follow a URI to an arbitrary online location, there is the potential for reading something malicious from the other side of the stream.