Conceptual: VS 2008 XML Editor IntelliSense is Broken

Apr 16, 2008 at 10:19 AM
Hi everyone,

Just wondering if anyone else can repro this issue.

When I open a MAML topic in the Visual Studio 2008 XML editor I don't get any IntelliSense unless I first delete xmlns:xlink="http://www.w3.org/1999/xlink" from the root MAML element. After the namespace declaration is removed IntelliSense beings to work.

Then, if I add a <link /> element, the IntelliSense list shows an a:href attribute; when selected it serializes a:href="" xmlns:a="http://www.w3.org/1999/xlink". That's fine, although since the xlink namespace is declared in the document again, IntelliSense no longer works (anywhere) until the xmlns:a attribute is removed.

I'm not sure if it's a VS 2008 issue or a MAML schema issue.

Thanks,
Dave

P.S., I'm having major trouble with my Internet connection so I may not be able to respond for a while, but I will as soon as I can :|
Apr 17, 2008 at 2:35 AM
I can reproduce it. I have not being using the VS 2008 so just tested it and found the problem.

This is a quick work around, still looking for a better fix:

  • In the Properties Windows of the document, click the Schemas to display the XML Schemas dialog
  • Scroll down to the http://www.w3.org/1999/xlinkTarget Namespace.
  • You will find that both the default and the conceptual links are checked, this is the problem.
  • Set the default http://www.w3.org/1999/xlink to Automatic
  • Also, there is same problem with Target Namespacehttp://www.w3.org/XML/1998/namespace
  • Again, set the default http://www.w3.org/XML/1998/namespace to Automatic

It should now work as in the VS 2005. I am investigating how to automatically set these options.

Best regards,
Paul.
Apr 17, 2008 at 4:27 AM
Thanks. Nice work Paul. :)

The only problem is that it has to be done manually for every file, as I'm sure that you're already aware. Also, the change doesn't seem to stick when the project's reloaded :(

In the mean time I've just been adding an underscore character in front of xmlns:xlink when I need IntelliSense and then I remove the underscore before saving the file. Annoying? Yep! But it's quick and easy, and if I forget to remove the underscore then Build Assembler lets me know...

Please post if you find another workaround and I'll do the same.

Thanks,
Dave
Apr 17, 2008 at 5:33 AM

davedev wrote:
Also, the change doesn't seem to stick when the project's reloaded :(


Mine does. Otherwise, the whole idea of users adding their schema will be useless.


davedev wrote:
Please post if you find another workaround and I'll do the same.

I will, just that there is nothing yet!

I just to do understand why the MAML developers set their extension schema target
namespace to the standard namespace, http://www.w3.org/1999/xlink. Unlike the VS 2005,
the VS 2008 is loading both the standard and the MAML version, and it is finding it
difficult to decide which comes first - i.e. currently, my understanding of the problem.

Best regards,
Paul.
Apr 17, 2008 at 12:10 PM
Hi Paul,

Yea, it would be useless then. But I can assure you that when I tried it didn't work!

I just tried again though, making sure that all instances of VS were closed, and then it did work. I have a feeling that it didn't work the first time because I hadn't close the first instance of VS before opening another one, so VS never persisted my changes.

- Dave
Apr 18, 2008 at 1:23 AM

davedev wrote:
Yea, it would be useless then. But I can assure you that when I tried it didn't work!


Today, I have again open that project in VS.NET 2008, and the changes are still there.
There are two files in that project. For one file I have made change as stated earlier but
for the other file there is no change, and information was saved by the IDE.

Did you forget to click OK in the XML Schema dialog? Sorry to ask. :)

Best regards,
Paul.
Apr 18, 2008 at 3:06 AM
Hi Paul,

No, I'm sure that it was because of what I stated already - I hadn't closed the first instance of VS when I opened the second. I was able to reproduce this behavior, so apparently the IDE doesn't save these types of changes until VS is shutdown.

- Dave
May 29, 2008 at 11:09 AM
Edited May 29, 2008 at 11:13 AM
Hi everyone,

To fix this problem indefinitely, use the global schema cache for all of the schemas, excluding space.xsd, and be sure to update the developerStructure.xsd file by changing the import for space.xsd to use Visual Studio's xml.xsd file instead.  (Note that xlink.xsd is still required and should be included in the schemas cache folder.  As long as the space.xsd problem has been fixed it seems to work, but without it IntelliSense doesn't work since xlink:href will be undefined.)

I implemented this by copying all of the MAML schemas, except for space.xsd, into a subfolder named MAML under VS's schema cache, Xml\Schemas.  I then updated developerStructure.xsd as noted above by using ../xml.xsd as the path.  Then I updated the root catalog.xml file by including:  <Catalog href="MAML\catalog.xml"/>

Here's the contents of the catalog.xml file that I added to the MAML folder: 

<SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog">
  <!-- Schemas for MAML -->
  
  <!-- Place the MAML schemas and this file in a subfolder named MAML 
       in Visual Studio's Xml\Schemas folder. -->
  <!-- Do not include space.xsd -->
  <!-- Make sure that the reference to space.xsd is changed to ../xml.xsd
       in the developerStructure.xsd file -->
  <!-- Update VS's root catalog.xml file by adding <Catalog href="MAML\catalog.xml"/> -->
  
  <Schema href="%InstallRoot%/xml/schemas/MAML/base.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/baseConditional.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/block.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/blockCommon.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/blockSoftware.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/conditionSet.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/developer.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/developerReference.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/developerStructure.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/glossary.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/hierarchy.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/inline.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/inlineCommon.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/inlineLinking.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/inlineSoftware.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/inlineUi.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/structure.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/structureList.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/structureMedia.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/structureProcedure.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
  <Schema href="%InstallRoot%/xml/schemas/MAML/structureTable.xsd"
          targetNamespace="http://ddue.schemas.microsoft.com/authoring/2003/5"/>
</SchemaCatalog>
- Dave