package org.ellectra.gui.managebeans;

import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import java.util.regex.Pattern;

import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
import javax.faces.event.ValueChangeEvent;
import javax.faces.validator.ValidatorException;

import org.ellectra.gui.utils.JSFUtils;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;


public class pinForm {
	//TODO : where we will store the forms ? DB or XML ? 
	Date test;
	//Preliminary questions
	private String contractType;
	private String a4Disabled;	//this variable will be also used to show/hide section III.1.1 
	private Integer a4;
	private String a4Required;
	
	//Section I
	private String a5;
	private String a6;
	private String a7;
	private String country;
	private String a9;
	private String a10;
	private String a11;
	private String a12;
	private String a13;
	private String a14;
	private String a15;
	private String a16;
	
	private String furtherInfo;
	private boolean showAnnexASectionI;
	
	private String typeOfCA;
	private String[] activitiesSelected = null; 
	private String a26;
	private String a26Disabled;
	private String a38;
	private String a38Disabled;
	private String a39;
        private String cpv;
    private String nuts;
    private String voc;
        
	//Section II.A
	private String a40;
	private String a41;
	private String a42;
	private String a44;
	private String a45;
	private String a46_a49;
	private Double a47;
	private String a47_48Disabled;
	private String a48;	//currency
	private Double a50;
	private String a50_51_52Disabled;
	private Double a51;
	private String a52;	//currency
	private String a53;
	private Integer a54;
	private String a54Disabled;
	private String a60_a62_a64;
	private Double a61;
	private String a61Disabled;
	private Double a63;
	private String a63Disabled;
	private String a65_66Disabled;
	private String a67;
	private String a68;
	
	//Section II.B
	private boolean a70;
	private boolean a71;
	private String category;
	private String a73;
	private String a74;
	
	//Section III
	private String a93;
	private String a94;
	private boolean a95;
	private boolean a96;
	private String a95_96Disabled;
	
	//Section VI
	private String a97;
	private String a98;
	private String a98Disabled;
	private String a98Required;
	private String a99;
	private String a100;
	private String a101;
	private String a102;
	private boolean a103;	//this variable will be used to implement constraint "1.2.2.6"
	private Date today;	//actually the a104

	private Date a59_90;
	private Date a65;
	private Date a66;
	
	private annexA a = new annexA();
	
	String link0;
	String link1;
	String link2A;
	String link2B;
	String linkAnB;
	String link3;
	String link4;
	String linkAnA;
	
	String text0;
	String text1;
	String text2A;
	String text2B;
	String textAnB;
	String text3;
	String text4;
	String textAnA;
	
	String v0;
	String v1;
	String v2A;
	String v2B;
	String vAnB;
	String v3;
	String v4;
	String vAnA;
	
	String i0;
	String i1;
	String i2A;
	String i2B;
	String iAnB;
	String i3;
	String i4;
	String iAnA;
	
	String c0;
	String c1;
	String c2A;
	String c2B;
	String cAnB;
	String c3;
	String c4;
	String cAnA;
	
	
	public pinForm() {
		super();
		NavCurrent(0);
		
		a4Disabled = "true";
		country = "???";
		typeOfCA = "Other";
		a26Disabled = "false";
		a38Disabled = "true";
		a47_48Disabled = "true";
		a48 = a52 = "EUR";
		a50_51_52Disabled = "true";
		a53 = "no";
		a54Disabled = "true";
		a61Disabled = a63Disabled = a65_66Disabled = "true";
		a95_96Disabled = "true";
		a98Disabled = "true";
		today = new Date();
	}
	
	public String choices(){
		String[] choices = getActivitiesSelected();
		for (int i=0; i<choices.length; i++)
			System.out.println(choices[i]);
		return "";
	}
	
	/**
	 * Implements constraint "1.1.2.3" number 1 and constraint "1.1.2.2"
	 * @param vce
	 */
	public void eventSelectContractType(ValueChangeEvent vce) {
		contractType = (String) vce.getNewValue();
		if (contractType.equals("Works")) {
			setA4Disabled("true");
			setA4Required("false");
		}
		else if (contractType.equals("Supplies")) {
			setA4Disabled("false");
			setA4Required("true");
			setA70(true);
			setA71(false);
		}
		else if (contractType.equals("Services")) {
			setA4Disabled("false");
			setA4Required("true");
			setA70(false);
			setA71(true);
		}
		else {
			setA4Disabled("true");
			setA4Required("false");
		}
	}
	
	/**
	 * Implements constraint "1.2.2.4"
	 * @param vce
	 */
	public void eventSelectTypeOfCA(ValueChangeEvent vce) {
		typeOfCA = (String) vce.getNewValue();
		if (typeOfCA.equals("Other"))
			setA26Disabled("false");
		else 
			setA26Disabled("true");
	}
	
	/**
	 * Implements constraint "1.2.2.5"
	 * @param vce
	 */
	public void eventSelectActivities(ValueChangeEvent vce) {
		activitiesSelected= (String[]) vce.getNewValue();
		for (int i=0; i<activitiesSelected.length; i++) {
			if (activitiesSelected[i].equals("Other"))
				setA38Disabled("false");
			else 
				setA38Disabled("true");
		}
	}
	
	/**
	 * Implements constraint "1.3.2.6", number 1
	 * @param vce
	 */
	public void eventSelectCost(ValueChangeEvent vce) {
		a46_a49 = (String) vce.getNewValue();
		if (a46_a49.equals("Option1")) {
			setA47_48Disabled("false");
			setA50_51_52Disabled("true");
		}
		else { 
			setA47_48Disabled("true");
			setA50_51_52Disabled("false");
		}
	}
	
	/**
	 * Implements constraint "1.3.2.6", number 2
	 * @param vce
	 */
	public void eventSelectLots(ValueChangeEvent vce) {
		a53 = (String) vce.getNewValue();
		if (a53.equals("yes"))
			setA54Disabled("false");
		else 
			setA54Disabled("true");
	}
	
	/**
	 * Implements constraint "1.3.2.6", number 2
	 * @param vce
	 */
	public void eventSelectDuration(ValueChangeEvent vce) {
		a60_a62_a64 = (String) vce.getNewValue();
		if (a60_a62_a64.equals("Duration in months"))
			setA61Disabled("false");
		else if (a60_a62_a64.equals("Duration in days"))
			setA63Disabled("false");
		else if (a60_a62_a64.equals("OR Scheduled date"))
			setA65_66Disabled("false");
	}
	
	/**
	 * Implements constraint "1.5.2.1"
	 * @param vce
	 */
	public void eventReservedContracts(ValueChangeEvent vce) {
		a94 = (String) vce.getNewValue();
		if (a94.equals("yes"))
			setA95_96Disabled("false");
		else 
			setA95_96Disabled("true");
	}
	
	public void eventSelectA97(ValueChangeEvent vce) {
		a97 = (String) vce.getNewValue();
		if (a97.equals("yes")) {
			setA98Disabled("false");
			setA98Required("true");
		}
		else { 
			setA98Disabled("true");
			setA98Required("false");
		}
	}
	
