Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2004

Tip: Looking for answers? Try searching our database.

HOWTO: Use custom XML schemas with VS.NET 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christoph Nahr - 17 May 2004 10:58 GMT
I'm currently writing my own mini-XAML for Windows Forms, and
encountered some hiccups when trying to make Visual Studio .NET 2003
recognize the XML schema I've created for the control template files.

The limitations of the IDE's schema support are rather severe and
completely undocumented, as far as I'm aware, so I decided to write up
a few paragraphs about my experience.  Feel free to add more
information or corrections!

 Using XML Schemas with Microsoft Visual Studio .NET 2003
 ========================================================

 Visual Studio supports schema validation and schema-based
 IntelliSense while editing XML files, but this feature is
 somewhat broken. To make it work, follow these steps:

 1. Do NOT qualify the target namespace in the xsd:schema
    element. Use an unqualified xmlns declaration, or VS
    will not find the elements defined by the schema.

 2. Do NOT use xsd:extension with complex types. VS does
    not support inheritance of elements and attributes.
    Use group and attributeGroup declarations instead,
    and chain them using the ref attribute.

 3. Copy the schema to <VS>\Common7\Packages\schemas\xml,
    or add it to the project that contains your XML files.
    Adding the schema as a solution item is NOT enough.
   
 And a final note that is unrelated to schemas: the Data
 view will NOT work with your XML files unless they are
 extremely simple, because that view is easily confused.
Signature

http://www.kynosarges.de

Dan - 30 May 2004 08:56 GMT
Christoph, when the VS 2005 beta comes out, or if you're an MSDN subscriber
and get hold of a copy of a Community Preview of it before then, could you
give the XML editor in it a workout? The reason I ask is that the XML editor
in VS 2003 has a number of limitations, and in VS 2005 it has been
completely re-written and (based on my use of it) vastly improved. The
deficiences you list below, for example, should be corrected. Having folks
like you who are passionate and knowledgeable about the XML/XSD/XSL
editor/debugger check it out and give us beta feedback will help us fix the
last issues and ship a far better product.

Thanks in advance,
Dan [MS] danmose@remove.this.bit.microsoft.com

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.

> I'm currently writing my own mini-XAML for Windows Forms, and
> encountered some hiccups when trying to make Visual Studio .NET 2003
[quoted text clipped - 28 lines]
>   view will NOT work with your XML files unless they are
>   extremely simple, because that view is easily confused.
Christoph Nahr - 30 May 2004 12:24 GMT
Thanks Dan, I'll be sure to try out VS 2005 as soon as I gather enough
courage to install the preview on my system! :-)

I'm an MSDN subscriber but the caveats on the first preview sounded
rather scary so I decided no to install it for the moment.  Haven't
looked at the latest preview, though.

Maybe it's time to install Virtual PC, I've heard that should insulate
the rest of the system from any ill effects...

>Christoph, when the VS 2005 beta comes out, or if you're an MSDN subscriber
>and get hold of a copy of a Community Preview of it before then, could you
[quoted text clipped - 8 lines]
>Thanks in advance,
>Dan [MS] danmose@remove.this.bit.microsoft.com

Signature

http://www.kynosarges.de

Christoph Nahr - 30 May 2004 12:31 GMT
While I'm at it, I found another issue: the XML editor does not
support attribute lists, such as Anchor="Left Top".

This will validate fine if the attribute type is an xsd:list of an
xsd:enumeration type but the editor will show its wiggly red line.
Signature

http://www.kynosarges.de


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.