Com ctc wstx sr validating streamreader

08 Feb

Input Element Problem(Input Element at DTDValidator Report Validation Problem(DTDValidator at * See the License for the specific language governing permissions and * limitations under the License. * * NOTE: Since this method overrides the default implementation, make * sure you do NOT change the method signature. XMLInput Factory2; import org.codehaus.stax2.validation.*; import * @param bs Bootstrapper to use, for reading xml declaration etc.Like suggested in the answer to that question, I tried using woodstox by adding the woodstox 5.0.3 jar and the stax2 api 4.0.0 jar to my classpath (and adding the doctype with the system identifier to the XML) and got the expected exception: has no attribute "blah" at [row,col ]: [5,5] at Wstx Validation Exception.create(Wstx Validation at I was expecting the code below to fail with some validation-related stack trace, instead of printing all the element names in my file.

So here is the basic usage pattern for using Stax2 validation API on reader side.

And there you have it: simple validation of an xml document, against an Relax NG Schema.

The exact same procedure (except for getting a different schema validation factory in step 1) would work for other types, specifically for DTDs.

This method returns after either the number of characters specified by the Universal Windows Platform Available since 8 .

NET Framework Available since 1.1 Portable Class Library Supported in: portable .