Title: How to convert a node of xml to json array · Issue #595 · stleary/JSON-java · GitHub
Open Graph Title: How to convert a node of xml to json array · Issue #595 · stleary/JSON-java
X Title: How to convert a node of xml to json array · Issue #595 · stleary/JSON-java
Description: This is achieved in python, is it possible to add similar parameters in java In the following example, interfaces are parsed into an array as expected import json import xmltodict t1 = '''
Open Graph Description: This is achieved in python, is it possible to add similar parameters in java In the following example, interfaces are parsed into an array as expected import json import xmltodict t1 = ''' X Description: This is achieved in python, is it possible to add similar parameters in java In the following example, interfaces are parsed into an array as expected import json import xmltodict t1 = ''...
Opengraph URL: https://github.com/stleary/JSON-java/issues/595
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to convert a node of xml to json array","articleBody":"This is achieved in python, is it possible to add similar parameters in java\r\n\r\nIn the following example, **interfaces are parsed into an array** as expected\r\n\r\n``` python\r\nimport json\r\n\r\nimport xmltodict\r\n\r\nt1 = '''\r\n\u003cservers>\r\n \u003cserver>\r\n \u003cname>host1\u003c/name>\r\n \u003cos>Linux\u003c/os>\r\n \u003cinterfaces>\r\n \u003cinterface>\r\n \u003cname>em0\u003c/name>\r\n \u003cip_address>10.0.0.1\u003c/ip_address>\r\n \u003c/interface>\r\n \u003c/interfaces>\r\n \u003c/server>\r\n\u003c/servers>\r\n'''\r\ncontent = xmltodict.parse(t1, force_list=['servers', 'interfaces'])\r\ndata_str = json.dumps(content)\r\nprint(data_str)\r\n\r\n```\r\noutput\r\n``` json\r\n{\r\n \"servers\": [\r\n {\r\n \"server\": {\r\n \"name\": \"host1\",\r\n \"os\": \"Linux\",\r\n \"interfaces\": [\r\n {\r\n \"interface\": {\r\n \"name\": \"em0\",\r\n \"ip_address\": \"10.0.0.1\"\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n ]\r\n}\r\n```\r\nis it possible to add similar parameters in java?\r\n``` java\r\npublic JSONObject parse(String content, List\u003cString> forceList) {\r\n // to be\r\n return org.json.XML.toJSONObject(content);\r\n }\r\n```\r\n","author":{"url":"https://github.com/relax-admin","@type":"Person","name":"relax-admin"},"datePublished":"2021-03-16T03:15:48Z","url":"https://github.com/stleary/JSON-java/issues/595"}
react-profiling 0 react-import-map react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:15691b9b-5d0e-e22b-fba4-61f403d8f5dd current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id C052:11DDE4:8069DB:B0403D:6AFD2B77 html-safe-nonce 4b444e613d04b048722164d62fc4e9a9251feb249bb080161e7c131cb593fc51 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDUyOjExRERFNDo4MDY5REI6QjA0MDNEOjZBRkQyQjc3IiwidmlzaXRvcl9pZCI6IjEzMzc0OTM5MDM0MjY1MzAxNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== visitor-hmac 32dace31b2ec06dca3f94974c06802313869b714ef399c0537460f29a71a51f4 hovercard-subject-tag issue:832369330 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stleary/JSON-java/595/issue_layout twitter:image https://opengraph.githubassets.com/e7d0b32aeab4ac62bf6eb327596542ac5e8d243194d5f9f5ac61c426010468b7/stleary/JSON-java/issues/595 twitter:card summary_large_image og:image https://opengraph.githubassets.com/e7d0b32aeab4ac62bf6eb327596542ac5e8d243194d5f9f5ac61c426010468b7/stleary/JSON-java/issues/595 og:image:alt This is achieved in python, is it possible to add similar parameters in java In the following example, interfaces are parsed into an array as expected import json import xmltodict t1 = ''' og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username relax-admin hostname github.com expected-hostname github.com None 065128366c233a9d57ff68ab6c96e25b99dd1b0ab70d23b70873d3dd6b5e4f19 turbo-cache-control no-preview go-import github.com/stleary/JSON-java git https://github.com/stleary/JSON-java.git octolytics-dimension-user_id 5107558 octolytics-dimension-user_login stleary octolytics-dimension-repository_id 1187853 octolytics-dimension-repository_nwo stleary/JSON-java octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 1187853 octolytics-dimension-repository_network_root_nwo stleary/JSON-java turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 941021edf0c2ec58298f4a2c8f27ae507d129c92 ui-target full theme-color #1e2327 color-scheme light dark react-app-name issues
URLs of crawlers that visited me.