IntelliSense in VB Xml literals - vb.net

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

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">

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

Related

how to use addXmlBody?

May I get any sample codes of restsharp using .addXmlBody? and I'd like to know if I can remove xml namespace when I use .addXmlBody?
actually, I'm new to the restsharp. so I totally have no idea how to use xml request.appreciate it any inputs from you.

Is OfficeOpenXML required or not

I am confused by the statement
"EPPlus is a .NET library that reads and writes Excel files using the Office Open XML format (xlsx). EPPlus has no dependencies other than .NET. "
then the following statement:
"The first thing you do is to create an instance to the ExcelPackage class. To do that you first need to add a using directive to OfficeOpenXml namespace in the top of your file. This is the top namespace in EPPlus;
using OfficeOpenXml;"
so, should I always import OfficeOpenXml? The datatable to spreadsheet code works fine without it...
Thanks
Those two statements aren't contradictory. EPPlus doesn't require anything other than .NET to run. And the "OfficeOpenXml" namespace is part of EPPlus.
"ExcelPackage" is a class in the "OfficeOpenXml" namespace, so you could use a "using OfficeOpenXml" or you could fully qualify it as "OfficeOpenXml.ExcelPackage".

How to import .XML code style into IntelliJ Idea 15

I want to use a specific code style in my editor defined in an XML file, which looks something like this:
<code_scheme name="CustomStyleName">
<option name="JAVA_INDENT_OPTIONS">
<value>
...
How is it possible to import this style into IntelliJ Idea.
When I go to Preferences->Editor->Code Style->Manage it is only possible to import an Eclipse XML Profile.
If your XML is previously exported Intellij you can simply do:
File > Import Settings > select your xml
If its custom defined, one you can try copying your xml to intellij config directory:
config/codestyles
Assuming your xml is in format intellij can understand, it will then show up in
Code Styles > Manage
If your XML is in different format, try to match tags with one of pre-defined styles(also XML)
For users coming here for the same issue but recent IntelliJ version (like 20), it is a bit different now.
Once you've exported your formatter in XML, then follow these steps:
Go to Preferences
Select Editor
Sele Code Style
Select the language of your choice (eg Java)
Go to Scheme at the top, click on the setting button by the side
Select the option to import scheme, choose your formatter type and select the xml file. Then save and apply.
If you see error "IntelliJ IDEA code style XML import failed with error message: null", check to ensure your XML file has the file definition <?xml version="1.0" encoding="UTF-8"?> at the top.
NOTE: This is for MacBook. I believe the difference won't be much in other platforms.

How to rename a method name from Intellisense?

Does anyone know how? I'm trying to make a method that the intellisense shows another name instead of the name you ta the method. example:
The code looks like this:
Public Shared Sub Anything(ByVal blablabla....)
(...)
End Sub
And I want to auto-complete the VisualStudio menu be like:
Async
Alalala
Anymethod
Anything - Like these
Basic
On mouse hover:
instead of...
Public Shared Sub Namespace.Anything(ByVal blablablbal....)
This is the summary...
put it:
Anything <expression>
This is the summary...
-or-
Sub Anything
This is the summary...
Any ideas? thx...
I believe you're talking about XML Comments. Without comments:
With comments:
And Intellisense then also displays the parameter information as you get to each parameter:
Sooooo, I hope my answer isn't too vague. I'd love to help you igure it out either way.
Basically - you have to override the XML Documentation that Intellisense uses, in order to MAP a new MethodName to a Differently-Named method within your assembly.
Intellisense uses an XML Skeleton to define the different properties of what you see. That Skeleton typically looks something like this:
<CodeElement type="Function">
<Template>
<summary/>
<param/>
<returns/>
<remarks/>
</Template>
<CompletionList>
<exception cref=""/>
<include file="" path=""/>
<param name=""/>
<remarks/>
<returns/>
<summary/>
</CompletionList>
</CodeElement>
You can use this template to generate the Intellisense data you're looking for. In real-life application, this would look something like this:
''' <summary>
'''
''' </summary>
''' <param name="str"></praram>
''' <returns></returns>
''' <remarks></remarks>
Function Anything(ByVal str As String) As String
Try
...
Now, this template is Editable
The Visual Basic compiler generates an XML document for your assembly with all the XML comments defined in the code. The compiler will also resolve symbols used in cref, permission, and name attributes, as well as file references in include elements.
The generated file doesn't show your commented members hierarchically. Rather, it is a flat list. It includes a unique ID string for each definition that allows the comments to be mapped back to their definitions in code (see Code Snippet below).
In this case, the string is M:Namespace.Anything(System.String). M stands for method, Namespace specifies the path, System.String the parameter type.
THIS is where you would override the NAME of the Method that INTELLISENSE sees, without effecting the actual Method itself.
<?xml version="1.0" ?>
<doc>
<assembly>
<name>AnyLib</name>
</assembly>
<members>
...
<member name="M:Namespace.Anything(System.String)">
<summary>Does something</summary>
<param name="str">str to pass into method</param>
<returns>A string</returns>
</member>
...
</members>
</doc>
You can generate the XML documentation file using either the command-line compiler or through the Visual Studio interface. If you are compiling with the command-line compiler, use options /doc or /doc+. That will generate an XML file by the same name and in the same path as the assembly. To specify a different file name, use /doc:file.
If you are using the Visual Studio interface, there's a setting that controls whether the XML documentation file is generated. To set it, double-click My Project in Solution Explorer to open the Project Designer. Navigate to the Compile tab. Find "Generate XML documentation file" at the bottom of the window, and make sure it is checked. By default this setting is on. It generates an XML file using the same name and path as the assembly
In short - yes, it is possible, but very cumbersome and makes re-using your code very difficult. Check this link for a more detailed overview:
https://msdn.microsoft.com/en-us/magazine/dd722812.aspx

eXist: is it possible to have XQuery modules stored in XML files?

You can store a module in eXist, such as the following, say under /modules/my.xqm:
module namespace my = "http://www.example.com/";
declare function my:answerToTheUltimateQuestion() as xs:integer { 42 }
And then import it into a query, such as:
import module namespace my="http://www.example.com/"
at "xmldb:exist:///db/modules/my.xqm";
my:answerToTheUltimateQuestion()
Instead of storing the XQuery in a "text file", is it possible to store it in an XML file, which would just be a wrapper around the XQuery? I am thinking about a wrapper similar to the one we use when POSTing queries to eXist (<exist:query><exist:text>). This would make it easier to manipulate XQuery modules with tools that expects XML data stored in the database.
You could store your XQuery in XQueryX format into eXist-db and then use a small XQuery and the XSLT from the XQueryX W3C spec within eXist-db to transform this into XQuery and execute it.