Expert Texture Home Contact me About Subscribe Digipede Connect on LinkedIn rwandering on Twitter rwandering on FriendFeed

rwandering.net

The blogged wandering of Robert W. Anderson

XML Intellisense in VS2005

When I was at , I was talking to Faisal Mohamood about performing distributed builds on the Digipede Network.  I had a question about Intellisense in VS2005 and he said something like “Really?  That should just work”.

Finally I have gotten to sit down and spend a few focused minutes on this Intellisense issue.  Our XSD works great in VS2003, but not in VS2005.  Lots of warnings that look like this:

Type ‘x’ is not declared in namespace ‘y’.

I made the assumption that the VS2003 schema was actually valid; but it turns out that it wasn’t.  Strangely enough, it appears that VS2003 is much more forgiving about errors in XSD than VS2005 is.  I’m happy to say that the XML validation features of VS2005 told me what was wrong with the schema and it was easy to fix.

Note: our original schema had been created using xsd.exe from a class library.   I had to tweak some things in it by hand, but basically VS2003 accepted it as it was generated.  Oddly, it had several problems in it.  The most major one (and the cause of the problem above) is that there were many top-level element nodes that should have been complexType nodes.  It seemed kind of arbitrary whether types were defined or not.  So, don’t trust xsd.exe for creating valid XSD.

Tags: ,

    Trackback

No comments yet »

Your comment

HTML-Tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>