XML Validation in java for SQL injects and scripts

I have an input coming from xml file.

I have to read that input and validate the input against sql injections and scripts.

I require help now how to read this xml data and validate against the above two options.

I am a java developer.

in this context what is marshelling?

plz provide the help

[329 byte] By [satisataa] at [2007-11-27 7:27:14]
# 1

http://www.ibm.com/developerworks/library/x-javaxmlvalidapi.html?ca=dgr-lnxw07Java-XML-Val

http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/package-summary.html

The following code validates the xml against a xml schema

// define the type of schema - we use W3C:

String schemaLang = "http://www.w3.org/2001/XMLSchema";

SchemaFactory factory = SchemaFactory.newInstance(schemaLang);

Schema schema = factory.newSchema(new StreamSource("sample.xsd"));

Validator validator = schema.newValidator();

// at last perform validation:

validator.validate(new StreamSource("sample.xml"));

Message was edited by:

haishai

haishaia at 2007-7-12 19:07:38 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...