I have one string in format of XML, (this is not well-formatted XML!) and I would like to get the field and value
<MYXML
address="rua sao carlos, 128" telefone= "1000-222" service="xxxxxx" source="xxxxxxx" username="aaaaaaa" password="122222" nome="asasas" sobrenome="aass" email="[email protected]" pais="SS" telefone="4002-" />
I would like to get the parameter and value separeted in split.
I try this:
xml.ToString().Replace(" =" , "=").Replace("= " , "=").Replace(" = " , "=").Split(new char[]{' '});
But not work perfect becase for example the attribute 'address' was split in two items
{string[29]}
[0]: "<signature"
[1]: "aaa=\"xxxx\""
[2]: "sss=\"xxxx\""
[3]: "ssss=\"xxx\""
[4]: "username=\"xxx\""
[5]: "password=\"xxxx\""
[6]: "nome=\"xxxx\""
[7]: "sobrenome=\"xxx\""
[8]: "email=\"[email protected]\""
[9]: "pais=\"BR\""
[10]: "endereco=\"Rua"
[11]: "Sao"
[12]: "Carlos,"
[13]: "128\""
[14]: "cidade=\"Sao"
[15]: "Paulo\""
The error is
[10]: "endereco=\"Rua"
[11]: "Sao"
[12]: "Carlos,"
When the correct I would like is
[10]: "endereco=\"Rua Sao Carlos , 128"