public void load(File file) throws ParserConfigurationException,
			SAXException, IOException {
		fileName = file.getName();
		Element rootElement;
		Document xmlDocument;
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		DocumentBuilder db = null;
		db = dbf.newDocumentBuilder();
		xmlDocument = db.parse(file);
		rootElement = xmlDocument.getDocumentElement();

		load(rootElement);

		NodeList nodeList = rootElement.getChildNodes();
		for (int i = 0; i < nodeList.getLength(); i++) {
			Node node = nodeList.item(i);
			if (node.getNodeName().equals("rts:Components")) {
				NamedNodeMap attrs = node.getAttributes();
				if (attrs.getNamedItem("PAIO") != null) {
					addComponent(new PyIOComponent(node));
				} else {
					addComponent(new RTComponent(node));
				}
			} else if (node.getNodeName().equals("rts:DataPortConnectors")) {
				addDataPortConnector(new DataPortConnector(node));
			} else if (node.getNodeName().equals("rts:ServicePortConnectors")) {
				addServicePortConnector(new ServicePortConnector(node));
			}
		}

		/**
		 * for (Component component : componentSet) { for (Component.DataPort
		 * dataPort : component.dataPortSet) { for (Connector connector :
		 * connectorSet) { if (dataPort.get(Component.DataPort.RTS_NAME).equals(
		 * connector.sourceDataPort .get(Connector.DataPort.PORT_NAME)) &&
		 * component.get(Component.PATH_URI).equals(
		 * connector.sourceDataPort.properties .get(Properties.VALUE))) {
		 * System.out.println(component.get(Component.PATH_URI) +
		 * dataPort.get(Component.DataPort.RTS_NAME) + " is OutPort");
		 * dataPort.setDirection(Component.DataPort.DIRECTION_OUT); } else if
		 * (dataPort.get(Component.DataPort.RTS_NAME)
		 * .equals(connector.targetDataPort .get(Connector.DataPort.PORT_NAME))
		 * && component.get(Component.PATH_URI).equals(
		 * connector.targetDataPort.properties .get(Properties.VALUE))) {
		 * System.out.println(component.get(Component.PATH_URI) +
		 * dataPort.get(Component.DataPort.RTS_NAME) + " is InPort");
		 * 
		 * dataPort.setDirection(Component.DataPort.DIRECTION_IN); }
		 * 
		 * }
		 * 
		 * } }
		 */

	}