private void LoadDocuments(String str, String filepath) throws IOException
	{		
		str = str.replace("\n", " ");
		str = str.replace("\r", " ");
		String[] docs = str.split("</DOC>");
		
		for (int i = 0; i < docs.length; i++)
		{
			String s = docs[i].trim();
			if (s.length() > 0)
			{
				try
				{
					Document d = new Document();
					d.FileName = filepath;
					
					d.DataCreazione = extractDateParse(s, "DD");
					if (d.DataCreazione == null)
					{
						WriteError(ErrorCode.TagNotFound_DD);
						d.DataCreazione = extractDateParse(s, "DATE");
						if (d.DataCreazione == null)
						{
							throw new ParseException("", 0);
						}
					}
					
					d.Id = extract(s, "DOCNO");
					d.TestoOriginale = extract(s, "TEXT");
					if (d.TestoOriginale == "")
					{
						d.TestoOriginale = extract(s, "LP");
					}
					 
					this.documents.add(d);
				}
				catch(ParseException ex)
				{
					WriteError(ErrorCode.TagNotFound_DATE, filepath);
				}
				catch(Exception ex)
				{
					WriteError(ErrorCode.Undefined);
				}
				 
			 }
		 }
		 
	}