A Visual Basic .NET implementation that transforms JSON Strings into a managed .NET XDocument
Visual Basic
Switch branches/tags
Nothing to show
Clone or download
dday9 Updated README.md
-Updated the URL for the fiddle to reflect the changes in json.vb
Latest commit aadcc79 Feb 8, 2018
Failed to load latest commit information.
.gitignore Initial commit May 25, 2016
LICENSE Initial commit May 25, 2016
README.md Updated README.md Feb 8, 2018
json.vb Updated json.vb Feb 8, 2018



A Visual Basic .NET implementation that converts JSON Strings into a .NET XDocument

To use the file simply add it to your project and call the JSON.Parse method.


Public Function Parse(ByVal literal As String) As XDocument


  • literal

    • Type: System.String
    • The JSON literal to be converted.
  • Return Value

    • Type: System.Xml.Linq.XDocument
    • An XML representation of the JSON literal. If the JSON is not parsable, then the method returns Nothing.


  • The parser ignores whitespace. So if the JSON literal is:
      "string_key": [
          "nested": true

Then it gets parsed as:

  • The returned XML is a 1-to-1 translation from the JSON. Using the same example as above, the resulting XML would be:


The following example demonstrates the Parse method.

Option Strict On
Public Module Module1
    Public Sub Main()
  	  Dim jsonLiteral As String = "{""key"": [1, 2, 3], ""nested"": {""object"": true}}"
    End Sub
End Module

Fiddle: https://dotnetfiddle.net/Gui2tq