Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Online demo does not handle DOCTYPE correctly and gives an error

オープン
#627 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend, web-dev

調査の方向性

https://naturalintelligence.github.io/fast-xml-parser/ のオンラインツールから始め、デフォルトの XML サンプルを使って、ドキュメントに記載された「Parse to JSON」、「Parse to XML」、「Parse to JSON」のシーケンスを再現してください。ラウンドトリップで XML 宣言エラーが報告されなくなり、重複した宣言も生成されなくなれば完了です。issue ではソースファイルもテストも指定されていません。

索引モデルが issue の本文から書いたものです。

説明

  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?
Description

Steps to reproduce:

  1. go to the online tool https://naturalintelligence.github.io/fast-xml-parser/
  2. no additional input needed, just click "Parse to JSON"
  3. then "Parse to XML"
  4. and again "Parse to JSON"
  5. it'll print Error: XML declaration allowed only at the start of the document.:2:6

I guess this is due to the { "?xml": "", ... } property, which converts to an invalid and duplicated doctype, resulting in an invalid XML:

<?xml version="1.0"?>
<?xml?>
<!-- ... the rest of the XML is valid -->

If i uncheck the "Ignore attributes" checkbox, then at the 2nd step i'll get a JSON that starts with this

{
    "?xml": {
        "@_version": "1.0"
    },

and when you convert it back to XML then you get a valid, but still duplicated doctype, which results in the same error:

<?xml version="1.0"?>
<?xml version="1.0"?>
<!-- ... the rest of the XML is valid -->
Code

The default XML sample that's in the online tool.

Output
expected data

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

主要言語
JavaScript
スター
3.1k
フォーク
400
平均マージ
3日 9時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NaturalIntelligence/fast-xml-parser のほかの issue

NaturalIntelligence/fast-xml-parser の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。