For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > September 2004 > Bug in VS XML Editor?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Bug in VS XML Editor?
Arturo

2004-08-12, 4:07 pm

Hello everybody. Can anybody could confirm if this is a bug???

If I create the schema:
-----------------------
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="MySchema"
targetNamespace="http://tempuri.org/MySchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/MySchema.xsd"
xmlns:mstns="http://tempuri.org/MySchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="MyElement">
<xs:complexType>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

And the file
------------
<?xml version="1.0" encoding="utf-8" ?>
<mySchema:MyElement xmlns:mySchema="http://tempuri.org/MySchema.xsd">
<Something>This is something and should be allowed</Something>
</MyElement>

Visual Studio says (in the XML editor) "The active schema does not
support the element 'Something'."

Is this a bug? What I am doing wrong?


Thanks!
Chris Lovett

2004-09-27, 3:57 am

I get the following (correct) errors in Visual Studio 2005:

Error 1 Tag was not closed. C:\Documents and Settings\clovett\My
Documents\Visual Studio\Projects\XMLFile1.xml 2 2
Error 2 Expecting end tag </mySchema:MyElement>. C:\Documents and
Settings\clovett\My Documents\Visual Studio\Projects\XMLFile1.xml 4 5
Warning 3 The 'Something' element is not declared. C:\Documents and
Settings\clovett\My Documents\Visual Studio\Projects\XMLFile1.xml 3 4

The validation error is just a warning, and if you change the following in
your schema, this warning goes away.

<xs:any processContents="skip" />


Chris.


"Arturo" <arturo-g@lycos.com> wrote in message
news:e1a45d36.0408120608.32a58919@posting.google.com...
> Hello everybody. Can anybody could confirm if this is a bug???
>
> If I create the schema:
> -----------------------
> <?xml version="1.0" encoding="utf-8" ?>
> <xs:schema id="MySchema"
> targetNamespace="http://tempuri.org/MySchema.xsd"
> elementFormDefault="qualified"
> xmlns="http://tempuri.org/MySchema.xsd"
> xmlns:mstns="http://tempuri.org/MySchema.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <xs:element name="MyElement">
> <xs:complexType>
> <xs:sequence>
> <xs:any />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> And the file
> ------------
> <?xml version="1.0" encoding="utf-8" ?>
> <mySchema:MyElement xmlns:mySchema="http://tempuri.org/MySchema.xsd">
> <Something>This is something and should be allowed</Something>
> </MyElement>
>
> Visual Studio says (in the XML editor) "The active schema does not
> support the element 'Something'."
>
> Is this a bug? What I am doing wrong?
>
>
> Thanks!



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com