Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
この XML を解析しようとしています:
<data> <item field="abcdef '<>&" row="another text" /> </data>
getAttribute('field') のabcdef '<>&とgetAttribute('row') の別のテキストを取得する必要があります。しかし、データに <>& などが含まれている場合、XML は正しく解析されません。どうすれば正しく解析できますか?
不正な XML です。'<>&としてエンコードする必要があります'<>&。整形式の XML は次のようになります。
'<>&
'<>&
<data> <item field="abcdef '<>&" row="another text" /> </data>
XML パーサーで解析する前に、XML を整理する必要があります。