Re: XmlValidatingReader memory behaviour



You can add all your schemas to an XmlSchemaCollection and then re-use this
schema collection with multiple XmlValidatingReaders that are created over
your multiple XML documents. This will ensure that the schemas are compiled
only once.

Thanks,
Priya

"Paul Hatcher" <phatcher@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23cnymSuNFHA.1040@xxxxxxxxxxxxxxxxxxxxxxx
> I need to validate a number of different XML documents against the same
> schema, but the behaviour of XmlValidatingReader seems to make this very
> expensive in memory terms.
>
> We loaded about 150 XML files via XmlDocument.Load, which took around
about
> 3Mb of allocations, but the XmlValidatingReader added another 69Mb of
> allocations during Schema.Add
>
> What would be nice is if you could create a validating reader and assign
the
> schema and then have it process multiple XML documents; currently the
reader
> has to be passed in via the constructor so you can't re-use the internal
> schema set up that's expensive in memory terms.
>
> Paul
>
>


.



Relevant Pages

  • XmlValidatingReader memory behaviour
    ... I need to validate a number of different XML documents against the same ... but the behaviour of XmlValidatingReader seems to make this very ... schema and then have it process multiple XML documents; ... schema set up that's expensive in memory terms. ...
    (microsoft.public.dotnet.xml)
  • Re: XML Schema: inheritance with variable order of childs
    ... And the human editors of the xml files are ... If your editors are techies, ... XML documents, and try to design a 'loose' schema for their ... I mean using a more powerful schema definition language. ...
    (comp.text.xml)
  • No rows in dataset when reading in xml?
    ... I am trying to read in an xml schema and then an xml ... I read in a couple of places that validation failing against the schema ... private static XmlValidatingReader GetReader (string schemaPath, ... XmlTextReader schemaReader = new XmlTextReader; ...
    (microsoft.public.dotnet.xml)
  • xmlValidatingReader doesnt raise validation exception using strea
    ... Schema ... The same data does not cause a validation exception to be raised by the ... xmlValidatingReader when it encounters a string where it expects a boolean. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Bulk Load schema problems
    ... race and a relationship between race and pilot_results ... "Luciano Pagliarini" wrote in ... >> using xml bulk load and defining xsd schema. ... >> for 500 xml documents about 50kb each one, ...
    (microsoft.public.sqlserver.xml)

Quantcast