XML : Quick way SqlXml to XmlDocument in C#?

Which is better way to load SqlXml into XmlDocument (if any) without intermediate string?

I need to validate xml using xsd from database inside CLR UDF. I try to optimize my code.

My code is:

          schema1 = XmlSchema.Read(new StringReader(cXmlSchemaText), ValidateSchema);            asset1.Schemas.Add(schema1);          asset1.LoadXml(ValueString.ToString());          asset1.Validate(ValidateXmlValue);    

where ValueString is my SqlXml.

No comments:

Post a Comment