How to use Python read attributes values in XML file, non standard format [closed]









up vote
0
down vote

favorite












XML format



<datas>
<data> field1=abc, field2=cde,field3=fgh <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Bit more complicated, nested format



<datas>
<data> field1=abc, field2=[[field3=fgh, field4=fhg,field5=kjk]] <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Is there any tool can be use to parse this kind of format to retrieve value of the fields?










share|improve this question







New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as off-topic by Martijn Pieters Nov 9 at 16:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
    – Martijn Pieters
    Nov 9 at 16:53










  • See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
    – Martijn Pieters
    Nov 9 at 16:54











  • Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
    – Martijn Pieters
    Nov 9 at 16:56










  • And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
    – Martijn Pieters
    Nov 9 at 16:56










  • That's cool.Thank you very much!
    – netbbq
    Nov 9 at 19:59














up vote
0
down vote

favorite












XML format



<datas>
<data> field1=abc, field2=cde,field3=fgh <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Bit more complicated, nested format



<datas>
<data> field1=abc, field2=[[field3=fgh, field4=fhg,field5=kjk]] <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Is there any tool can be use to parse this kind of format to retrieve value of the fields?










share|improve this question







New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as off-topic by Martijn Pieters Nov 9 at 16:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
    – Martijn Pieters
    Nov 9 at 16:53










  • See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
    – Martijn Pieters
    Nov 9 at 16:54











  • Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
    – Martijn Pieters
    Nov 9 at 16:56










  • And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
    – Martijn Pieters
    Nov 9 at 16:56










  • That's cool.Thank you very much!
    – netbbq
    Nov 9 at 19:59












up vote
0
down vote

favorite









up vote
0
down vote

favorite











XML format



<datas>
<data> field1=abc, field2=cde,field3=fgh <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Bit more complicated, nested format



<datas>
<data> field1=abc, field2=[[field3=fgh, field4=fhg,field5=kjk]] <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Is there any tool can be use to parse this kind of format to retrieve value of the fields?










share|improve this question







New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











XML format



<datas>
<data> field1=abc, field2=cde,field3=fgh <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Bit more complicated, nested format



<datas>
<data> field1=abc, field2=[[field3=fgh, field4=fhg,field5=kjk]] <data/>
<data> field1=abc, field2=cde,field3=fgh <data/>
</datas>


Is there any tool can be use to parse this kind of format to retrieve value of the fields?







python xml






share|improve this question







New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 9 at 16:52









netbbq

1




1




New contributor




netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






netbbq is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




closed as off-topic by Martijn Pieters Nov 9 at 16:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Martijn Pieters Nov 9 at 16:53


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Martijn Pieters
If this question can be reworded to fit the rules in the help center, please edit the question.







  • 1




    That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
    – Martijn Pieters
    Nov 9 at 16:53










  • See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
    – Martijn Pieters
    Nov 9 at 16:54











  • Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
    – Martijn Pieters
    Nov 9 at 16:56










  • And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
    – Martijn Pieters
    Nov 9 at 16:56










  • That's cool.Thank you very much!
    – netbbq
    Nov 9 at 19:59












  • 1




    That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
    – Martijn Pieters
    Nov 9 at 16:53










  • See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
    – Martijn Pieters
    Nov 9 at 16:54











  • Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
    – Martijn Pieters
    Nov 9 at 16:56










  • And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
    – Martijn Pieters
    Nov 9 at 16:56










  • That's cool.Thank you very much!
    – netbbq
    Nov 9 at 19:59







1




1




That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
– Martijn Pieters
Nov 9 at 16:53




That's just text data, and any structured format in text data is entirely outside of the XML standard. Just parse it like you would a Python string of the format.
– Martijn Pieters
Nov 9 at 16:53












See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
– Martijn Pieters
Nov 9 at 16:54





See a similar question, parsing space-separated key-value pairs: Creating dictionary from space separated key=value string in Python
– Martijn Pieters
Nov 9 at 16:54













Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
– Martijn Pieters
Nov 9 at 16:56




Also look at Extracting key value pairs from string with quotes, which handles quoted values, similar to your nested key-value pairs.
– Martijn Pieters
Nov 9 at 16:56












And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
– Martijn Pieters
Nov 9 at 16:56




And lastly, Split "Nested" String By Parentheses into Nested List is probably interesting too.
– Martijn Pieters
Nov 9 at 16:56












That's cool.Thank you very much!
– netbbq
Nov 9 at 19:59




That's cool.Thank you very much!
– netbbq
Nov 9 at 19:59

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo