TcKs
TcKs

Reputation: 26632

IntelliSense in VB Xml literals

is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)? The ideal source of IntelliSense is an XSD document, but I can use anything else format to do it.

Thanks

Upvotes: 2

Views: 1070

Answers (2)

AMissico
AMissico

Reputation: 21684

http://msdn.microsoft.com/en-us/library/bb531402.aspx

It works, I used it a few months back. If you have VS2k8 Docmentation installed, go to How to: Enable XML IntelliSense in Visual Basic at ms-help://MS.MSDNQTR.v90.en/dv_vbalr/html/af67d0ee-a4a6-4abf-9c07-5a8cfe80d111.htm, it has the example you need to get this working. The on-line documentation is lacking.

  • How to Use LINQ to XML
  • How to: Enable XML IntelliSense in Visual Basic
  • Shows how to add an XML schema to a Visual Basic project to provide XML IntelliSense that shows possible attributes, child elements, or descendant elements for XML literals.

Excerpt

To import an XML namespace in a code file Identify the target namespace from your XSD schema.

At the beginning of the code file, add an Imports statement for the target XML namespace, as shown in the following example.

Imports <xmlns:ns="http://someNamespace">

To import an XML namespace as the default namespace, that is, the namespace that is applied to XML elements and attributes that do not have a namespace prefix, add an Imports statement for the target default XML namespace. Do not specify a namespace prefix. Following is an example of an Imports statement.

Dim phone2 As XElement = <phone type="home">206-555-0144</phone>
phone2.@owner = "Harris, Phyllis"

Console.WriteLine(phone2)

'Imports <xmlns="http://defaultNamespace">

Upvotes: 3

CoderDennis
CoderDennis

Reputation: 13837

I haven't seen any way of doing this. Please go rate or comment on this suggestion on the Microsoft Connect site.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=490740

Upvotes: 1

Related Questions