RevealTheme logo

محوّل XML إلى JSON

حوّل مستندات XML إلى JSON. تتحول السمات إلى مفاتيح ببادئة @؛ وتتحول الوسوم المتكررة إلى مصفوفات (arrays).

كيفية استخدام هذه الأداة

  1. 1

    Paste or type your XML into the input box.

  2. 2

    Read the converted JSON in the output panel below, which updates as you type.

  3. 3

    If the XML is malformed, fix the error shown in red and the output will reappear.

  4. 4

    Select the JSON from the output panel to copy it into your project.

ما هو محوّل XML إلى JSON؟

الانتقال من XML إلى JSON ينطوي على فقدان في بعض الجوانب: فـ XML يدعم مساحات الأسماء (namespaces)، وتعليمات المعالجة، وأقسام CDATA التي لا تقابلها مكافئات مباشرة في JSON. يعالج هذا المحوّل 90% من الحالات: العناصر المتداخلة، والسمات (ببادئة @)، والمحتوى النصي (#text). أما بالنسبة إلى XML المعقد، فقد تكون هناك حاجة إلى مكتبة مخصصة.

حالات الاستخدام الشائعة

  • Inspect a SOAP or legacy XML API response as JSON before wiring it into a JavaScript front end.

  • Convert an RSS or Atom feed snippet into JSON to prototype a parser quickly.

  • Turn a config file or build manifest written in XML into JSON to eyeball its structure.

  • Pull values out of an XML sitemap or data export when a JSON shape is easier to traverse.

  • Teach or learn how attributes, repeated tags, and text nodes map between the two formats.

  • Sanity-check that a small XML payload is well-formed, since malformed input shows a parser error.

الأسئلة الشائعة

ما هي البادئة @؟
تُخزَّن السمات على هيئة @اسم_السمة لتمييزها عن العناصر الفرعية التي تحمل الاسم نفسه.

أدوات ذات صلة