473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to select specific nodes from bulky xml and convert it into json?

I have XML file with large amount of data now I need to select specific nodes from that XML and convert it into JSON
Nov 13 '19 #1
1 2069
AjayGohil
83 64KB
hello try this for json to xml and xml to json

Expand|Select|Wrap|Line Numbers
  1. XmlDocument doc = new XmlDocument();
  2. doc.LoadXml(xml);
  3. // To convert an XML node  into string json 
  4. string jsonText = JsonConvert.SerializeXmlNode(doc);
  5.  
  6. // To convert JSON text contained in string json into an XML node
  7. XmlDocument doc = JsonConvert.DeserializeXmlNode(json);
Nov 22 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Isman | last post by:
I was trying to find a way to select specific fields in listview with multiple column. but I can't seems to find a way to this without selecting the whole row. Any suggestion anyone.. Thanks in...
2
by: ABC | last post by:
I have a very large amount VB code convert into C Sharp. I just complete it use tools. But it still have some codes errors. There are object to datatype problems. I need to edit many files to...
0
by: ckoch | last post by:
If this is my xml, how do I select all nodes with the same prefix? ie. I want to do a doc.selectnodes and get all nodes that are in the ns0 namespace. selectnodes doesn't seem to do it or I can't...
1
by: karthee | last post by:
I am creating a custom treeview with multiple selection, if i select multiple nodes and right click, the selection is disappearing, i tried with somany things like on mouse click my code is...
5
by: arial | last post by:
Hi all, I have a sql .bak file which i need to convert into xml file. can someone help with this? pointing out to some tutorial or some suggetion on how to start? Thak you,
1
by: sandyyyy35 | last post by:
is it possible to make a simple text list by selecting it and onclick make it to convert into a ordered bulleted list. if yes please write a JavaScript for that.
2
by: betty blue | last post by:
I am a newbie to C#. I want to select three columns from my text file i.e. Empl No, Start Date and Created Date. After selecting this, I want to insert the data into a database. I have attached a...
0
by: Jhamjhamqt | last post by:
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" + newpath + "\DDCOS.mdb") Dim cmdd As New OleDb.OleDbCommand("CREATE TABLE DDCOS( " & _ "RecNum int...
0
by: suryaaa | last post by:
i am trying to get data from the mysql table in JSON format.. my jsp code <%@ page import="java.sql.*" %> <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> <HEAD>...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.