	public void validateA4 (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		Integer quantity2B = (Integer)value;
		if (quantity2B < 1) {
			FacesMessage message = new FacesMessage("The number entered is less than (1)!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
		else if (quantity2B > 999) {
			FacesMessage message = new FacesMessage("The number entered is greater than (999)!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void requiredCountry (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		String country = (String)value;
		if (country.equals("???")) {
			FacesMessage message = new FacesMessage("Country is an obligatory field!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void validateEmail (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		String email = (String)value;
		if (email.indexOf("@") < 0) {
			FacesMessage message = new FacesMessage("Invalid e-mail address!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void validateURL (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		String url = (String)value;
		//url1 = "/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix";
		//initially used but http://qq.com was error: 
                //String regex = "^((ftp|http(s?))\\:\\/\\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\\-\\.]+\\.(com|edu|gov|mil|net|org|biz|info|name|museum|gr|us|ca|uk)(\\:[0-9]+)*(/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\+&%\\$#\\=~_\\-]+))*$";
		
                String regex = "^((ftp|http(s?))\\:\\/\\/)?[a-zA-Z0-9\\-\\.]+\\.(com|edu|gov|mil|net|org|biz|info|name|museum|gr|us|ca|uk)(\\:[0-9]+)*(/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\+&%\\$#\\=~_\\-]+))*$";
                //String regex = "^(ftp|http[s]:\\/\\/)?([\\w\\-]+\\.)*[\\w\\-](\\:\\d+)?(/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\+&%\\$#\\=~_\\-]+))*$";
		if (!Pattern.matches(regex, url)) {
			FacesMessage message = new FacesMessage("Invalid URL!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void validateA54 (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		Integer a54 = (Integer)value;
		if (a54 < 1) {
			FacesMessage message = new FacesMessage("The number entered is less than (1)!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void requiredCategory (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		String category = (String)value;
		if (category.equals("??")) {
			FacesMessage message = new FacesMessage("Category is an obligatory field!");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void validateA51 (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		Double a51 = (Double)value;
		if (getA50() > a51) {
			FacesMessage message = new FacesMessage("The number entered is less than or equal to " + getA50());
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void validateA66 (FacesContext context, UIComponent toValidate, Object value) throws ValidatorException {
		Date a66 = (Date)value;
		Date a65 = getA65();
		if (a66.before(a65) || a66.equals(a65)) {
			FacesMessage message = new FacesMessage("Date in 'completion of works' must be after date 'start of works'");
			context.addMessage("pinForm", message);
			throw new ValidatorException(message);
		}
	}
	
	public void eventA65(ValueChangeEvent vce) {
		a65 = (Date) vce.getNewValue();
	}
	
	public void eventA66(ValueChangeEvent vce) {
		a66 = (Date) vce.getNewValue();
	}
	
	/**
	 * Implement constraint "1.3.2.4"
	 * 
	 */
	public void eventA50(ValueChangeEvent vce) {
		a50 = (Double) vce.getNewValue();
	}
	
	public void eventA51(ValueChangeEvent vce) {
		a51 = (Double) vce.getNewValue();
	}
	
	/**
	 * Implements constraint "1.2.2.6"
	 */
	public void showAnnexASectionI() {
		if(furtherInfo.equals("Annex A.I")) {
			setShowAnnexASectionI(true);
		}
		else 
			setShowAnnexASectionI(false);
	}
	
	public String showSectionI() {
		NavCurrent(1);
		String result = "failure";
		
		if(contractType.equals("Works")) {
			JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "CONTRACT_TYPE", "Works");
			result = "success";
		} 
		else if(contractType.equals("Supplies")) {
			if (a4 != null) {
				JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "CONTRACT_TYPE", "Supplies");
				JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "QUANTITY_2B", getA4().toString());
				result = "success";
			}
		}
		else if(contractType.equals("Services")) {
			if (a4 != null) {
				JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "CONTRACT_TYPE", "Services");
				JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "QUANTITY_2B", getA4().toString());
				result = "success";
			}
		}
		
		if (result == "failure") {
			FacesContext facesContext = FacesContext.getCurrentInstance();
			FacesMessage facesMessage = new FacesMessage("lalakis!");
			facesContext.addMessage("pinForm", facesMessage);
			JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "PRELIMINARY_QUESTIONS", "failure");
		}
		
		return result;
	}
	
	public String showSectionII() {
		showAnnexASectionI();
		
		NavCurrent(2);
		if(a5 != null && a6 != null && a7 != null && !country.equals("???") && furtherInfo != null) {	
			if (contractType.equals("Works")) {
				return "caseIIA";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				return "caseIIB";
			}
			else
				return "failure";
		} 
		else {
			FacesContext facesContext = FacesContext.getCurrentInstance();
			FacesMessage facesMessage = new FacesMessage("lalakis!");
			facesContext.addMessage("pinForm", facesMessage);
			JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "SECTION I", "failure");
			return "failure";
		}
	}

	public String showAnnexBSectionIII() {
		NavCurrent(3);
//		if(a45 != null) {//&& a59_90 != null) {	//&& cpv selection has been done
			
			if (a54 != null) {
				return "annexB";
			}
			return "sectionIII";
//		} 
//		else {
//			FacesContext facesContext = FacesContext.getCurrentInstance();
//			FacesMessage facesMessage = new FacesMessage("lalakis!");
//			facesContext.addMessage("pinForm", facesMessage);
//			JSFUtils.storeOnSession(FacesContext.getCurrentInstance(), "SECTION I", "failure");
//			return "failure";
//		}
	}
	
	public String showSectionIII() {
		NavCurrent(4);
		return "success";
	}

	public String showSectionVI() {
		NavCurrent(5);
		String result = "success"; 
		return result;
	}
	
	public String showAnnexAFinished() {
		NavCurrent(6);
		if(isShowAnnexASectionI() || isA103()) {	
			return "continue";
		} 
		else 
			return "finish";
	}

	public String showFinished() {
		return "finish";
	}

	public String gotoCPVpage () {
		
		return "gotoCPVpage";
	}
	
	public void ResetAll()
	{
		//set links
		link0="false";
		link1="false";
		link2A="false";
		link2B="false";
		linkAnB="false";
		link3="false";
		link4="false";
		linkAnA="false";
		
		//set text
		text0="false";
		text1="false";
		text2A="false";
		text2B="false";
		textAnB="false";
		text3="false";
		text4="false";
		textAnA="false";
		
		//set images
		v0="false";i0="true";c0="false";
		v1="false";i1="true";c1="false";
		v2A="false";i2A="false";c2A="false";
		v2B="false";i2B="false";c2B="false";
		vAnB="false";iAnB="false";cAnB="false";
		v3="false";i3="true";c3="false";
		v4="false";i4="true";c4="false";
		vAnA="false";iAnA="false";cAnA="false";
	}
	
	public void NavCurrent(int i)
	{
		ResetAll();
		if (i==0)	//initial state
		{
			link0="true";
			c0="true";
			i0="false";
			
			text1="true";
			text3="true";
			text4="true";
		}
		
		if (i==1)	//from Preliminary Questions decide next state
		{
			link1="true";
			v0="true";
			i0="false";
			
			c1="true";
			i1="false";
			
			link0="true";
			if (contractType.equals("Works")) {
				text2A="true";
				i2A="true";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				text2B="true";
				i2B="true";
			}
			text3="true";
			text4="true";
		}
		
		if (i==2)	//from Section I decide next state
		{
			v0="true";
			v1="true";
			
			i0="false";
			i1="false";
			
			link0="true";
			link1="true";
			if (contractType.equals("Works")) {
				link2A="true"; 
				c2A="true";
				i2A="false";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				link2B="true"; 
				c2B="true";
				i2B="false";
			}
			
			text3="true";
			text4="true";
			if(showAnnexASectionI) {
				textAnA="true";
				iAnA="true";
			}
		}
		
		if (i==3)	//from Section IIA or IIB decide next state
		{
			if (a54 != null) {
				if (a54 > 0) {
					linkAnB="true";
					cAnB="true";
					iAnB="false";
					text3="true";
				}
			}
			else {
				link3="true";
				c3="true";
				i3="false";
			}
			v0="true";
			v1="true";
			
			i0="false";
			i1="false";
			
			link0="true";
			link1="true";
			if (contractType.equals("Works")) {
				v2A="true";
				i2A="false";
				link2A="true";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				v2B="true";
				i2B="false";
				link2B="true";
			}
			
			text4="true";
			if(showAnnexASectionI) {
				textAnA="true";
				iAnA="true";
			}
		}
		
		if (i==4) //from Annex B decide next state 
		{
			link3="true";
			
			v0="true";
			v1="true";
			vAnB="true";
			
			i0="false";
			i1="false";
			iAnB="false";
			
			link0="true";
			link1="true";
			linkAnB="true";
			if (contractType.equals("Works")) {
				v2A="true";
				i2A="false";
				link2A="true";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				v2B="true";
				i2B="false";
				link2B="true";
			}
			c3="true";
			i3="false";
			
			text4="true";
			if(showAnnexASectionI) {
				textAnA="true";
				iAnA="true";
			}
		}
		
		if (i==5)	//from Section III decide next state
		{
			link4="true";
			
			v0="true";
			v1="true";
			v3="true";
			
			i0="false";
			i1="false";
			i3="false";
			
			link0="true";
			link1="true";
			link3="true";
			if (contractType.equals("Works")) {
				v2A="true";
				i2A="false";
				link2A="true";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				v2B="true";
				i2B="false";
				link2B="true";
			}
			if (a54 != null) {
				if (a54 > 0) {
					vAnB="true";
					iAnB="false";
					linkAnB="true";
				}
			}
			c4="true";
			i4="false";
			
			if(showAnnexASectionI) {
				textAnA="true";
				iAnA="true";
			}
			
		}
		
		if (i==6)	//from Section VI decide next state
		{
			v0="true";
			v1="true";
			v3="true";
			v4="true";
			
			i0="false";
			i1="false";
			i3="false";
			i4="false";
			
			link0="true";
			link1="true";
			link3="true";
			link4="true";
			if (contractType.equals("Works")) {
				v2A="true";
				i2A="false";
				link2A="true";
			}
			else if (contractType.equals("Supplies") || contractType.equals("Services")) {
				v2B="true";
				i2B="false";
				link2B="true";
			}
			if (a54 != null) {
				if (a54 > 0) {
					vAnB="true";
					iAnB="false";
					linkAnB="true";
				}
			}			
			if(isShowAnnexASectionI() || isA103()) {
				linkAnA="true";
				cAnA="true";
				iAnA="false";
			}
		}

	}
	
	
	public String getContractType() {
		return contractType;
	}

	public void setContractType(String contractType) {
		this.contractType = contractType;
	}
	
	public String getA4Disabled() {
		return a4Disabled;
	}

	public void setA4Disabled(String a4Disabled) {
		this.a4Disabled = a4Disabled;
	}
	
	public Integer getA4() {
		return a4;
	}

	public void setA4(Integer a4) {
		this.a4 = a4;
	}

	public String getA4Required() {
		return a4Required;
	}

	public void setA4Required(String required) {
		a4Required = required;
	}

	public String getFurtherInfo() {
		return furtherInfo;
	}

	public void setFurtherInfo(String furtherInfo) {
		this.furtherInfo = furtherInfo;
	}
	
	public boolean isShowAnnexASectionI() {
		return showAnnexASectionI;
	}

	public void setShowAnnexASectionI(boolean showAnnexASectionI) {
		this.showAnnexASectionI = showAnnexASectionI;
	}

	public String getA5() {
		return a5;
	}

	public void setA5(String a5) {
		this.a5 = a5;
	}

	public String getA6() {
		return a6;
	}

	public void setA6(String a6) {
		this.a6 = a6;
	}

	public String getA7() {
		return a7;
	}

	public void setA7(String a7) {
		this.a7 = a7;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getA9() {
		return a9;
	}

	public void setA9(String a9) {
		this.a9 = a9;
	}

	public String getA10() {
		return a10;
	}

	public void setA10(String a10) {
		this.a10 = a10;
	}

	public String getA11() {
		return a11;
	}

	public void setA11(String a11) {
		this.a11 = a11;
	}

	public String getA12() {
		return a12;
	}

	public void setA12(String a12) {
		this.a12 = a12;
	}
	
	public String getA13() {
		return a13;
	}

	public void setA13(String a13) {
		this.a13 = a13;
	}

	public String getA14() {
		return a14;
	}

	public void setA14(String a14) {
		this.a14 = a14;
	}

	public String getA15() {
		return a15;
	}

	public void setA15(String a15) {
		this.a15 = a15;
	}

	public String getA16() {
		return a16;
	}

	public void setA16(String a16) {
		this.a16 = a16;
	}

	public String getTypeOfCA() {
		return typeOfCA;
	}

	public void setTypeOfCA(String typeOfCA) {
		this.typeOfCA = typeOfCA;
	}

	public String[] getActivitiesSelected() {
		return activitiesSelected;
	}

	public void setActivitiesSelected(String[] activities) {
		activitiesSelected = activities;
	}

	public String getA26Disabled() {
		return a26Disabled;
	}

	public void setA26Disabled(String disabled) {
		a26Disabled = disabled;
	}
	
	public String getA38Disabled() {
		return a38Disabled;
	}

	public void setA38Disabled(String disabled) {
		a38Disabled = disabled;
	}

	public String getA26() {
		return a26;
	}

	public void setA26(String a26) {
		this.a26 = a26;
	}
	
	public String getA38() {
		return a38;
	}

	public void setA38(String a38) {
		this.a38 = a38;
	}

	public String getA39() {
		return a39;
	}

	public void setA39(String a39) {
		this.a39 = a39;
	}
	
	public String getA40() {
		return a40;
	}

	public void setA40(String a40) {
		this.a40 = a40;
	}

	public String getA41() {
		return a41;
	}

	public void setA41(String a41) {
		this.a41 = a41;
	}

	public String getA42() {
            java.lang.String cpvmaincode=(java.lang.String)org.ellectra.gui.utils.JSFUtils.retrieveOnSession(javax.faces.context.FacesContext.getCurrentInstance(), "NUTSFORPIN");
        // use variables session here
        a42=cpvmaincode;
		return a42;
	}

	public void setA42(String a42) {
		this.a42 = a42;
	}

	public String getA44() {
		return a44;
	}

	public void setA44(String a44) {
		this.a44 = a44;
	}

	public String getA45() {
		return a45;
	}

	public void setA45(String a45) {
		this.a45 = a45;
	}

	public String getA46_a49() {
		return a46_a49;
	}

	public void setA46_a49(String a46_a49) {
		this.a46_a49 = a46_a49;
	}

	public Double getA47() {
		return a47;
	}

	public void setA47(Double a47) {
		this.a47 = a47;
	}

	public String getA47_48Disabled() {
		return a47_48Disabled;
	}

	public void setA47_48Disabled(String disabled) {
		a47_48Disabled = disabled;
	}

	public String getA48() {
		return a48;
	}

	public void setA48(String a48) {
		this.a48 = a48;
	}

	public Double getA50() {
		return a50;
	}

	public void setA50(Double a50) {
		this.a50 = a50;
	}

	public String getA50_51_52Disabled() {
		return a50_51_52Disabled;
	}

	public void setA50_51_52Disabled(String disabled) {
		a50_51_52Disabled = disabled;
	}

	public Double getA51() {
		return a51;
	}

	public void setA51(Double a51) {
		this.a51 = a51;
	}

	public String getA52() {
		return a52;
	}

	public void setA52(String a52) {
		this.a52 = a52;
	}

	public String getA53() {
		return a53;
	}

	public void setA53(String a53) {
		this.a53 = a53;
	}

	public Integer getA54() {
		return a54;
	}

	public void setA54(Integer a54) {
		this.a54 = a54;
	}

	public String getA54Disabled() {
		return a54Disabled;
	}

	public void setA54Disabled(String disabled) {
		a54Disabled = disabled;
	}

	public String getA60_a62_a64() {
		return a60_a62_a64;
	}

	public void setA60_a62_a64(String a60_a62_a64) {
		this.a60_a62_a64 = a60_a62_a64;
	}

	public Double getA61() {
		return a61;
	}

	public void setA61(Double a61) {
		this.a61 = a61;
	}

	public String getA61Disabled() {
		return a61Disabled;
	}

	public void setA61Disabled(String disabled) {
		a61Disabled = disabled;
	}

	public Double getA63() {
		return a63;
	}

	public void setA63(Double a63) {
		this.a63 = a63;
	}

	public String getA63Disabled() {
		return a63Disabled;
	}

	public void setA63Disabled(String disabled) {
		a63Disabled = disabled;
	}

	public String getA65_66Disabled() {
		return a65_66Disabled;
	}

	public void setA65_66Disabled(String disabled) {
		a65_66Disabled = disabled;
	}

	public String getA67() {
		return a67;
	}

	public void setA67(String a67) {
		this.a67 = a67;
	}

	public String getA68() {
		return a68;
	}

	public void setA68(String a68) {
		this.a68 = a68;
	}

	
	public boolean isA70() {
		return a70;
	}

	public void setA70(boolean a70) {
		this.a70 = a70;
	}

	public boolean isA71() {
		return a71;
	}

	public void setA71(boolean a71) {
		this.a71 = a71;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getA73() {
		return a73;
	}

	public void setA73(String a73) {
		this.a73 = a73;
	}

	public String getA74() {
		return a74;
	}

	public void setA74(String a74) {
		this.a74 = a74;
	}

	public String getA93() {
		return a93;
	}

	public void setA93(String a93) {
		this.a93 = a93;
	}

	public String getA94() {
		return a94;
	}

	public void setA94(String a94) {
		this.a94 = a94;
	}

	public boolean isA95() {
		return a95;
	}

	public void setA95(boolean a95) {
		this.a95 = a95;
	}

	public boolean isA96() {
		return a96;
	}

	public void setA96(boolean a96) {
		this.a96 = a96;
	}

	public String getA95_96Disabled() {
		return a95_96Disabled;
	}

	public void setA95_96Disabled(String disabled) {
		a95_96Disabled = disabled;
	}

	public String getA97() {
		return a97;
	}

	public void setA97(String a97) {
		this.a97 = a97;
	}

	public String getA98() {
		return a98;
	}

	public void setA98(String a98) {
		this.a98 = a98;
	}

	public String getA98Disabled() {
		return a98Disabled;
	}

	public void setA98Disabled(String disabled) {
		a98Disabled = disabled;
	}

	public String getA98Required() {
		return a98Required;
	}

	public void setA98Required(String required) {
		a98Required = required;
	}

	public String getA99() {
		return a99;
	}

	public void setA99(String a99) {
		this.a99 = a99;
	}

	public String getA100() {
		return a100;
	}

	public void setA100(String a100) {
		this.a100 = a100;
	}

	public String getA101() {
		return a101;
	}

	public void setA101(String a101) {
		this.a101 = a101;
	}

	public String getA102() {
		return a102;
	}

	public void setA102(String a102) {
		this.a102 = a102;
	}

	public boolean isA103() {
		return a103;
	}

	public void setA103(boolean a103) {
		this.a103 = a103;
	}

	public Date getToday() {
		return today;
	}

	public void setToday(Date a104) {
		this.today = a104;
	}


	public annexA getA() {
		return a;
	}

	public void setA(annexA a) {
		this.a = a;
	}


	public Date getTest() {
		return test;
	}

	public void setTest(Date test) {
		this.test = test;
	}

	//Dates
	public Date getA59_90() {
		return a59_90;
	}

	public void setA59_90(Date a59_90) {
		this.a59_90 = a59_90;
	}

	public Date getA65() {
		return a65;
	}

	public void setA65(Date a65) {
		this.a65 = a65;
	}

	public Date getA66() {
		return a66;
	}

	public void setA66(Date a66) {
		this.a66 = a66;
	}

	
	//variables for navigation
	public String getLink0() {
		return link0;
	}

	public void setLink0(String link0) {
		this.link0 = link0;
	}

	public String getLink1() {
		return link1;
	}

	public void setLink1(String link1) {
		this.link1 = link1;
	}

	public String getLink2A() {
		return link2A;
	}

	public void setLink2A(String link2A) {
		this.link2A = link2A;
	}

	public String getLink2B() {
		return link2B;
	}

	public void setLink2B(String link2B) {
		this.link2B = link2B;
	}

	public String getLinkAnB() {
		return linkAnB;
	}

	public void setLinkAnB(String linkAnB) {
		this.linkAnB = linkAnB;
	}

	public String getLink3() {
		return link3;
	}

	public void setLink3(String link3) {
		this.link3 = link3;
	}

	public String getLink4() {
		return link4;
	}

	public void setLink4(String link4) {
		this.link4 = link4;
	}

	public String getLinkAnA() {
		return linkAnA;
	}

	public void setLinkAnA(String linkAnA) {
		this.linkAnA = linkAnA;
	}

	public String getText0() {
		return text0;
	}

	public void setText0(String text0) {
		this.text0 = text0;
	}

	public String getText1() {
		return text1;
	}

	public void setText1(String text1) {
		this.text1 = text1;
	}

	public String getText2A() {
		return text2A;
	}

	public void setText2A(String text2A) {
		this.text2A = text2A;
	}

	public String getText2B() {
		return text2B;
	}

	public void setText2B(String text2B) {
		this.text2B = text2B;
	}

	public String getTextAnB() {
		return textAnB;
	}

	public void setTextAnB(String textAnB) {
		this.textAnB = textAnB;
	}

	public String getText3() {
		return text3;
	}

	public void setText3(String text3) {
		this.text3 = text3;
	}

	public String getText4() {
		return text4;
	}

	public void setText4(String text4) {
		this.text4 = text4;
	}

	public String getTextAnA() {
		return textAnA;
	}

	public void setTextAnA(String textAnA) {
		this.textAnA = textAnA;
	}

	public String getV0() {
		return v0;
	}

	public void setV0(String v0) {
		this.v0 = v0;
	}

	public String getV1() {
		return v1;
	}

	public void setV1(String v1) {
		this.v1 = v1;
	}

	public String getV2A() {
		return v2A;
	}

	public void setV2A(String v2a) {
		v2A = v2a;
	}

	public String getV2B() {
		return v2B;
	}

	public void setV2B(String v2b) {
		v2B = v2b;
	}

	public String getVAnB() {
		return vAnB;
	}

	public void setVAnB(String anB) {
		vAnB = anB;
	}

	public String getV3() {
		return v3;
	}

	public void setV3(String v3) {
		this.v3 = v3;
	}

	public String getV4() {
		return v4;
	}

	public void setV4(String v4) {
		this.v4 = v4;
	}

	public String getVAnA() {
		return vAnA;
	}

	public void setVAnA(String anA) {
		vAnA = anA;
	}

	public String getI0() {
		return i0;
	}

	public void setI0(String i0) {
		this.i0 = i0;
	}

	public String getI1() {
		return i1;
	}

	public void setI1(String i1) {
		this.i1 = i1;
	}

	public String getI2A() {
		return i2A;
	}

	public void setI2A(String i2a) {
		i2A = i2a;
	}

	public String getI2B() {
		return i2B;
	}

	public void setI2B(String i2b) {
		i2B = i2b;
	}

	public String getIAnB() {
		return iAnB;
	}

	public void setIAnB(String anB) {
		iAnB = anB;
	}

	public String getI3() {
		return i3;
	}

	public void setI3(String i3) {
		this.i3 = i3;
	}

	public String getI4() {
		return i4;
	}

	public void setI4(String i4) {
		this.i4 = i4;
	}

	public String getIAnA() {
		return iAnA;
	}

	public void setIAnA(String anA) {
		iAnA = anA;
	}

	public String getC0() {
		return c0;
	}

	public void setC0(String c0) {
		this.c0 = c0;
	}

	public String getC1() {
		return c1;
	}

	public void setC1(String c1) {
		this.c1 = c1;
	}

	public String getC2A() {
		return c2A;
	}

	public void setC2A(String c2a) {
		c2A = c2a;
	}

	public String getC2B() {
		return c2B;
	}

	public void setC2B(String c2b) {
		c2B = c2b;
	}

	public String getCAnB() {
		return cAnB;
	}

	public void setCAnB(String anB) {
		cAnB = anB;
	}

	public String getC3() {
		return c3;
	}

	public void setC3(String c3) {
		this.c3 = c3;
	}

	public String getC4() {
		return c4;
	}

	public void setC4(String c4) {
		this.c4 = c4;
	}

	public String getCAnA() {
		return cAnA;
	}

	public void setCAnA(String anA) {
		cAnA = anA;
	}

    public String getCpv() {
        java.lang.String cpvmaincode=(java.lang.String)org.ellectra.gui.utils.JSFUtils.retrieveOnSession(javax.faces.context.FacesContext.getCurrentInstance(), "MAINCPVFORPIN");
        // use variables session here
        cpv=cpvmaincode;
        return cpv;
    }

    public void setCpv(String cpv) {
        this.cpv = cpv;
    }

    public String getNuts() {
        return nuts;
    }

    public void setNuts(String nuts) {
        this.nuts = nuts;
    }

    public String getVoc() {
        return voc;
    }

    public void setVoc(String voc) {
        this.voc = voc;
    }

    
    //private String szpath="c:\\";
    private String szpath = "/Users/gpa/epp_forms/";
    private String filename;//="p1.xml";

    private void formatFilename () {
        GregorianCalendar nowDate = new GregorianCalendar();
        String DATE_FORMAT2 = "dd-MM-yyyy HH:mm:ss";
        java.text.SimpleDateFormat sdf2 = new java.text.SimpleDateFormat(DATE_FORMAT2);
        sdf2.setTimeZone(TimeZone.getDefault());
        String formattedDate = sdf2.format(nowDate.getTime());
        
        filename = "PIN_" + formattedDate + ".xml";	
    }
	
	////////////
	/**
	 * @param args
	 */
	//public static void main(String[] args) {
		// TODO Auto-generated method stub
		//readmain();
	//}

	public String[] convertcsvstrtoarray(String dd)
	{
		String dd2[] = {"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""};
		dd2[0]="1";
		dd2[1]="1";
		int i=0;
		int ifound=0;
		ifound=dd.indexOf(",");
		System.out.println("Ifound = " + ifound);
		while(ifound!=-1)
		{
			dd2[i]=dd.substring(0, ifound);
			dd=dd.substring(ifound+1,dd.length());
			ifound=dd.indexOf(",");
			i=i+1;
			System.out.println("Ifound inloop= " + ifound);
		}
		return dd2;
	}
	public Date Convertstrtodate(String Datedd)
	{
		if (Datedd.equalsIgnoreCase("NA"))
			return null;
		//yyyyMMdd
		//@SuppressWarnings("unused")
		String dateString = Datedd;
	    
	    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
	    Date convertedDate = null;
		try {
			convertedDate = dateFormat.parse(Datedd);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			System.out.print("erro on str to date");
		}

	    System.out.println("Converted string to date : " + convertedDate); 
		return convertedDate;
	}
	
        
    public void readmain() {
		
		  
		  try {
                      
                  //formatFilename();
		  File file = new File(szpath+filename);
		  DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		  DocumentBuilder db = dbf.newDocumentBuilder();
		  Document doc = db.parse(file);
		  
		  doc.getDocumentElement().normalize();
		  System.out.println("Root element " + doc.getDocumentElement().getNodeName());
		  NodeList nodeLst = doc.getElementsByTagName("Record");
		  //System.out.println("Information of DM Informations");

		  for (int s = 0; s < nodeLst.getLength(); s++) {
			//rbhdmlist ditem = new rbhdmlist();
		    Node fstNode = nodeLst.item(s);
		    //System.out.println("Rank = "+fstNode.getAttributes().item(0).getNodeValue());
		    //ditem.setRank(fstNode.getAttributes().item(0).getNodeValue());
		    
		    if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
		  
		    	
		      Element fstElmnt = (Element) fstNode;
		      
		      NodeList lstNmElmntLst1 = fstElmnt.getElementsByTagName("test"); 
		      Element lstNmElmnt1 = (Element) lstNmElmntLst1.item(0);
		      NodeList lstNm1 = lstNmElmnt1.getChildNodes();
		      System.out.println("test : " + ((Node) lstNm1.item(0)).getNodeValue());
		      // convert the str to date
		      //test=((Node) lstNm1.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst2 = fstElmnt.getElementsByTagName("contractType"); 
		      Element lstNmElmnt2 = (Element) lstNmElmntLst2.item(0);
		      NodeList lstNm2 = lstNmElmnt2.getChildNodes();
		      System.out.println("contractType : " + ((Node) lstNm2.item(0)).getNodeValue());
		      contractType=((Node) lstNm2.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst3 = fstElmnt.getElementsByTagName("a4Disabled"); 
		      Element lstNmElmnt3 = (Element) lstNmElmntLst3.item(0);
		      NodeList lstNm3 = lstNmElmnt3.getChildNodes();
		      System.out.println("a4Disabled : " + ((Node) lstNm3.item(0)).getNodeValue());
		      a4Disabled=((Node) lstNm3.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst4 = fstElmnt.getElementsByTagName("a4"); 
		      Element lstNmElmnt4 = (Element) lstNmElmntLst4.item(0);
		      NodeList lstNm4 = lstNmElmnt4.getChildNodes();
		      System.out.println("a4 : " + ((Node) lstNm4.item(0)).getNodeValue());
		      a4=Integer.valueOf(((Node) lstNm4.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst5 = fstElmnt.getElementsByTagName("a4Required"); 
		      Element lstNmElmnt5 = (Element) lstNmElmntLst5.item(0);
		      NodeList lstNm5 = lstNmElmnt5.getChildNodes();
		      System.out.println("a4Required : " + ((Node) lstNm5.item(0)).getNodeValue());
		      a4Required=((Node) lstNm5.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst6 = fstElmnt.getElementsByTagName("a5"); 
		      Element lstNmElmnt6 = (Element) lstNmElmntLst6.item(0);
		      NodeList lstNm6 = lstNmElmnt6.getChildNodes();
		      System.out.println("a5 : " + ((Node) lstNm6.item(0)).getNodeValue());
		      a5=((Node) lstNm6.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst7 = fstElmnt.getElementsByTagName("a6"); 
		      Element lstNmElmnt7 = (Element) lstNmElmntLst7.item(0);
		      NodeList lstNm7 = lstNmElmnt7.getChildNodes();
		      System.out.println("a6 : " + ((Node) lstNm7.item(0)).getNodeValue());
		      a6=((Node) lstNm7.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst8 = fstElmnt.getElementsByTagName("a7"); 
		      Element lstNmElmnt8 = (Element) lstNmElmntLst8.item(0);
		      NodeList lstNm8 = lstNmElmnt8.getChildNodes();
		      System.out.println("a7 : " + ((Node) lstNm8.item(0)).getNodeValue());
		      a7=((Node) lstNm8.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst9 = fstElmnt.getElementsByTagName("country"); 
		      Element lstNmElmnt9 = (Element) lstNmElmntLst9.item(0);
		      NodeList lstNm9 = lstNmElmnt9.getChildNodes();
		      System.out.println("country : " + ((Node) lstNm9.item(0)).getNodeValue());
		      country=((Node) lstNm9.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst10 = fstElmnt.getElementsByTagName("a9"); 
		      Element lstNmElmnt10 = (Element) lstNmElmntLst10.item(0);
		      NodeList lstNm10 = lstNmElmnt10.getChildNodes();
		      System.out.println("a9 : " + ((Node) lstNm10.item(0)).getNodeValue());
		      a9=((Node) lstNm10.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst11 = fstElmnt.getElementsByTagName("a10"); 
		      Element lstNmElmnt11 = (Element) lstNmElmntLst11.item(0);
		      NodeList lstNm11 = lstNmElmnt11.getChildNodes();
		      System.out.println("a10 : " + ((Node) lstNm11.item(0)).getNodeValue());
		      a10=((Node) lstNm11.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst12 = fstElmnt.getElementsByTagName("a11"); 
		      Element lstNmElmnt12 = (Element) lstNmElmntLst12.item(0);
		      NodeList lstNm12 = lstNmElmnt12.getChildNodes();
		      System.out.println("a11 : " + ((Node) lstNm12.item(0)).getNodeValue());
		      a11=((Node) lstNm12.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst13 = fstElmnt.getElementsByTagName("a12"); 
		      Element lstNmElmnt13 = (Element) lstNmElmntLst13.item(0);
		      NodeList lstNm13 = lstNmElmnt13.getChildNodes();
		      System.out.println("a12 : " + ((Node) lstNm13.item(0)).getNodeValue());
		      a12=((Node) lstNm13.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst14 = fstElmnt.getElementsByTagName("a13"); 
		      Element lstNmElmnt14 = (Element) lstNmElmntLst14.item(0);
		      NodeList lstNm14 = lstNmElmnt14.getChildNodes();
		      System.out.println("a13 : " + ((Node) lstNm14.item(0)).getNodeValue());
		      a13=((Node) lstNm14.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst15 = fstElmnt.getElementsByTagName("a14"); 
		      Element lstNmElmnt15 = (Element) lstNmElmntLst15.item(0);
		      NodeList lstNm15 = lstNmElmnt15.getChildNodes();
		      System.out.println("a14 : " + ((Node) lstNm15.item(0)).getNodeValue());
		      a14=((Node) lstNm15.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst16 = fstElmnt.getElementsByTagName("a15"); 
		      Element lstNmElmnt16 = (Element) lstNmElmntLst16.item(0);
		      NodeList lstNm16 = lstNmElmnt16.getChildNodes();
		      System.out.println("a15 : " + ((Node) lstNm16.item(0)).getNodeValue());
		      a15=((Node) lstNm16.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst17 = fstElmnt.getElementsByTagName("a16"); 
		      Element lstNmElmnt17 = (Element) lstNmElmntLst17.item(0);
		      NodeList lstNm17 = lstNmElmnt17.getChildNodes();
		      System.out.println("a16 : " + ((Node) lstNm17.item(0)).getNodeValue());
		      a16=((Node) lstNm17.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst18 = fstElmnt.getElementsByTagName("furtherInfo"); 
		      Element lstNmElmnt18 = (Element) lstNmElmntLst18.item(0);
		      NodeList lstNm18 = lstNmElmnt18.getChildNodes();
		      System.out.println("furtherInfo : " + ((Node) lstNm18.item(0)).getNodeValue());
		      furtherInfo=((Node) lstNm18.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst19 = fstElmnt.getElementsByTagName("showAnnexASectionI"); 
		      Element lstNmElmnt19 = (Element) lstNmElmntLst19.item(0);
		      NodeList lstNm19 = lstNmElmnt19.getChildNodes();
		      System.out.println("showAnnexASectionI : " + ((Node) lstNm19.item(0)).getNodeValue());
		      showAnnexASectionI=Boolean.valueOf(((Node) lstNm19.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst20 = fstElmnt.getElementsByTagName("typeOfCA"); 
		      Element lstNmElmnt20 = (Element) lstNmElmntLst20.item(0);
		      NodeList lstNm20 = lstNmElmnt20.getChildNodes();
		      System.out.println("typeOfCA : " + ((Node) lstNm20.item(0)).getNodeValue());
		      typeOfCA=((Node) lstNm20.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst21 = fstElmnt.getElementsByTagName("activitiesSelected"); 
		      Element lstNmElmnt21 = (Element) lstNmElmntLst21.item(0);
		      NodeList lstNm21 = lstNmElmnt21.getChildNodes();
		      if (((Node) lstNm21.item(0)).getNodeValue().equalsIgnoreCase("NA"))
		      {}
		      else
		      {
		      System.out.println("activitiesSelected : " + ((Node) lstNm21.item(0)).getNodeValue());
		      //break s,s,s,s to s1 s2 s3 ....
		      activitiesSelected=convertcsvstrtoarray(((Node) lstNm21.item(0)).getNodeValue()); 
		      System.out.println("activitiesSelected0 : " + activitiesSelected[0]);
		      System.out.println("activitiesSelected1 : " + activitiesSelected[1]);
		      System.out.println("activitiesSelected2 : " + activitiesSelected[2]);
		      System.out.println("activitiesSelected3 : " + activitiesSelected[3]);
		      System.out.println("activitiesSelected4 : " + activitiesSelected[4]);
		      System.out.println("activitiesSelected5 : " + activitiesSelected[5]);
		      System.out.println("activitiesSelected6 : " + activitiesSelected[6]);
		      System.out.println("activitiesSelected7 : " + activitiesSelected[7]);
		      System.out.println("activitiesSelected8 : " + activitiesSelected[8]);
		      }
		      
		      NodeList lstNmElmntLst22 = fstElmnt.getElementsByTagName("a26"); 
		      Element lstNmElmnt22 = (Element) lstNmElmntLst22.item(0);
		      NodeList lstNm22 = lstNmElmnt22.getChildNodes();
		      System.out.println("a26 : " + ((Node) lstNm22.item(0)).getNodeValue());
		      a26=((Node) lstNm22.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst23 = fstElmnt.getElementsByTagName("a26Disabled"); 
		      Element lstNmElmnt23 = (Element) lstNmElmntLst23.item(0);
		      NodeList lstNm23 = lstNmElmnt23.getChildNodes();
		      System.out.println("a26Disabled : " + ((Node) lstNm23.item(0)).getNodeValue());
		      a26Disabled=((Node) lstNm23.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst24 = fstElmnt.getElementsByTagName("a38"); 
		      Element lstNmElmnt24 = (Element) lstNmElmntLst24.item(0);
		      NodeList lstNm24 = lstNmElmnt24.getChildNodes();
		      System.out.println("a38 : " + ((Node) lstNm24.item(0)).getNodeValue());
		      a38=((Node) lstNm24.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst25 = fstElmnt.getElementsByTagName("a38Disabled"); 
		      Element lstNmElmnt25 = (Element) lstNmElmntLst25.item(0);
		      NodeList lstNm25 = lstNmElmnt25.getChildNodes();
		      System.out.println("a38Disabled : " + ((Node) lstNm25.item(0)).getNodeValue());
		      a38Disabled=((Node) lstNm25.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst26 = fstElmnt.getElementsByTagName("a39"); 
		      Element lstNmElmnt26 = (Element) lstNmElmntLst26.item(0);
		      NodeList lstNm26 = lstNmElmnt26.getChildNodes();
		      System.out.println("a39 : " + ((Node) lstNm26.item(0)).getNodeValue());
		      a39=((Node) lstNm26.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst27 = fstElmnt.getElementsByTagName("cpv"); 
		      Element lstNmElmnt27 = (Element) lstNmElmntLst27.item(0);
		      NodeList lstNm27 = lstNmElmnt27.getChildNodes();
		      System.out.println("cpv : " + ((Node) lstNm27.item(0)).getNodeValue());
		      cpv=((Node) lstNm27.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst28 = fstElmnt.getElementsByTagName("nuts"); 
		      Element lstNmElmnt28 = (Element) lstNmElmntLst28.item(0);
		      NodeList lstNm28 = lstNmElmnt28.getChildNodes();
		      System.out.println("nuts : " + ((Node) lstNm28.item(0)).getNodeValue());
		      nuts=((Node) lstNm28.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst29 = fstElmnt.getElementsByTagName("voc"); 
		      Element lstNmElmnt29 = (Element) lstNmElmntLst29.item(0);
		      NodeList lstNm29 = lstNmElmnt29.getChildNodes();
		      System.out.println("voc : " + ((Node) lstNm29.item(0)).getNodeValue());
		      voc=((Node) lstNm29.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst30 = fstElmnt.getElementsByTagName("a40"); 
		      Element lstNmElmnt30 = (Element) lstNmElmntLst30.item(0);
		      NodeList lstNm30 = lstNmElmnt30.getChildNodes();
		      System.out.println("a40 : " + ((Node) lstNm30.item(0)).getNodeValue());
		      a40=((Node) lstNm30.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst31 = fstElmnt.getElementsByTagName("a41"); 
		      Element lstNmElmnt31 = (Element) lstNmElmntLst31.item(0);
		      NodeList lstNm31 = lstNmElmnt31.getChildNodes();
		      System.out.println("a41 : " + ((Node) lstNm31.item(0)).getNodeValue());
		      a41=((Node) lstNm31.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst32 = fstElmnt.getElementsByTagName("a42"); 
		      Element lstNmElmnt32 = (Element) lstNmElmntLst32.item(0);
		      NodeList lstNm32 = lstNmElmnt32.getChildNodes();
		      System.out.println("a42 : " + ((Node) lstNm32.item(0)).getNodeValue());
		      a42=((Node) lstNm32.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst33 = fstElmnt.getElementsByTagName("a44"); 
		      Element lstNmElmnt33 = (Element) lstNmElmntLst33.item(0);
		      NodeList lstNm33 = lstNmElmnt33.getChildNodes();
		      System.out.println("a44 : " + ((Node) lstNm33.item(0)).getNodeValue());
		      a44=((Node) lstNm33.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst34 = fstElmnt.getElementsByTagName("a45"); 
		      Element lstNmElmnt34 = (Element) lstNmElmntLst34.item(0);
		      NodeList lstNm34 = lstNmElmnt34.getChildNodes();
		      System.out.println("a45 : " + ((Node) lstNm34.item(0)).getNodeValue());
		      a45=((Node) lstNm34.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst35 = fstElmnt.getElementsByTagName("a46_a49"); 
		      Element lstNmElmnt35 = (Element) lstNmElmntLst35.item(0);
		      NodeList lstNm35 = lstNmElmnt35.getChildNodes();
		      System.out.println("a46_a49 : " + ((Node) lstNm35.item(0)).getNodeValue());
		      a46_a49=((Node) lstNm35.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst36 = fstElmnt.getElementsByTagName("a47"); 
		      Element lstNmElmnt36 = (Element) lstNmElmntLst36.item(0);
		      NodeList lstNm36 = lstNmElmnt36.getChildNodes();
		      System.out.println("a47 : " + ((Node) lstNm36.item(0)).getNodeValue());
		      if (!((Node) lstNm36.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a47=Double.valueOf(((Node) lstNm36.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst37 = fstElmnt.getElementsByTagName("a47_48Disabled"); 
		      Element lstNmElmnt37 = (Element) lstNmElmntLst37.item(0);
		      NodeList lstNm37 = lstNmElmnt37.getChildNodes();
		      System.out.println("a47_48Disabled : " + ((Node) lstNm37.item(0)).getNodeValue());
		      a47_48Disabled=((Node) lstNm37.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst38 = fstElmnt.getElementsByTagName("a48"); 
		      Element lstNmElmnt38 = (Element) lstNmElmntLst38.item(0);
		      NodeList lstNm38 = lstNmElmnt38.getChildNodes();
		      System.out.println("a48 : " + ((Node) lstNm38.item(0)).getNodeValue());
		      a48=((Node) lstNm38.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst39 = fstElmnt.getElementsByTagName("a50"); 
		      Element lstNmElmnt39 = (Element) lstNmElmntLst39.item(0);
		      NodeList lstNm39 = lstNmElmnt39.getChildNodes();
		      System.out.println("a50 : " + ((Node) lstNm39.item(0)).getNodeValue());
		      if (!((Node) lstNm39.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a50=Double.valueOf(((Node) lstNm39.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst40 = fstElmnt.getElementsByTagName("a50_51_52Disabled"); 
		      Element lstNmElmnt40 = (Element) lstNmElmntLst40.item(0);
		      NodeList lstNm40 = lstNmElmnt40.getChildNodes();
		      System.out.println("a50_51_52Disabled : " + ((Node) lstNm40.item(0)).getNodeValue());
		      a50_51_52Disabled=((Node) lstNm40.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst41 = fstElmnt.getElementsByTagName("a51"); 
		      Element lstNmElmnt41 = (Element) lstNmElmntLst41.item(0);
		      NodeList lstNm41 = lstNmElmnt41.getChildNodes();
		      System.out.println("a51 : " + ((Node) lstNm41.item(0)).getNodeValue());
		      if (!((Node) lstNm41.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a51=Double.valueOf(((Node) lstNm41.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst42 = fstElmnt.getElementsByTagName("a52"); 
		      Element lstNmElmnt42 = (Element) lstNmElmntLst42.item(0);
		      NodeList lstNm42 = lstNmElmnt42.getChildNodes();
		      System.out.println("a52 : " + ((Node) lstNm42.item(0)).getNodeValue());
		      a52=((Node) lstNm42.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst43 = fstElmnt.getElementsByTagName("a53"); 
		      Element lstNmElmnt43 = (Element) lstNmElmntLst43.item(0);
		      NodeList lstNm43 = lstNmElmnt43.getChildNodes();
		      System.out.println("a53 : " + ((Node) lstNm43.item(0)).getNodeValue());
		      a53=((Node) lstNm43.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst44 = fstElmnt.getElementsByTagName("a54"); 
		      Element lstNmElmnt44 = (Element) lstNmElmntLst44.item(0);
		      NodeList lstNm44 = lstNmElmnt44.getChildNodes();
		      System.out.println("a54 : " + ((Node) lstNm44.item(0)).getNodeValue());
		      if (!((Node) lstNm44.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a54=Integer.valueOf(((Node) lstNm44.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst45 = fstElmnt.getElementsByTagName("a54Disabled"); 
		      Element lstNmElmnt45 = (Element) lstNmElmntLst45.item(0);
		      NodeList lstNm45 = lstNmElmnt45.getChildNodes();
		      System.out.println("a54Disabled : " + ((Node) lstNm45.item(0)).getNodeValue());
		      a54Disabled=((Node) lstNm45.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst46 = fstElmnt.getElementsByTagName("a60_a62_a64"); 
		      Element lstNmElmnt46 = (Element) lstNmElmntLst46.item(0);
		      NodeList lstNm46 = lstNmElmnt46.getChildNodes();
		      System.out.println("a60_a62_a64 : " + ((Node) lstNm46.item(0)).getNodeValue());
		      a60_a62_a64=((Node) lstNm46.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst47 = fstElmnt.getElementsByTagName("a61"); 
		      Element lstNmElmnt47 = (Element) lstNmElmntLst47.item(0);
		      NodeList lstNm47 = lstNmElmnt47.getChildNodes();
		      System.out.println("a61 : " + ((Node) lstNm47.item(0)).getNodeValue());
		      if (!((Node) lstNm47.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a61=Double.valueOf(((Node) lstNm47.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst48 = fstElmnt.getElementsByTagName("a61Disabled"); 
		      Element lstNmElmnt48 = (Element) lstNmElmntLst48.item(0);
		      NodeList lstNm48 = lstNmElmnt48.getChildNodes();
		      System.out.println("a61Disabled : " + ((Node) lstNm48.item(0)).getNodeValue());
		      a61Disabled=((Node) lstNm48.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst49 = fstElmnt.getElementsByTagName("a63"); 
		      Element lstNmElmnt49 = (Element) lstNmElmntLst49.item(0);
		      NodeList lstNm49 = lstNmElmnt49.getChildNodes();
		      System.out.println("a63 : " + ((Node) lstNm49.item(0)).getNodeValue());
		      if (!((Node) lstNm49.item(0)).getNodeValue().equalsIgnoreCase("null"))
		      a63=Double.valueOf(((Node) lstNm49.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst50 = fstElmnt.getElementsByTagName("a63Disabled"); 
		      Element lstNmElmnt50 = (Element) lstNmElmntLst50.item(0);
		      NodeList lstNm50 = lstNmElmnt50.getChildNodes();
		      System.out.println("a63Disabled : " + ((Node) lstNm50.item(0)).getNodeValue());
		      a63Disabled=((Node) lstNm50.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst51 = fstElmnt.getElementsByTagName("a65_66Disabled"); 
		      Element lstNmElmnt51 = (Element) lstNmElmntLst51.item(0);
		      NodeList lstNm51 = lstNmElmnt51.getChildNodes();
		      System.out.println("a65_66Disabled : " + ((Node) lstNm51.item(0)).getNodeValue());
		      a65_66Disabled=((Node) lstNm51.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst52 = fstElmnt.getElementsByTagName("a67"); 
		      Element lstNmElmnt52 = (Element) lstNmElmntLst52.item(0);
		      NodeList lstNm52 = lstNmElmnt52.getChildNodes();
		      System.out.println("a67 : " + ((Node) lstNm52.item(0)).getNodeValue());
		      a67=((Node) lstNm52.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst53 = fstElmnt.getElementsByTagName("a68"); 
		      Element lstNmElmnt53 = (Element) lstNmElmntLst53.item(0);
		      NodeList lstNm53 = lstNmElmnt53.getChildNodes();
		      System.out.println("a68 : " + ((Node) lstNm53.item(0)).getNodeValue());
		      a68=((Node) lstNm53.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst54 = fstElmnt.getElementsByTagName("a70"); 
		      Element lstNmElmnt54 = (Element) lstNmElmntLst54.item(0);
		      NodeList lstNm54 = lstNmElmnt54.getChildNodes();
		      System.out.println("a70 : " + ((Node) lstNm54.item(0)).getNodeValue());
		      a70=Boolean.valueOf(((Node) lstNm54.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst55 = fstElmnt.getElementsByTagName("a71"); 
		      Element lstNmElmnt55 = (Element) lstNmElmntLst55.item(0);
		      NodeList lstNm55 = lstNmElmnt55.getChildNodes();
		      System.out.println("a71 : " + ((Node) lstNm55.item(0)).getNodeValue());
		      a71=Boolean.valueOf(((Node) lstNm55.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst56 = fstElmnt.getElementsByTagName("category"); 
		      Element lstNmElmnt56 = (Element) lstNmElmntLst56.item(0);
		      NodeList lstNm56 = lstNmElmnt56.getChildNodes();
		      System.out.println("category : " + ((Node) lstNm56.item(0)).getNodeValue());
		      category=((Node) lstNm56.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst57 = fstElmnt.getElementsByTagName("a73"); 
		      Element lstNmElmnt57 = (Element) lstNmElmntLst57.item(0);
		      NodeList lstNm57 = lstNmElmnt57.getChildNodes();
		      System.out.println("a73 : " + ((Node) lstNm57.item(0)).getNodeValue());
		      a73=((Node) lstNm57.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst58 = fstElmnt.getElementsByTagName("a74"); 
		      Element lstNmElmnt58 = (Element) lstNmElmntLst58.item(0);
		      NodeList lstNm58 = lstNmElmnt58.getChildNodes();
		      System.out.println("a74 : " + ((Node) lstNm58.item(0)).getNodeValue());
		      a74=((Node) lstNm58.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst59 = fstElmnt.getElementsByTagName("a93"); 
		      Element lstNmElmnt59 = (Element) lstNmElmntLst59.item(0);
		      NodeList lstNm59 = lstNmElmnt59.getChildNodes();
		      System.out.println("a93 : " + ((Node) lstNm59.item(0)).getNodeValue());
		      a93=((Node) lstNm59.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst60 = fstElmnt.getElementsByTagName("a94"); 
		      Element lstNmElmnt60 = (Element) lstNmElmntLst60.item(0);
		      NodeList lstNm60 = lstNmElmnt60.getChildNodes();
		      System.out.println("a94 : " + ((Node) lstNm60.item(0)).getNodeValue());
		      a94=((Node) lstNm60.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst61 = fstElmnt.getElementsByTagName("a95"); 
		      Element lstNmElmnt61 = (Element) lstNmElmntLst61.item(0);
		      NodeList lstNm61 = lstNmElmnt61.getChildNodes();
		      System.out.println("a95 : " + ((Node) lstNm61.item(0)).getNodeValue());
		      a95=Boolean.valueOf(((Node) lstNm61.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst62 = fstElmnt.getElementsByTagName("a96"); 
		      Element lstNmElmnt62 = (Element) lstNmElmntLst62.item(0);
		      NodeList lstNm62 = lstNmElmnt62.getChildNodes();
		      System.out.println("a96 : " + ((Node) lstNm62.item(0)).getNodeValue());
		      a96=Boolean.valueOf(((Node) lstNm62.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst63 = fstElmnt.getElementsByTagName("a95_96Disabled"); 
		      Element lstNmElmnt63 = (Element) lstNmElmntLst63.item(0);
		      NodeList lstNm63 = lstNmElmnt63.getChildNodes();
		      System.out.println("a95_96Disabled : " + ((Node) lstNm63.item(0)).getNodeValue());
		      a95_96Disabled=((Node) lstNm63.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst64 = fstElmnt.getElementsByTagName("a97"); 
		      Element lstNmElmnt64 = (Element) lstNmElmntLst64.item(0);
		      NodeList lstNm64 = lstNmElmnt64.getChildNodes();
		      System.out.println("a97 : " + ((Node) lstNm64.item(0)).getNodeValue());
		      a97=((Node) lstNm64.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst65 = fstElmnt.getElementsByTagName("a98"); 
		      Element lstNmElmnt65 = (Element) lstNmElmntLst65.item(0);
		      NodeList lstNm65 = lstNmElmnt65.getChildNodes();
		      System.out.println("a98 : " + ((Node) lstNm65.item(0)).getNodeValue());
		      a98=((Node) lstNm65.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst66 = fstElmnt.getElementsByTagName("a98Disabled"); 
		      Element lstNmElmnt66 = (Element) lstNmElmntLst66.item(0);
		      NodeList lstNm66 = lstNmElmnt66.getChildNodes();
		      System.out.println("a98Disabled : " + ((Node) lstNm66.item(0)).getNodeValue());
		      a98Disabled=((Node) lstNm66.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst67 = fstElmnt.getElementsByTagName("a98Required"); 
		      Element lstNmElmnt67 = (Element) lstNmElmntLst67.item(0);
		      NodeList lstNm67 = lstNmElmnt67.getChildNodes();
		      System.out.println("a98Required : " + ((Node) lstNm67.item(0)).getNodeValue());
		      a98Required=((Node) lstNm67.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst68 = fstElmnt.getElementsByTagName("a99"); 
		      Element lstNmElmnt68 = (Element) lstNmElmntLst68.item(0);
		      NodeList lstNm68 = lstNmElmnt68.getChildNodes();
		      System.out.println("a99 : " + ((Node) lstNm68.item(0)).getNodeValue());
		      a99=((Node) lstNm68.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst69 = fstElmnt.getElementsByTagName("a100"); 
		      Element lstNmElmnt69 = (Element) lstNmElmntLst69.item(0);
		      NodeList lstNm69 = lstNmElmnt69.getChildNodes();
		      System.out.println("a100 : " + ((Node) lstNm69.item(0)).getNodeValue());
		      a100=((Node) lstNm69.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst70 = fstElmnt.getElementsByTagName("a101"); 
		      Element lstNmElmnt70 = (Element) lstNmElmntLst70.item(0);
		      NodeList lstNm70 = lstNmElmnt70.getChildNodes();
		      System.out.println("a101 : " + ((Node) lstNm70.item(0)).getNodeValue());
		      a101=((Node) lstNm70.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst71 = fstElmnt.getElementsByTagName("a102"); 
		      Element lstNmElmnt71 = (Element) lstNmElmntLst71.item(0);
		      NodeList lstNm71 = lstNmElmnt71.getChildNodes();
		      System.out.println("a102 : " + ((Node) lstNm71.item(0)).getNodeValue());
		      a102=((Node) lstNm71.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst72 = fstElmnt.getElementsByTagName("a103"); 
		      Element lstNmElmnt72 = (Element) lstNmElmntLst72.item(0);
		      NodeList lstNm72 = lstNmElmnt72.getChildNodes();
		      System.out.println("a103 : " + ((Node) lstNm72.item(0)).getNodeValue());
		      a103=Boolean.valueOf(((Node) lstNm72.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst73 = fstElmnt.getElementsByTagName("today"); 
		      Element lstNmElmnt73 = (Element) lstNmElmntLst73.item(0);
		      NodeList lstNm73 = lstNmElmnt73.getChildNodes();
		      System.out.println("today : " + ((Node) lstNm73.item(0)).getNodeValue());
		      // str to date
		      
		    	  today=Convertstrtodate(((Node) lstNm73.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst74 = fstElmnt.getElementsByTagName("a59_90"); 
		      Element lstNmElmnt74 = (Element) lstNmElmntLst74.item(0);
		      NodeList lstNm74 = lstNmElmnt74.getChildNodes();
		      System.out.println("a59_90 : " + ((Node) lstNm74.item(0)).getNodeValue());
		   // str to date
		      a59_90=Convertstrtodate(((Node) lstNm74.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst75 = fstElmnt.getElementsByTagName("a65"); 
		      Element lstNmElmnt75 = (Element) lstNmElmntLst75.item(0);
		      NodeList lstNm75 = lstNmElmnt75.getChildNodes();
		      System.out.println("a65 : " + ((Node) lstNm75.item(0)).getNodeValue());
		   // str to date
		      a65=Convertstrtodate(((Node) lstNm75.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst76 = fstElmnt.getElementsByTagName("a66"); 
		      Element lstNmElmnt76 = (Element) lstNmElmntLst76.item(0);
		      NodeList lstNm76 = lstNmElmnt76.getChildNodes();
		      System.out.println("a66 : " + ((Node) lstNm76.item(0)).getNodeValue());
		   // str to date
		      a66=Convertstrtodate(((Node) lstNm76.item(0)).getNodeValue()); 

		      NodeList lstNmElmntLst77 = fstElmnt.getElementsByTagName("link0"); 
		      Element lstNmElmnt77 = (Element) lstNmElmntLst77.item(0);
		      NodeList lstNm77 = lstNmElmnt77.getChildNodes();
		      System.out.println("link0 : " + ((Node) lstNm77.item(0)).getNodeValue());
		      link0=((Node) lstNm77.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst78 = fstElmnt.getElementsByTagName("link1"); 
		      Element lstNmElmnt78 = (Element) lstNmElmntLst78.item(0);
		      NodeList lstNm78 = lstNmElmnt78.getChildNodes();
		      System.out.println("link1 : " + ((Node) lstNm78.item(0)).getNodeValue());
		      link1=((Node) lstNm78.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst79 = fstElmnt.getElementsByTagName("link2A"); 
		      Element lstNmElmnt79 = (Element) lstNmElmntLst79.item(0);
		      NodeList lstNm79 = lstNmElmnt79.getChildNodes();
		      System.out.println("link2A : " + ((Node) lstNm79.item(0)).getNodeValue());
		      link2A=((Node) lstNm79.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst80 = fstElmnt.getElementsByTagName("link2B"); 
		      Element lstNmElmnt80 = (Element) lstNmElmntLst80.item(0);
		      NodeList lstNm80 = lstNmElmnt80.getChildNodes();
		      System.out.println("link2B : " + ((Node) lstNm80.item(0)).getNodeValue());
		      link2B=((Node) lstNm80.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst81 = fstElmnt.getElementsByTagName("linkAnB"); 
		      Element lstNmElmnt81 = (Element) lstNmElmntLst81.item(0);
		      NodeList lstNm81 = lstNmElmnt81.getChildNodes();
		      System.out.println("linkAnB : " + ((Node) lstNm81.item(0)).getNodeValue());
		      linkAnB=((Node) lstNm81.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst82 = fstElmnt.getElementsByTagName("link3"); 
		      Element lstNmElmnt82 = (Element) lstNmElmntLst82.item(0);
		      NodeList lstNm82 = lstNmElmnt82.getChildNodes();
		      System.out.println("link3 : " + ((Node) lstNm82.item(0)).getNodeValue());
		      link3=((Node) lstNm82.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst83 = fstElmnt.getElementsByTagName("link4"); 
		      Element lstNmElmnt83 = (Element) lstNmElmntLst83.item(0);
		      NodeList lstNm83 = lstNmElmnt83.getChildNodes();
		      System.out.println("link4 : " + ((Node) lstNm83.item(0)).getNodeValue());
		      link4=((Node) lstNm83.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst84 = fstElmnt.getElementsByTagName("linkAnA"); 
		      Element lstNmElmnt84 = (Element) lstNmElmntLst84.item(0);
		      NodeList lstNm84 = lstNmElmnt84.getChildNodes();
		      System.out.println("linkAnA : " + ((Node) lstNm84.item(0)).getNodeValue());
		      linkAnA=((Node) lstNm84.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst85 = fstElmnt.getElementsByTagName("text0"); 
		      Element lstNmElmnt85 = (Element) lstNmElmntLst85.item(0);
		      NodeList lstNm85 = lstNmElmnt85.getChildNodes();
		      System.out.println("text0 : " + ((Node) lstNm85.item(0)).getNodeValue());
		      text0=((Node) lstNm85.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst86 = fstElmnt.getElementsByTagName("text1"); 
		      Element lstNmElmnt86 = (Element) lstNmElmntLst86.item(0);
		      NodeList lstNm86 = lstNmElmnt86.getChildNodes();
		      System.out.println("text1 : " + ((Node) lstNm86.item(0)).getNodeValue());
		      text1=((Node) lstNm86.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst87 = fstElmnt.getElementsByTagName("text2A"); 
		      Element lstNmElmnt87 = (Element) lstNmElmntLst87.item(0);
		      NodeList lstNm87 = lstNmElmnt87.getChildNodes();
		      System.out.println("text2A : " + ((Node) lstNm87.item(0)).getNodeValue());
		      text2A=((Node) lstNm87.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst88 = fstElmnt.getElementsByTagName("text2B"); 
		      Element lstNmElmnt88 = (Element) lstNmElmntLst88.item(0);
		      NodeList lstNm88 = lstNmElmnt88.getChildNodes();
		      System.out.println("text2B : " + ((Node) lstNm88.item(0)).getNodeValue());
		      text2B=((Node) lstNm88.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst89 = fstElmnt.getElementsByTagName("textAnB"); 
		      Element lstNmElmnt89 = (Element) lstNmElmntLst89.item(0);
		      NodeList lstNm89 = lstNmElmnt89.getChildNodes();
		      System.out.println("textAnB : " + ((Node) lstNm89.item(0)).getNodeValue());
		      textAnB=((Node) lstNm89.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst90 = fstElmnt.getElementsByTagName("text3"); 
		      Element lstNmElmnt90 = (Element) lstNmElmntLst90.item(0);
		      NodeList lstNm90 = lstNmElmnt90.getChildNodes();
		      System.out.println("text3 : " + ((Node) lstNm90.item(0)).getNodeValue());
		      text3=((Node) lstNm90.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst91 = fstElmnt.getElementsByTagName("text4"); 
		      Element lstNmElmnt91 = (Element) lstNmElmntLst91.item(0);
		      NodeList lstNm91 = lstNmElmnt91.getChildNodes();
		      System.out.println("text4 : " + ((Node) lstNm91.item(0)).getNodeValue());
		      text4=((Node) lstNm91.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst92 = fstElmnt.getElementsByTagName("textAnA"); 
		      Element lstNmElmnt92 = (Element) lstNmElmntLst92.item(0);
		      NodeList lstNm92 = lstNmElmnt92.getChildNodes();
		      System.out.println("textAnA : " + ((Node) lstNm92.item(0)).getNodeValue());
		      textAnA=((Node) lstNm92.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst93 = fstElmnt.getElementsByTagName("v0"); 
		      Element lstNmElmnt93 = (Element) lstNmElmntLst93.item(0);
		      NodeList lstNm93 = lstNmElmnt93.getChildNodes();
		      System.out.println("v0 : " + ((Node) lstNm93.item(0)).getNodeValue());
		      v0=((Node) lstNm93.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst94 = fstElmnt.getElementsByTagName("v1"); 
		      Element lstNmElmnt94 = (Element) lstNmElmntLst94.item(0);
		      NodeList lstNm94 = lstNmElmnt94.getChildNodes();
		      System.out.println("v1 : " + ((Node) lstNm94.item(0)).getNodeValue());
		      v1=((Node) lstNm94.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst95 = fstElmnt.getElementsByTagName("v2A"); 
		      Element lstNmElmnt95 = (Element) lstNmElmntLst95.item(0);
		      NodeList lstNm95 = lstNmElmnt95.getChildNodes();
		      System.out.println("v2A : " + ((Node) lstNm95.item(0)).getNodeValue());
		      v2A=((Node) lstNm95.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst96 = fstElmnt.getElementsByTagName("v2B"); 
		      Element lstNmElmnt96 = (Element) lstNmElmntLst96.item(0);
		      NodeList lstNm96 = lstNmElmnt96.getChildNodes();
		      System.out.println("v2B : " + ((Node) lstNm96.item(0)).getNodeValue());
		      v2B=((Node) lstNm96.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst97 = fstElmnt.getElementsByTagName("vAnB"); 
		      Element lstNmElmnt97 = (Element) lstNmElmntLst97.item(0);
		      NodeList lstNm97 = lstNmElmnt97.getChildNodes();
		      System.out.println("vAnB : " + ((Node) lstNm97.item(0)).getNodeValue());
		      vAnB=((Node) lstNm97.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst98 = fstElmnt.getElementsByTagName("v3"); 
		      Element lstNmElmnt98 = (Element) lstNmElmntLst98.item(0);
		      NodeList lstNm98 = lstNmElmnt98.getChildNodes();
		      System.out.println("v3 : " + ((Node) lstNm98.item(0)).getNodeValue());
		      v3=((Node) lstNm98.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst99 = fstElmnt.getElementsByTagName("v4"); 
		      Element lstNmElmnt99 = (Element) lstNmElmntLst99.item(0);
		      NodeList lstNm99 = lstNmElmnt99.getChildNodes();
		      System.out.println("v4 : " + ((Node) lstNm99.item(0)).getNodeValue());
		      v4=((Node) lstNm99.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst100 = fstElmnt.getElementsByTagName("vAnA"); 
		      Element lstNmElmnt100 = (Element) lstNmElmntLst100.item(0);
		      NodeList lstNm100 = lstNmElmnt100.getChildNodes();
		      System.out.println("vAnA : " + ((Node) lstNm100.item(0)).getNodeValue());
		      vAnA=((Node) lstNm100.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst101 = fstElmnt.getElementsByTagName("i0"); 
		      Element lstNmElmnt101 = (Element) lstNmElmntLst101.item(0);
		      NodeList lstNm101 = lstNmElmnt101.getChildNodes();
		      System.out.println("i0 : " + ((Node) lstNm101.item(0)).getNodeValue());
		      i0=((Node) lstNm101.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst102 = fstElmnt.getElementsByTagName("i1"); 
		      Element lstNmElmnt102 = (Element) lstNmElmntLst102.item(0);
		      NodeList lstNm102 = lstNmElmnt102.getChildNodes();
		      System.out.println("i1 : " + ((Node) lstNm102.item(0)).getNodeValue());
		      i1=((Node) lstNm102.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst103 = fstElmnt.getElementsByTagName("i2A"); 
		      Element lstNmElmnt103 = (Element) lstNmElmntLst103.item(0);
		      NodeList lstNm103 = lstNmElmnt103.getChildNodes();
		      System.out.println("i2A : " + ((Node) lstNm103.item(0)).getNodeValue());
		      i2A=((Node) lstNm103.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst104 = fstElmnt.getElementsByTagName("i2B"); 
		      Element lstNmElmnt104 = (Element) lstNmElmntLst104.item(0);
		      NodeList lstNm104 = lstNmElmnt104.getChildNodes();
		      System.out.println("i2B : " + ((Node) lstNm104.item(0)).getNodeValue());
		      i2B=((Node) lstNm104.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst105 = fstElmnt.getElementsByTagName("iAnB"); 
		      Element lstNmElmnt105 = (Element) lstNmElmntLst105.item(0);
		      NodeList lstNm105 = lstNmElmnt105.getChildNodes();
		      System.out.println("iAnB : " + ((Node) lstNm105.item(0)).getNodeValue());
		      iAnB=((Node) lstNm105.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst106 = fstElmnt.getElementsByTagName("i3"); 
		      Element lstNmElmnt106 = (Element) lstNmElmntLst106.item(0);
		      NodeList lstNm106 = lstNmElmnt106.getChildNodes();
		      System.out.println("i3 : " + ((Node) lstNm106.item(0)).getNodeValue());
		      i3=((Node) lstNm106.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst107 = fstElmnt.getElementsByTagName("i4"); 
		      Element lstNmElmnt107 = (Element) lstNmElmntLst107.item(0);
		      NodeList lstNm107 = lstNmElmnt107.getChildNodes();
		      System.out.println("i4 : " + ((Node) lstNm107.item(0)).getNodeValue());
		      i4=((Node) lstNm107.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst108 = fstElmnt.getElementsByTagName("iAnA"); 
		      Element lstNmElmnt108 = (Element) lstNmElmntLst108.item(0);
		      NodeList lstNm108 = lstNmElmnt108.getChildNodes();
		      System.out.println("iAnA : " + ((Node) lstNm108.item(0)).getNodeValue());
		      iAnA=((Node) lstNm108.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst109 = fstElmnt.getElementsByTagName("c0"); 
		      Element lstNmElmnt109 = (Element) lstNmElmntLst109.item(0);
		      NodeList lstNm109 = lstNmElmnt109.getChildNodes();
		      System.out.println("c0 : " + ((Node) lstNm109.item(0)).getNodeValue());
		      c0=((Node) lstNm109.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst110 = fstElmnt.getElementsByTagName("c1"); 
		      Element lstNmElmnt110 = (Element) lstNmElmntLst110.item(0);
		      NodeList lstNm110 = lstNmElmnt110.getChildNodes();
		      System.out.println("c1 : " + ((Node) lstNm110.item(0)).getNodeValue());
		      c1=((Node) lstNm110.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst111 = fstElmnt.getElementsByTagName("c2A"); 
		      Element lstNmElmnt111 = (Element) lstNmElmntLst111.item(0);
		      NodeList lstNm111 = lstNmElmnt111.getChildNodes();
		      System.out.println("c2A : " + ((Node) lstNm111.item(0)).getNodeValue());
		      c2A=((Node) lstNm111.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst112 = fstElmnt.getElementsByTagName("c2B"); 
		      Element lstNmElmnt112 = (Element) lstNmElmntLst112.item(0);
		      NodeList lstNm112 = lstNmElmnt112.getChildNodes();
		      System.out.println("c2B : " + ((Node) lstNm112.item(0)).getNodeValue());
		      c2B=((Node) lstNm112.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst113 = fstElmnt.getElementsByTagName("cAnB"); 
		      Element lstNmElmnt113 = (Element) lstNmElmntLst113.item(0);
		      NodeList lstNm113 = lstNmElmnt113.getChildNodes();
		      System.out.println("cAnB : " + ((Node) lstNm113.item(0)).getNodeValue());
		      cAnB=((Node) lstNm113.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst114 = fstElmnt.getElementsByTagName("c3"); 
		      Element lstNmElmnt114 = (Element) lstNmElmntLst114.item(0);
		      NodeList lstNm114 = lstNmElmnt114.getChildNodes();
		      System.out.println("c3 : " + ((Node) lstNm114.item(0)).getNodeValue());
		      c3=((Node) lstNm114.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst115 = fstElmnt.getElementsByTagName("c4"); 
		      Element lstNmElmnt115 = (Element) lstNmElmntLst115.item(0);
		      NodeList lstNm115 = lstNmElmnt115.getChildNodes();
		      System.out.println("c4 : " + ((Node) lstNm115.item(0)).getNodeValue());
		      c4=((Node) lstNm115.item(0)).getNodeValue(); 

		      NodeList lstNmElmntLst116 = fstElmnt.getElementsByTagName("cAnA"); 
		      Element lstNmElmnt116 = (Element) lstNmElmntLst116.item(0);
		      NodeList lstNm116 = lstNmElmnt116.getChildNodes();
		      System.out.println("cAnA : " + ((Node) lstNm116.item(0)).getNodeValue());
		      cAnA=((Node) lstNm116.item(0)).getNodeValue(); 



		      
		    }// if ends
		    //dList.add(ditem);
		  }//for ends
		  }//try ends
		  catch (Exception e) {
		    System.out.print("Error"+e.getMessage());
		  }
		 }
    
    //WRITER
    private void saveTextFile(String contents, java.io.File file) throws java.io.IOException {
	 	  java.io.PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(file));
		  out.print(contents);
		  out.close();
	  }
	
	
	public String convdatetostr(Date dd)
	{
	 
	 
            SimpleDateFormat dateformatYYYYMMDD = new SimpleDateFormat("yyyyMMdd");


            StringBuilder nowYYYYMMDD = new StringBuilder( dateformatYYYYMMDD.format( dd ) );


           // System.out.println( "DEBUG: Today in YYYYMMDD: '" + nowYYYYMMDD + "'");
            return nowYYYYMMDD.toString();
	}

	public boolean SaveResult(String results)
	{
                formatFilename();
		java.io.File Filess = new java.io.File(szpath+filename);
		try {
			saveTextFile(results,Filess);
			return true;
		} catch (IOException e) {
			return false;
		}
	}

	
	public String GetXMLHeaderPinForm()
	{
		return "<?xml version=\"1.0\"?>"+"\n"+"<Ellectra-PinForm xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"EllectraPinForm\"> \n";

	}
	
	public String GetXMLFooterPinForm()
	{
		return 	"</Ellectra-PinForm>";
	}

	public String GetMainXMLPinForm()
	{
		String szResults="";
		szResults=szResults+"<Record>\n";
		szResults=szResults+"<test>"+convdatetostr(test)+"</test> \n "; 
		szResults=szResults+"<contractType>"+contractType+"</contractType> \n "; 
		szResults=szResults+"<a4Disabled>"+a4Disabled+"</a4Disabled> \n "; 
		szResults=szResults+"<a4>"+a4+"</a4> \n "; 
		szResults=szResults+"<a4Required>"+a4Required+"</a4Required> \n "; 
		szResults=szResults+"<a5>"+a5+"</a5> \n "; 
		szResults=szResults+"<a6>"+a6+"</a6> \n "; 
		szResults=szResults+"<a7>"+a7+"</a7> \n "; 
		szResults=szResults+"<country>"+country+"</country> \n "; 
		szResults=szResults+"<a9>"+a9+"</a9> \n "; 
		szResults=szResults+"<a10>"+a10+"</a10> \n "; 
		szResults=szResults+"<a11>"+a11+"</a11> \n "; 
		szResults=szResults+"<a12>"+a12+"</a12> \n "; 
		szResults=szResults+"<a13>"+a13+"</a13> \n "; 
		szResults=szResults+"<a14>"+a14+"</a14> \n "; 
		szResults=szResults+"<a15>"+a15+"</a15> \n "; 
		szResults=szResults+"<a16>"+a16+"</a16> \n "; 
		szResults=szResults+"<furtherInfo>"+furtherInfo+"</furtherInfo> \n "; 
		szResults=szResults+"<showAnnexASectionI>"+showAnnexASectionI+"</showAnnexASectionI> \n "; 
		szResults=szResults+"<typeOfCA>"+typeOfCA+"</typeOfCA> \n "; 
		
		String activitiesSelected1="NA";
		if(activitiesSelected!=null)
		{
		
		//activitiesSelected
		for (int i=0;i<activitiesSelected.length;i++)
			activitiesSelected1=activitiesSelected1+activitiesSelected[i]+",";
		}
		//activitiesSelected1=activitiesSelected1.substring(0, activitiesSelected1.length()-1);
		szResults=szResults+"<activitiesSelected>"+activitiesSelected1+"</activitiesSelected> \n "; 
		
		
		szResults=szResults+"<a26>"+a26+"</a26> \n "; 
		szResults=szResults+"<a26Disabled>"+a26Disabled+"</a26Disabled> \n "; 
		szResults=szResults+"<a38>"+a38+"</a38> \n "; 
		szResults=szResults+"<a38Disabled>"+a38Disabled+"</a38Disabled> \n "; 
		szResults=szResults+"<a39>"+a39+"</a39> \n "; 
		szResults=szResults+"<cpv>"+cpv+"</cpv> \n "; 
		szResults=szResults+"<nuts>"+nuts+"</nuts> \n "; 
		szResults=szResults+"<voc>"+voc+"</voc> \n "; 
		szResults=szResults+"<a40>"+a40+"</a40> \n "; 
		szResults=szResults+"<a41>"+a41+"</a41> \n "; 
		szResults=szResults+"<a42>"+a42+"</a42> \n "; 
		szResults=szResults+"<a44>"+a44+"</a44> \n "; 
		szResults=szResults+"<a45>"+a45+"</a45> \n "; 
		szResults=szResults+"<a46_a49>"+a46_a49+"</a46_a49> \n "; 
		szResults=szResults+"<a47>"+a47+"</a47> \n "; 
		szResults=szResults+"<a47_48Disabled>"+a47_48Disabled+"</a47_48Disabled> \n "; 
		szResults=szResults+"<a48>"+a48+"</a48> \n "; 
		szResults=szResults+"<a50>"+a50+"</a50> \n "; 
		szResults=szResults+"<a50_51_52Disabled>"+a50_51_52Disabled+"</a50_51_52Disabled> \n "; 
		szResults=szResults+"<a51>"+a51+"</a51> \n "; 
		szResults=szResults+"<a52>"+a52+"</a52> \n "; 
		szResults=szResults+"<a53>"+a53+"</a53> \n "; 
		szResults=szResults+"<a54>"+a54+"</a54> \n "; 
		szResults=szResults+"<a54Disabled>"+a54Disabled+"</a54Disabled> \n "; 
		szResults=szResults+"<a60_a62_a64>"+a60_a62_a64+"</a60_a62_a64> \n "; 
		szResults=szResults+"<a61>"+a61+"</a61> \n "; 
		szResults=szResults+"<a61Disabled>"+a61Disabled+"</a61Disabled> \n "; 
		szResults=szResults+"<a63>"+a63+"</a63> \n "; 
		szResults=szResults+"<a63Disabled>"+a63Disabled+"</a63Disabled> \n "; 
		szResults=szResults+"<a65_66Disabled>"+a65_66Disabled+"</a65_66Disabled> \n "; 
		szResults=szResults+"<a67>"+a67+"</a67> \n "; 
		szResults=szResults+"<a68>"+a68+"</a68> \n "; 
		szResults=szResults+"<a70>"+a70+"</a70> \n "; 
		szResults=szResults+"<a71>"+a71+"</a71> \n "; 
		szResults=szResults+"<category>"+category+"</category> \n "; 
		szResults=szResults+"<a73>"+a73+"</a73> \n "; 
		szResults=szResults+"<a74>"+a74+"</a74> \n "; 
		szResults=szResults+"<a93>"+a93+"</a93> \n "; 
		szResults=szResults+"<a94>"+a94+"</a94> \n "; 
		szResults=szResults+"<a95>"+a95+"</a95> \n "; 
		szResults=szResults+"<a96>"+a96+"</a96> \n "; 
		szResults=szResults+"<a95_96Disabled>"+a95_96Disabled+"</a95_96Disabled> \n "; 
		szResults=szResults+"<a97>"+a97+"</a97> \n "; 
		szResults=szResults+"<a98>"+a98+"</a98> \n "; 
		szResults=szResults+"<a98Disabled>"+a98Disabled+"</a98Disabled> \n "; 
		szResults=szResults+"<a98Required>"+a98Required+"</a98Required> \n "; 
		szResults=szResults+"<a99>"+a99+"</a99> \n "; 
		szResults=szResults+"<a100>"+a100+"</a100> \n "; 
		szResults=szResults+"<a101>"+a101+"</a101> \n "; 
		szResults=szResults+"<a102>"+a102+"</a102> \n "; 
		szResults=szResults+"<a103>"+a103+"</a103> \n "; 
		if (today!=null)
		szResults=szResults+"<today>"+convdatetostr(today)+"</today> \n "; 
		else
			szResults=szResults+"<today>"+"NA"+"</today> \n ";
		if (a59_90!=null)
		szResults=szResults+"<a59_90>"+convdatetostr(a59_90)+"</a59_90> \n "; 
		else
			szResults=szResults+"<a59_90>"+"NA"+"</a59_90> \n ";
		if (a65!=null)
		szResults=szResults+"<a65>"+convdatetostr(a65)+"</a65> \n ";
		else
			szResults=szResults+"<a65>"+"NA"+"</a65> \n ";
		if (a66!=null)
		szResults=szResults+"<a66>"+convdatetostr(a66)+"</a66> \n ";
		else
			szResults=szResults+"<a66>"+"NA"+"</a66> \n ";
			
		
		szResults=szResults+"<link0>"+link0+"</link0> \n "; 
		szResults=szResults+"<link1>"+link1+"</link1> \n "; 
		szResults=szResults+"<link2A>"+link2A+"</link2A> \n "; 
		szResults=szResults+"<link2B>"+link2B+"</link2B> \n "; 
		szResults=szResults+"<linkAnB>"+linkAnB+"</linkAnB> \n "; 
		szResults=szResults+"<link3>"+link3+"</link3> \n "; 
		szResults=szResults+"<link4>"+link4+"</link4> \n "; 
		szResults=szResults+"<linkAnA>"+linkAnA+"</linkAnA> \n "; 
		szResults=szResults+"<text0>"+text0+"</text0> \n "; 
		szResults=szResults+"<text1>"+text1+"</text1> \n "; 
		szResults=szResults+"<text2A>"+text2A+"</text2A> \n "; 
		szResults=szResults+"<text2B>"+text2B+"</text2B> \n "; 
		szResults=szResults+"<textAnB>"+textAnB+"</textAnB> \n "; 
		szResults=szResults+"<text3>"+text3+"</text3> \n "; 
		szResults=szResults+"<text4>"+text4+"</text4> \n "; 
		szResults=szResults+"<textAnA>"+textAnA+"</textAnA> \n "; 
		szResults=szResults+"<v0>"+v0+"</v0> \n "; 
		szResults=szResults+"<v1>"+v1+"</v1> \n "; 
		szResults=szResults+"<v2A>"+v2A+"</v2A> \n "; 
		szResults=szResults+"<v2B>"+v2B+"</v2B> \n "; 
		szResults=szResults+"<vAnB>"+vAnB+"</vAnB> \n "; 
		szResults=szResults+"<v3>"+v3+"</v3> \n "; 
		szResults=szResults+"<v4>"+v4+"</v4> \n "; 
		szResults=szResults+"<vAnA>"+vAnA+"</vAnA> \n "; 
		szResults=szResults+"<i0>"+i0+"</i0> \n "; 
		szResults=szResults+"<i1>"+i1+"</i1> \n "; 
		szResults=szResults+"<i2A>"+i2A+"</i2A> \n "; 
		szResults=szResults+"<i2B>"+i2B+"</i2B> \n "; 
		szResults=szResults+"<iAnB>"+iAnB+"</iAnB> \n "; 
		szResults=szResults+"<i3>"+i3+"</i3> \n "; 
		szResults=szResults+"<i4>"+i4+"</i4> \n "; 
		szResults=szResults+"<iAnA>"+iAnA+"</iAnA> \n "; 
		szResults=szResults+"<c0>"+c0+"</c0> \n "; 
		szResults=szResults+"<c1>"+c1+"</c1> \n "; 
		szResults=szResults+"<c2A>"+c2A+"</c2A> \n "; 
		szResults=szResults+"<c2B>"+c2B+"</c2B> \n "; 
		szResults=szResults+"<cAnB>"+cAnB+"</cAnB> \n "; 
		szResults=szResults+"<c3>"+c3+"</c3> \n "; 
		szResults=szResults+"<c4>"+c4+"</c4> \n "; 
		szResults=szResults+"<cAnA>"+cAnA+"</cAnA> \n "; 



		
		
		szResults=szResults+"</Record>\n";
		return szResults;
	}
	
        //public  static void main(String[] args) {
		// TODO Auto-generated method stub
		
		//SaveResult(GetXMLHeaderPinForm()+GetMainXMLPinForm()+GetXMLFooterPinForm());
	//}
    
	
}


