if (authorNode == null) throw new Exception("'author' tag expected under 'commit'"); status.setLastCommitAuthor(authorNode.getFirstChild().getNodeValue());
if (authorNode != null) { status.setLastCommitAuthor(authorNode.getFirstChild().getNodeValue()); }
	public static CmdLineStatusFromXml[] createStatuses(byte[] cmdLineResults) throws CmdLineException {		Collection statuses = new ArrayList();				try {			// Create a builder factory			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();			factory.setValidating(false);    			// Create the builder and parse the file			InputSource source = new InputSource(new ByteArrayInputStream(cmdLineResults));			Document doc = factory.newDocumentBuilder().parse(source);			//			<!-- XML DTD for Subversion command-line client output. -->////			<!-- For "svn status" -->//			<!ENTITY % BOOL '(true | false) "false"'>////			<!ELEMENT status (target*)>////			<!ELEMENT target (entry*, against?)>//			<!-- path: target path -->//			<!ATTLIST target//			  path CDATA #REQUIRED>////			<!ELEMENT entry (wc-status, repos-status?)>//			<!-- path: entry path -->//			<!ATTLIST entry//			  path CDATA #REQUIRED>////			<!ELEMENT wc-status (commit?, lock?)>//			<!-- item: item/text status -->//			<!-- props: properites status -->//			<!-- revision: base revision numer -->//			<!-- wc-locked: WC dir locked? -->//			<!-- copied: add with history? -->//			<!-- switched: item switched relative to its parent? -->//			<!ATTLIST wc-status//			  item (added | conflicted | deleted | ignored | modified |//			  replaced | external | unversioned | incomplete | obstructed |//			  normal | none) #REQUIRED//			  props (conflicted | modified | normal | none) #REQUIRED//			  revision CDATA #IMPLIED//			  wc-locked %BOOL;//			  copied %BOOL;//			  switched %BOOL;//			>////			<!ELEMENT repos-status (lock?)>//			<!-- item: repository status of the item -->//			<!-- props: repository status of the item's properties -->//			<!ATTLIST repos-status//			  item (added | deleted | modified | replaced | none) #REQUIRED//			  props (modified | none) #REQUIRED//			>////			<!ELEMENT commit (author?, date?)>//			<!-- revision: last committed revision -->//			<!ATTLIST commit revision CDATA #REQUIRED>//			<!ELEMENT author (#PCDATA)>  <!-- author -->//			<!ELEMENT date (#PCDATA)>  <!-- date in ISO format -->////			<!-- Lock info stored in WC or repos. -->//			<!ELEMENT lock (token, owner, comment?, created, expires?)>////			<!ELEMENT token (#PCDATA)>    <!-- lock token URI -->//			<!ELEMENT owner (#PCDATA)>    <!-- lock owner -->//			<!ELEMENT comment (#PCDATA)>  <!-- lock comment -->//			<!ELEMENT created (#PCDATA)>  <!-- creation date in ISO format -->//			<!ELEMENT expires (#PCDATA)>  <!-- expiration date in ISO format -->////			<!ELEMENT against EMPTY>//			<!-- revision: revision number at which the repository information was -->//			<!-- obtained -->//			<!ATTLIST against revision CDATA #REQUIRED>						NodeList nodes = doc.getElementsByTagName("entry");						for(int i = 0; i < nodes.getLength(); i++) {				Node statusEntry = nodes.item(i);				String entryPath = statusEntry.getAttributes().getNamedItem("path").getNodeValue();				CmdLineStatusFromXml status = new CmdLineStatusFromXml(entryPath);								Element wcStatusNode = getFirstNamedElement(statusEntry, "wc-status");				if (wcStatusNode == null) throw new Exception("'wc-status' tag expected under 'entry'");				Node wcItemStatusAttr = wcStatusNode.getAttributes().getNamedItem("item");                status.setTextStatus(SVNStatusKind.fromString(wcItemStatusAttr.getNodeValue()));				Node wcPpropStatusAttr = wcStatusNode.getAttributes().getNamedItem("props");                status.setPropStatus(SVNStatusKind.fromString(wcPpropStatusAttr.getNodeValue()));				Node wcRevisionAttribute = wcStatusNode.getAttributes().getNamedItem("revision");				if (wcRevisionAttribute != null) {					status.setRevision(Helper.toRevNum(wcRevisionAttribute.getNodeValue()));				}//				Node wcLockedAttr = wcStatusNode.getAttributes().getNamedItem("wc-locked");//                boolean wcLocked = (wcLockedAttr != null) && "true".equals(wcLockedAttr.getNodeValue());				Node copiedAttr = wcStatusNode.getAttributes().getNamedItem("copied");                status.setCopied((copiedAttr != null) && "true".equals(copiedAttr.getNodeValue()));//				Node switchedAttr = wcStatusNode.getAttributes().getNamedItem("switched");                 //                boolean switched = (switchedAttr != null) && "true".equals(switchedAttr.getNodeValue());								Element commitNode = getFirstNamedElement(wcStatusNode, "commit");				if (commitNode != null) {					Node commitRevisionAttribute = commitNode.getAttributes().getNamedItem("revision");					status.setLastChangedRevision(Helper.toRevNum(commitRevisionAttribute.getNodeValue()));					Element authorNode = getFirstNamedElement(commitNode, "author");					if (authorNode == null) throw new Exception("'author' tag expected under 'commit'");					status.setLastCommitAuthor(authorNode.getFirstChild().getNodeValue());									Element dateNode = getNextNamedElement(authorNode, "date");					if (dateNode == null) throw new Exception("'date' tag expected under 'commit'");					status.setLastChangedDate(Helper.convertXMLDate(dateNode.getFirstChild().getNodeValue()));				}				Element lockNode = getNextNamedElement(commitNode, "lock");				if (lockNode != null) {					Element tokenNode = getFirstNamedElement(lockNode, "token");					if (tokenNode == null) throw new Exception("'token' tag expected under 'lock'");//					String token = authorNode.getFirstChild().getNodeValue();									Element ownerNode = getNextNamedElement(lockNode, "owner");					if (ownerNode == null) throw new Exception("'owner' tag expected under 'lock'");					status.setLockOwner(ownerNode.getFirstChild().getNodeValue());										Element lockCommentNode = getNextNamedElement(ownerNode, "comment");					status.setLockComment((lockCommentNode != null) ? lockCommentNode.getFirstChild().getNodeValue() : null);										Element lockCreatedNode = getNextNamedElement(lockCommentNode, "created");					status.setLockCreationDate(Helper.convertXMLDate((lockCreatedNode != null) ? lockCreatedNode.getFirstChild().getNodeValue() : null));					//					Element lockExpiresNode = getNextNamedElement(lockCreatedNode, "expires");//					String lockExpires = (lockExpiresNode != null) ? lockExpiresNode.getFirstChild().getNodeValue() : null;									}				Element reposStatusNode = getNextNamedElement(wcStatusNode, "repos-status");				if (reposStatusNode != null) {					Node reposItemStatusAttr = reposStatusNode.getAttributes().getNamedItem("item");	                status.setRepositoryTextStatus(SVNStatusKind.fromString(reposItemStatusAttr.getNodeValue()));					Node reposPropStatusAttr = reposStatusNode.getAttributes().getNamedItem("props");	                status.setRepositoryPropStatus(SVNStatusKind.fromString(reposPropStatusAttr.getNodeValue()));				}								statuses.add(status);						}		} catch (Exception e) {			throw new CmdLineException(e);		} 				return (CmdLineStatusFromXml[]) statuses.toArray(new CmdLineStatusFromXml[statuses.size()]);				}