We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I have the following xml
<w:document xmlns:w="http://www.example.com/wordproc"> <w:body> <w:p> abc </w:p> <w:b> def </w:b> <w:p> ghi </w:p> <w:i> gkl </w:i> <w:p> mno </w:p> </w:body> </w:document>
It parses into json format like this
{ "w:document":{ "@xmlns:w":"http://www.example.com/wordproc", "w:body":{ "w:p":[ "abc", "ghi", "mno" ], "w:b":"def", "w:i":"gkl" } } }
Restoring again will not guarantee the original order
<w:document xmlns:w="http://www.example.com/wordproc"> <w:body> <w:p>abc</w:p> <w:p>ghi</w:p> <w:p>mno</w:p> <w:b>def</w:b> <w:i>gkl</w:i> </w:body> </w:document>
I want to parse into the following format, how can I achieve this, I tried the force list argument and it didn't work
{ "w:document": [ { "@xmlns:w": "http://www.example.com/wordproc" }, { "w:body": [ { "w:p": "abc", }, { "w:b": "def", }, { "w:p": "ghi", }, { "w:i": "gkl", }, { "w:p": "mno", } ] } ] }
The text was updated successfully, but these errors were encountered:
@yangsongbai1 You suggested result will become (after unparse()) something like:
unparse()
<w:document xmlns:w="http://www.example.com/wordproc"> <w:body><w:p>abc</w:p></w:body> <w:body><w:p>ghi</w:p></w:body> <w:body><w:p>mno</w:p></w:body> <w:body><w:b>def</w:b></w:body> <w:body><w:i>gkl</w:i></w:body> </w:document>
There are related issue #247 that suggests better syntax (special $list key).
$list
Sorry, something went wrong.
No branches or pull requests
When I have the following xml
It parses into json format like this
Restoring again will not guarantee the original order
I want to parse into the following format, how can I achieve this, I tried the force list argument and it didn't work
The text was updated successfully, but these errors were encountered: