diff options
author | dakkar <dakkar@thenautilus.net> | 2009-08-18 15:07:32 +0200 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2009-08-18 15:07:32 +0200 |
commit | 49277804ea76478ba182a18c36d6e646ad65bed3 (patch) | |
tree | 5fb007f2ebd8b48cc7772d1265f7befb190fe436 | |
parent | some more path cleanup (diff) | |
download | WebCoso-49277804ea76478ba182a18c36d6e646ad65bed3.tar.gz WebCoso-49277804ea76478ba182a18c36d6e646ad65bed3.tar.bz2 WebCoso-49277804ea76478ba182a18c36d6e646ad65bed3.zip |
warn if no atom id
-rw-r--r-- | lib/WebCoso/Common.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/WebCoso/Common.pm b/lib/WebCoso/Common.pm index 513a562..f8d64fa 100644 --- a/lib/WebCoso/Common.pm +++ b/lib/WebCoso/Common.pm @@ -131,9 +131,15 @@ sub getAtomIdFor { LOGWARN("No document for <$doc_name>, returning ''"); return ''; } + my $atomId=$xpath->findnodes( q{/document/docinfo/field[field_name='Id']/field_body}, $doc); + unless (defined $atomId) { + LOGWARN("No Id field for <$doc_name>, returning ''"); + return ''; + } + $atomId=~s{(?:\A\s+)|(?:\s+\z)}{}smgx; return $atomId; } |