title: I cant call url xml parser
body: <p>my app get forclose, cant running with url have more caracter. 
  im use xml parser for article in my app. if i call url like this ,my app force close.</p>
  
  <pre><code>   http://api.news.com/newsServices.asmx/getArticleByCategoryWithDetails?categoryname=nasional&amp;start=0&amp;limit=10
  </code></pre>
  
  <p>but if i call url like this, my app can running.</p>
  
  <pre><code>  http://api.news.com/news,Services.asmx/getArticle
  </code></pre>
  
  <p>this is my code :</p>
  
  <pre><code>   public class news extends Activity {
  
      private Activity activity;
      public ImageLoader imageLoader;
  
  String URL = "http://api.news.com/newsServices.asmx/getArticleByCategoryWithDetails?categoryname=nasional&amp;start=0&amp;limit=10";
  // XML node key
  
  static final String KEY_ARTICLE = "Article"; // parent node
  static final String KEY_ID = "ArticleID";
  static final String KEY_AUTHOR = "Author";
  static final String KEY_HEADLINE = "Headline";
  static final String KEY_ARTICLEDATE = "ArticleDate";
  static final String KEY_VIEWED = "Viewed";
  static final String KEY_PUBLISHEDAT = "PublishedAt";
  static final String KEY_SUMMARY = "Summary";
  static final String KEY_BODY = "Body";
  static final String KEY_IMAGEURL = "ImageURL";
  static final String KEY_SLUG = "Slug";
  static final String KEY_CATEGORY = "Category";
  
  
  ListView list ;
  LazyAdapter adapter;
  private NodeList nl;
  private xmlParser parser;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.news);
  
      activity = this;      
  
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList2 = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      parser = new xmlParser();
      String xml = parser.getXmlFromUrl(URL); // getting XML from URL
      Document doc = parser.getDomElement(xml); // getting DOM element
  
      Log.i("parser star", xml);
  
      nl = doc.getElementsByTagName(KEY_ARTICLE);
      // looping through all song nodes &lt;song&gt;
      for (int i = 1; i &lt; nl.getLength(); i++) {
          // creating new HashMap
          HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
          Element e = (Element) nl.item(i);
          // adding each child node to HashMap key =&gt; value
          map.put(KEY_ID, parser.getValue(e, KEY_ID));
          map.put(KEY_HEADLINE, parser.getValue(e, KEY_HEADLINE));
          map.put(KEY_ARTICLEDATE, parser.getValue(e, KEY_ARTICLEDATE));
          map.put(KEY_IMAGEURL, parser.getValue(e, KEY_IMAGEURL));
          map.put(KEY_BODY, parser.getValue(e,KEY_BODY));
  
          // adding HashList to ArrayList
          songsList2.add(map);
      }
  
      list=(ListView)findViewById(R.id.list);
  
  
      // Getting adapter by passing xml data ArrayList
      adapter=new LazyAdapter(this, songsList2);          
      list.setAdapter(adapter);
  </code></pre>
  
  <p>logcat :</p>
  
  <pre><code>       12-19 09:40:06.154: E/Error:(30404): Unexpected token (position:TEXT Request format i...@2:1 in java.io.StringReader@413cc940) 
         12-19 09:40:06.154: I/parser star(30404): Request format is invalid: .
         12-19 09:40:06.154: D/AndroidRuntime(30404): Shutting down VM
         12-19 09:40:06.154: W/dalvikvm(30404): threadid=1: thread exiting with uncaught exception (group=0x40a991f8)
         12-19 09:40:06.154: E/AndroidRuntime(30404): FATAL EXCEPTION: main
         12-19 09:40:06.154: E/AndroidRuntime(30404): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.news/com.news.news}: java.lang.NullPointerException
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.os.Handler.dispatchMessage(Handler.java:99)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.os.Looper.loop(Looper.java:137)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread.main(ActivityThread.java:4424)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at java.lang.reflect.Method.invokeNative(Native Method)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at java.lang.reflect.Method.invoke(Method.java:511)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at dalvik.system.NativeStart.main(Native Method)
         12-19 09:40:06.154: E/AndroidRuntime(30404): Caused by: java.lang.NullPointerException
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at com.news.news.onCreate(news.java:80)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.Activity.performCreate(Activity.java:4465)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
         12-19 09:40:06.154: E/AndroidRuntime(30404):     ... 11 more
  </code></pre>
  
  <p>this is xml parser class</p>
  
  <pre><code>        public class xmlParser {
  
  // constructor
  public xmlParser() {
  
  }
  
  public String getXmlFromUrl(String url) {
      String xml = null;
  
      try {
          // defaultHttpClient
          DefaultHttpClient httpClient = new DefaultHttpClient();
          HttpPost httpPost = new HttpPost(url);
  
          HttpResponse httpResponse = httpClient.execute(httpPost);
          HttpEntity httpEntity = httpResponse.getEntity();
          xml = EntityUtils.toString(httpEntity);
  
      } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
      } catch (ClientProtocolException e) {
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
      // return XML
      return xml;
  }
  
  public Document getDomElement(String xml){
      Document doc = null;
      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      try {
  
          DocumentBuilder db = dbf.newDocumentBuilder();
  
          InputSource is = new InputSource();
              is.setCharacterStream(new StringReader(xml));
              doc = db.parse(is); 
  
          } catch (ParserConfigurationException e) {
              Log.e("Error: ", e.getMessage());
              return null;
          } catch (SAXException e) {
              Log.e("Error: ", e.getMessage());
              return null;
          } catch (IOException e) {
              Log.e("Error: ", e.getMessage());
              return null;
          }
  
          return doc;
  }
  
   public final String getElementValue( Node elem ) {
       Node child;
       if( elem != null){
           if (elem.hasChildNodes()){
               for( child = elem.getFirstChild(); child != null; child = child.getNextSibling() ){
                   if( child.getNodeType() == Node.TEXT_NODE  ){
                       return child.getNodeValue();
                   }
               }
           }
       }
       return "";
   }
  
  
   public String getValue(Element item, String str) {     
          NodeList n = item.getElementsByTagName(str);        
          return this.getElementValue(n.item(0));
      }
       }
  </code></pre>