Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - RE: Xml validation fails if connected to the internet [Thread Next] Re: Xml validation fails if connected to the internetTo: NULL Date: 10/10/2006 10:06:00 PM
That is exactly what is going on this is not the feature of VB but the
System.XML. XSD imports and includes are hints not requirements. If they can
resolved then the schema engine will try to compile those references to if
there are conflicts etc you will see these kinds of errors only when
connected to the net.
--
Regards,
- Umut Alev [MSFT]
This email sent from a machine running Vista RC1.
"George" <George@d...> wrote in message
news:1C017009-2E7B-4775-B4A2-D2E45ED3FB19@m......
> Hello,
>
> I dont import anything from the xml file. As i quoted in my first post, i
> have imports in the xsd files that the schemalocation point to web
> location.
> eg
> <xsd:import namespace="http://www.xbrl.org/2003/instance"
>> > schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
>
> However, when i run it without being online itworks. If i get connected it
> fails . Is there any mechanism in vb2005 that checks that if you are
> online
> then ignore the schemaset(i load all 17 xsd files int othe schemaset),
> otherwise, if not online then use the loaded xsd files.
>
> Thank you
> George
>
> "S. Huseyin Ulger" wrote:
>
>> Do you have any imports that references to internet address?
>>
>> --
>> S. Huseyin Ulger [MSFT]
>> MSXML Dev
>>
>>
>> "George" wrote:
>>
>> > Hello,
>> >
>> > I have manageg to create a validator, to validate an xml file with
>> > multiple
>> > schemas(17 xsd files). I have 4 xsd files that are simple. One other
>> > xsd file
>> > imports another xsd file directly from the file. for example,
>> >
>> > <xsd:import namespace="http://www.xbrl.org/2003/instance"
>> > schemaLocation="http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd"/>
>> > <xsd:import
>> > namespace="http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/p-me-2006-07-01"
>> > schemaLocation="p-me-2006-07-01.xsd"/>
>> >
>> > The "p-me" schema file imports another xsd file and so on. So i have
>> > like a
>> > tree of xsd files. The problem is, when i try to run my program without
>> > being
>> > on the internet, it runs perfectly. However, when i try to run it when
>> > being
>> > on the internet, it fails , saying duplicate declarations.
>> >
>> > In my program, (visual studio 2005 vb) , i am using a xmlschemaset in
>> > which
>> > i load all of the files that are declared in the xmlns:___... part of
>> > the
>> > instance. ie
>> >
>> > sc.Add("http://www.xbrl.org/2003/instance",
>> > "C:\xbrl\COREPTaxonomy1.2\xbrl-instance-2003-12-31.xsd")
>> >
>> > I then use the following code , before i start reading the xml.
>> >
>> > Dim settings As XmlReaderSettings = New XmlReaderSettings()
>> > settings.IgnoreWhitespace = True
>> > settings.IgnoreComments = True
>> > settings.Schemas = sc
>> > settings.ProhibitDtd = False
>> > settings.ValidationFlags =
>> > XmlSchemaValidationFlags.ReportValidationWarnings
>> > settings.ValidationFlags =
>> > XmlSchemaValidationFlags.ProcessSchemaLocation
>> > settings.ValidationFlags =
>> > XmlSchemaValidationFlags.AllowXmlAttributes
>> > settings.ValidationType = ValidationType.Schema
>> > 'MKR_SA_EQU_instance.xml
>> > AddHandler settings.ValidationEventHandler, AddressOf
>> > SchemaValidationEventHandler
>> >
>> > Dim reader As XmlReader =
>> > XmlReader.Create("C:\xbrl\COREPTaxonomy1.2\MKR_SA_EQU_instance.xml",
>> > settings)
>> >
>> > Dim manager As XmlNamespaceManager = New
>> > XmlNamespaceManager(reader.NameTable)
>> > manager.AddNamespace("d-mr",
>> > "http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01")
>> > manager.AddNamespace("d-ty",
>> > "http://www.c-ebs.org/eu/fr/esrs/corep/2006-07-01/d-mr-2006-07-01")
>> > manager.AddNamespace("iso4217",
>> > "http://www.xbrl.org/2003/iso4217")
>> > Dim validator As XmlSchemaValidator = New
>> > XmlSchemaValidator(reader.NameTable, sc, manager,
>> > settings.ValidationFlags)
>> > (SchemaValidationEventHandler)
>> > validator.Initialize()
>> > AddHandler validator.ValidationEventHandler, AddressOf
>> > SchemaValidationEventHandler
>> >
>> > I then use , while reader.read
>> > 'do validations
>> > end while
>> >
>> > Can anybody help ?
>> > Thank you
>> > George
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
