exacttarget / node-xmljson Goto Github PK
View Code? Open in Web Editor NEWTranslates between JSON and XML formats
License: MIT License
Translates between JSON and XML formats
License: MIT License
When parsing the ExactTarget WSDL, here's the output. This needs fixed to function properly...
{ definitions:
{ '$':
{ targetNamespace: 'http://exacttarget.com/wsdl/partnerAPI',
xmlns: 'http://schemas.xmlsoap.org/wsdl/',
'xmlns:soap': 'http://schemas.xmlsoap.org/wsdl/soap/',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema',
'xmlns:tns': 'http://exacttarget.com/wsdl/partnerAPI' },
types: { schema: [Object] },
message:
{ '0': [Object],
'1': [Object],
'2': [Object],
'3': [Object],
'4': [Object],
'5': [Object],
'6': [Object],
'7': [Object],
'8': [Object],
'9': [Object],
'10': [Object],
'11': [Object],
'12': [Object],
'13': [Object],
'14': [Object],
'15': [Object],
'16': [Object],
'17': [Object],
'18': [Object],
'19': [Object],
'20': [Object],
'21': [Object],
'22': [Object],
'23': [Object],
'24': [Object],
'25': [Object] },
portType: { '$': [Object], operation: [Object] },
binding: { '$': [Object], 'soap:binding': [Object], operation: [Object] },
service:
{ '$': [Object],
documentation: 'ExactTarget Partner API',
port: [Object] } } }
Input:
`"<ul class="swiper-wrapper slides">
<li class="swiper-slide" category="Nissan Navara">
<a href="https://autoworldnissan.co.nz/pre-owned-showroom/?pageNumber=3" target="_blank" class="clicktag clickcarousel">
<img class="img-alig" src="images/slide1.jpg"/>
<!--caption section -->
<div class="caption">
<p class="firstslide-bg"></p>
</div>
<!--caption section end-->
</a>
</li></ul>
Output
Error: Invalid character entity
Line: 13
Column: 85
Char: =
For versatility, it would be great to have an option of not adding <data></data>
by default.
Maybe it should be an option, where if "" is specified, no <data></data>
is created, if "root" is specified, <root></root>
will be created.
I convert this XML to JSON:
<entry>
<link rel="http://schemas.google.com/contacts/2008/rel#edit-photo" type="image/*" href="https://www.google.com/m8/feeds" />
<link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts" />
<link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts" />
<gd:email rel="http://schemas.google.com/g/2005#home" address="[email protected]" primary="true" />
</entry>"
Then I convert JSON back and see this:
<entry>
<link>
<0 rel="http://schemas.google.com/contacts/2008/rel#edit-photo" type="image/*" href="https://www.google.com/m8/feeds"/>
<1 rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts"/>
<2 rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts"/>
</link>
</entry>"
Which is an invalid XML according to http://www.freeformatter.com/xml-formatter.html:
Unable to parse any XML input. org.jdom.input.JDOMParseException: Error : The content of elements must consist of well-formed character data or markup.
When i try to convert xml to json using xml_str2json, it throws an error stating "window is not defined"!
.
Hi,
I am using v0.2.0, still I am facing the above issue. Can you please help me to resolve these issue, I am struggling?
<data></data>
<data></data>
<data></data>
When i am converting from XML to JSON, I am getting:
"data": {
0: { },
1: { },
2: { }
}
Can you help me, to convert correct JSON format Array.
"data": [
0: { },
1: { },
2: { }
]
Thanks,
Sudhakar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.