I am thinking of embedding my schemas as embedded resources instead of
reading it using URI at run-time.
I came across some snags while trying to do just that such as, previously
unknown to me, XmlValidatingRe ader.Schemas.Ad d was using
XmlValidatingRe ader.Resolver to resolve my schemas using the URI method.
Resolver property was never set, so the reader simply ignored any external
references even though one of the schema explicitly imports the other one.
I verified this by removing the referred schema from the schema collection,
and the code chugged along fine.
But when I changed the code to read schemas from the assembly, a couple of
things happened:
1. It became important that I add schemas in a certain order; that is add
the one that is being referred first, so that the one that is referring can
find it later.
2. Apparently Resolver property is not used since all the schemas are loaded
from the assembly; No parser context with XmlNamespaceMan ager was necessary
contrary to my initial assumption.
My question is then to confirm that #2 is indeed correct and also, whether I
should be specifying a Resolver were I to use file based schema addition.
Thanks very much.
Jiho
reading it using URI at run-time.
I came across some snags while trying to do just that such as, previously
unknown to me, XmlValidatingRe ader.Schemas.Ad d was using
XmlValidatingRe ader.Resolver to resolve my schemas using the URI method.
Resolver property was never set, so the reader simply ignored any external
references even though one of the schema explicitly imports the other one.
I verified this by removing the referred schema from the schema collection,
and the code chugged along fine.
But when I changed the code to read schemas from the assembly, a couple of
things happened:
1. It became important that I add schemas in a certain order; that is add
the one that is being referred first, so that the one that is referring can
find it later.
2. Apparently Resolver property is not used since all the schemas are loaded
from the assembly; No parser context with XmlNamespaceMan ager was necessary
contrary to my initial assumption.
My question is then to confirm that #2 is indeed correct and also, whether I
should be specifying a Resolver were I to use file based schema addition.
Thanks very much.
Jiho
Comment