Click here to Skip to main content
14,878,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
<string xmlns="http://tempuri.org/">

    [{"POSCODE":"01","POSDESC":"BAR"},
    {"POSCODE":"13","POSDESC":"CAT AC"},
    {"POSCODE":"02","POSDESC":"CATERING"},
    {"POSCODE":"15","POSDESC":"CLUB FUNCTIONS"},
    {"POSCODE":"07","POSDESC":"GYM"},
    {"POSCODE":"14","POSDESC":"OTHERS"},

</string>


This is my Asp.net webservice JsonString Output

my webservice Responce string xmlns=&quot;http://tempuri.org when i try to create Json Array. Is there any possible to remove string xmlns=&quot;http://tempuri.org/&quot; from android??

[Edit]Pre tags placement modified - Naz_Firdouse[/Edit]
Posted
Updated 29-May-14 21:21pm
v2

Your string result is already in JSON ;)
Just revise the end of your string, then read it and use it as you want.
JavaScript
[{"POSCODE":"01","POSDESC":"BAR"},
{"POSCODE":"13","POSDESC":"CAT AC"},
{"POSCODE":"02","POSDESC":"CATERING"},
{"POSCODE":"15","POSDESC":"CLUB FUNCTIONS"},
{"POSCODE":"07","POSDESC":"GYM"},
{"POSCODE":"14","POSDESC":"OTHERS"}]

If your result was in a "real" XML format, I've suggested this link to you ;)
http://stackoverflow.com/questions/18337394/convert-xml-to-json-object-in-android[^]
   
v2
You already have it done! If you just want to remove that one particular text part. You can use this simple method too.

Java
// ignore this part.
xmlns="http://tempuri.org/"
// 
String stringContent = "JsonResultAsStringHere";
String newString = stringContent.Replace("xmlns=\"http://tempuri.org/\"", "");
// use it anywhere as newString.


This would do it. It would just remove the attribute from the String and then you can convert it back to the XML.
   
C# Xml to Json code here.

http://xamarin.me/wordpress/?p=7[^]


Thanks,
Harshad
   
Thanks for sharing yoour info. I truly appreciate your efforts
and I will be waiting for your next write ups thank you once again.
играть в natural8 на мобильном webpage
natural 8 регистрация
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900