Socket
Socket
Sign inDemoInstall

jsontoxml

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsontoxml - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

b.js

30

a.js

@@ -1,3 +0,29 @@

var j = require('./jsontoxml');
var obj = {
"message":[
{name:"authkey", text:"api"},
{name:"sender", text:"777777"},
{name:"route", text:"default"},
{name:"campaign", text:"get perks"},
{name:"country",text:"91"},
{name:"sms",attrs:{text:"Check api"},children:[
{name:"address",attrs:{to:"12345"}},
{name:"address",attrs:{to:"123455"}}
]}
]
}
console.log(j([{attrs:{a:"b"},name:"b"}]))
var jsontoxml = require('./')
console.log(jsontoxml([
{name: "sitemapindex",attrs:{xmlns:"http://www.sitemaps.org/schemas/sitemap/0.9"},children:[
{name:"sitemap",children:{
loc:"url1"
}},
{name:"sitemap",children:{
loc:"url2"
}},
{name:"sitemap",children:{
loc:"url3"
}},
]}
],{prettyPrint:true,indent:" "}))

4

jsontoxml.js

@@ -7,2 +7,3 @@ //copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed]

var element_replace = new RegExp("^([^" + element_start_char + "])|^((x|X)(m|M)(l|L))|([^" + element_start_char + element_non_start_char + "])", "g");
var not_safe_in_xml = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm;

@@ -183,3 +184,4 @@ var process_to_xml = function(node_data,options){

.replace(/'/g, '&apos;')
.replace(/"/g, '&quot;');
.replace(/"/g, '&quot;')
.replace(not_safe_in_xml, '');
}

@@ -186,0 +188,0 @@

{
"name": "jsontoxml",
"version": "0.0.11",
"version": "0.0.12",
"description": "This is a library designed to render js objects as xml. Its not made to parse or otherwise edit existing xml/html structures.",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/ken-franken/node-jsontoxml",

@@ -30,3 +30,3 @@ [![Build Status](https://secure.travis-ci.org/soldair/node-jsontoxml.png)](http://travis-ci.org/soldair/node-jsontoxml)

hi:'is a nice thing to say',
node:'i am another not special child node'
node:'i am another not special child node',
date:function(){

@@ -75,3 +75,3 @@ return (new Date())+'';

- `xmlHeader` can either be boolan (add generic `<?xml …?>` header) or an object. If an object valid options are:
- `standalone` if true, the `<?xml …?>` gets an additional attribute `standalone="true"`.
- `standalone` if true, the `<?xml …?>` gets an additional attribute `standalone="yes"`.
- `docType` if defined gets added as the `<!DOCTYPE …>` contents (unescaped).

@@ -78,0 +78,0 @@ - `prettyPrint` if truthy the output gets a rudimentary pretty print (good for debugging, don't expect too much)

@@ -11,3 +11,3 @@ //copyright Ryan Day 2010 <http://ryanday.org> [MIT Licensed]

parent:[
{name:'taco',text:'beef taco',children:{salsa:'hot!'}},
{name:'taco',text:'beef taco',children:{salsa:'hot!'}},
{name:'xml',text:'tag'},

@@ -14,0 +14,0 @@ {name:'taco',text:'fish taco',attrs:{mood:'sad'},children:[

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc