Validates the XML, printing error messages when the XML is invalid. Note
that this method will properly validate any instance of a compiled schema
type because all of these types extend XmlObject.
Note that in actual practice, you'll probably want to use an assertion
when validating if you want to ensure that your code doesn't pass along
invalid XML. This sample prints the generated XML whether or not it's
valid so that you can see the result in both cases.
Parameters: xml - The XML to validate. true if the XML is valid; otherwise, false |