XML Schema Validation - Windows Phone

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,

I need to validate an XML file against a schema, both downloaded into the isolated storage of my Windows Phone application.
The standard libraries dont seem to work, they lack methods in compact framewoek apparently.
Ive already tried this:
<pre style="border-style:initial; border-color:initial; font-family:inherit; outline-width:0px; outline-style:initial; outline-color:initial; border-width:initial; list-style-type:none; word-wrap:break-word; text-align:left; font-size:13px; line-height:16px XmlReaderSettings xrs = <span style="border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; font-style:inherit; font-family:inherit; margin-bottom:0px; outline-style:initial; outline-color:initial; padding-bottom:0px new XmlReaderSettings();
xrs.Schemas.Add(<span style="border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; font-style:inherit; font-family:inherit; margin-bottom:0px; outline-style:initial; outline-color:initial; padding-bottom:0px "urn:namespace", <span style="border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; font-style:inherit; font-family:inherit; margin-bottom:0px; outline-style:initial; outline-color:initial; padding-bottom:0px "schema.xsd");
xrs.ValidationType = ValidationType.Schema;
XmlReader reader = XmlReader.Create(<span style="border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; font-style:inherit; font-family:inherit; margin-bottom:0px; outline-style:initial; outline-color:initial; padding-bottom:0px "file.xml", xrs);
<span style="border-top-width:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; font-style:inherit; font-family:inherit; margin-bottom:0px; outline-style:initial; outline-color:initial; padding-bottom:0px while (reader.Read()) { [/code]
but no good ..

Is there any way i can validate my XML file ...

Thanks,
Saad.


View the full article
 
Back
Top