IntelliSense VB Xml Letters

Is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)? The ideal IntelliSense source is an XSD document, but I can use any other format for this.

thank

+2


source to share


2 answers


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

It works, I used it a few months ago. If you have the VS2k8 Docmentation component installed, go to How to: Enable XML IntelliSense in Visual Basic in ms-help://MS.MSDNQTR.v90.en/dv_vbalr/html/af67d0ee-a4a6-4abf-9c07-5a8cfe80d111.htm

, it has the example you need for this to work. Online documentation not available.

  • How to use LINQ to XML
  • How to enable XML IntelliSense in Visual Basic
  • Shows how to add XML Schema to a Visual Basic project to provide XML IntelliSense that shows possible attributes, child elements, or child elements for XML literals .

Excerpt

To import an XML namespace into a code file Define a 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 the XML namespace as the default namespace, that is, the namespace that applies to XML elements and attributes that do not have a namespace prefix, add an Imports statement for the default target XML namespace. Do not include 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">

      

+3


source


I haven't seen any way to do this. Please rate or comment on this proposal on the Microsoft Connect site.



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

+1


source







All Articles