Strong Password Generator Tool

Strong Password Generator Strong Password Generator Password Length: Include Uppercase Letters Include Numbers Include Symbols Generate Password Copy * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Arial', sans-serif; background-color: #f7f7f7; display: flex; justify-content: center; align-items: center; height: 100vh; color: #333; } .container { background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1); width: 90%; max-width: 400px; text-align: center; } h1 { color: #3498db; margin-bottom: 20px; } .input-group { margin-bottom: 20px; } label { font-size: 16px; color: #333; display: block; margin-bot...

XML TO Json converter tool

 


XML to JSON Tool
body { font-family: Arial, sans-serif; margin: 0; padding: 0; } .container { max-width: 800px; margin: 50px auto; padding: 20px; background-color: #f9f9f9; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } textarea { width: 100%; height: 200px; margin-bottom: 10px; padding: 10px; font-size: 14px; border: 1px solid #ccc; border-radius: 5px; } button { padding: 10px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #0056b3; } #json-output { margin-top: 20px; padding: 10px; background-color: #fff; border: 1px solid #ccc; border-radius: 5px; white-space: pre-wrap; } function convertToJSON() { const xmlInput = document.getElementById('xml-input').value.trim(); if (!xmlInput) { alert('Please enter some XML to convert to JSON.'); return; } try { const parser = new DOMParser(); const xmlDoc = parser.parseFromString(xmlInput, 'text/xml'); const jsonOutput = xmlToJson(xmlDoc); document.getElementById('json-output').textContent = JSON.stringify(jsonOutput, null, 2); } catch (error) { alert('Invalid XML format! Please check your input.'); } } function xmlToJson(xml) { const obj = {}; if (xml.nodeType === 1) { if (xml.attributes.length > 0) { obj['@attributes'] = {}; for (let i = 0; i < xml.attributes.length; i++) { const attribute = xml.attributes.item(i); obj['@attributes'][attribute.nodeName] = attribute.nodeValue; } } } else if (xml.nodeType === 3) { obj = xml.nodeValue.trim(); } if (xml.hasChildNodes()) { for (let i = 0; i < xml.childNodes.length; i++) { const item = xml.childNodes.item(i); const nodeName = item.nodeName; if (typeof obj[nodeName] === 'undefined') { obj[nodeName] = xmlToJson(item); } else { if (typeof obj[nodeName].push === 'undefined') { const old = obj[nodeName]; obj[nodeName] = []; obj[nodeName].push(old); } obj[nodeName].push(xmlToJson(item)); } } } return obj; }

Comments

Popular posts from this blog

Image Compressor Tool

Strong Password Generator Tool

Toss Coin Game Tool