[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qsos-commits] qsos/libs/perl/QSOS-Document/lib/QSOS Document.pm
From: |
Goneri Le Bouder |
Subject: |
[Qsos-commits] qsos/libs/perl/QSOS-Document/lib/QSOS Document.pm |
Date: |
Tue, 10 Apr 2007 16:23:54 +0000 |
CVSROOT: /sources/qsos
Module name: qsos
Changes by: Goneri Le Bouder <goneri> 07/04/10 16:23:54
Modified files:
libs/perl/QSOS-Document/lib/QSOS: Document.pm
Log message:
Improve some error messages
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/libs/perl/QSOS-Document/lib/QSOS/Document.pm?cvsroot=qsos&r1=1.24&r2=1.25
Patches:
Index: Document.pm
===================================================================
RCS file: /sources/qsos/qsos/libs/perl/QSOS-Document/lib/QSOS/Document.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- Document.pm 6 Apr 2007 12:30:46 -0000 1.24
+++ Document.pm 10 Apr 2007 16:23:54 -0000 1.25
@@ -1,4 +1,4 @@
-# $Id: Document.pm,v 1.24 2007/04/06 12:30:46 goneri Exp $
+# $Id: Document.pm,v 1.25 2007/04/10 16:23:54 goneri Exp $
#
# Copyright (C) 2006 Atos Origin
#
@@ -85,7 +85,16 @@
$deep = 0 unless $deep;
unless ($elt->atts->{name}) {
- die "ERR: Attribute without name (".$elt->first_child('comment').")";
+ my $error = '';
+
+ if ($elt->first_child('title')) {
+ $error .= "title: `".$elt->first_child('title')."' "
+ }
+ if ($elt->first_child('comment')) {
+ $error .= "comment: `".$elt->first_child('comment')."'"
+ }
+
+ die "ERR: Attribute without name ($error)\n";
}
my $h = {
@@ -396,6 +405,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('appname');
$header->first_child('appname')->text();
}
@@ -406,6 +416,7 @@
$appname = "" unless defined $appname;
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('appname');
$header->first_child('appname')->set_text($appname);
}
@@ -415,6 +426,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('language');
$header->first_child('language')->text();
}
@@ -434,6 +446,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('release');
$header->first_child('release')->text();
}
@@ -469,6 +482,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('licenseid');
$header->first_child('licenseid')->text();
}
@@ -488,6 +502,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('licensedesc');
$header->first_child('licensedesc')->text();
}
@@ -509,6 +524,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('url');
$header->first_child('url')->text();
}
@@ -528,6 +544,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return $header->first_child('desc');
$header->first_child('desc')->text();
}
@@ -547,6 +564,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('demourl');
$header->first_child('demourl')->text();
}
@@ -567,6 +585,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('qsosformat');
$header->first_child('qsosformat')->text();
}
@@ -587,6 +606,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('qsosspecificformat');
$header->first_child('qsosspecificformat')->text();
}
@@ -607,6 +627,7 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('qsosappfamily');
$header->first_child('qsosappfamily')->text();
}
@@ -626,9 +647,11 @@
my @root = $self->{twig}->root->children;
my $header = shift @root;
+ return unless $header->first_child('qsosappname');
$header->first_child('qsosappname')->text();
}
+
=head1 NAME
QSOS::Document - QSOS file access
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qsos-commits] qsos/libs/perl/QSOS-Document/lib/QSOS Document.pm,
Goneri Le Bouder <=