Fixup a lot of stuff based on a first round of real testing.
authorJason Stephenson <jason@sigio.com>
Fri, 24 Oct 2014 01:36:48 +0000 (21:36 -0400)
committerJason Stephenson <jason@sigio.com>
Fri, 24 Oct 2014 01:36:48 +0000 (21:36 -0400)
Add ncip: namespace qualifier in templates and includes.

Reorder some fields because apparently the field order matters,
at least to xmllint when using the schema.

Make some code changes in NCIP::ILS::Evergreen to make sure that
date fields have the proper format. (This still needs testing, so
we'll see.)

Signed-off-by: Jason Stephenson <jason@sigio.com>

16 files changed:
lib/NCIP/ILS/Evergreen.pm
templates/includes/AcceptItemResponse.inc
templates/includes/CancelRequestItemResponse.inc
templates/includes/CheckInItemResponse.inc
templates/includes/CheckOutItemResponse.inc
templates/includes/ItemOptionalFields.inc
templates/includes/LookupUserResponse.inc
templates/includes/LookupVersionResponse.inc
templates/includes/RenewItemResponse.inc
templates/includes/RequestItemResponse.inc
templates/includes/ResponseHeader.inc
templates/includes/UserOptionalFields.inc
templates/includes/footer.inc
templates/includes/header.inc
templates/includes/problem.inc
templates/response.tt

index 1a79281..87b4a77 100644 (file)
@@ -674,9 +674,7 @@ sub renewitem {
         # circ information to get the new due date.
         $details = $self->retrieve_copy_details_by_barcode($item_barcode);
         $circ = $details->{circ};
-        my $due = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date()));
-        $due->set_time_zone('UTC');
-        $data->{DateDue} = $due->iso8601();
+        $data->{DateDue} = _fix_date($circ->due_date());
 
         # Look for UserElements requested and add it to the response:
         my $elements = $request->{$message}->{UserElementType};
@@ -847,9 +845,7 @@ sub checkoutitem {
         # circ information to get the due date.
         $details = $self->retrieve_copy_details_by_barcode($item_barcode);
         $circ = $details->{circ};
-        my $due = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date()));
-        $due->set_time_zone('UTC');
-        $data->{DateDue} = $due->iso8601();
+        $data->{DateDue} = _fix_date($circ->due_date());
 
         # Look for UserElements requested and add it to the response:
         my $elements = $request->{$message}->{UserElementType};
@@ -1363,8 +1359,8 @@ sub handle_user_elements {
             my $privilege = NCIP::User::Privilege->new();
             $privilege->AgencyId($user->home_ou->shortname());
             $privilege->AgencyUserPrivilegeType($pgt->name());
-            $privilege->ValidToDate($user->expire_date());
-            $privilege->ValidFromDate($user->create_date());
+            $privilege->ValidToDate(_fix_date($user->expire_date()));
+            $privilege->ValidFromDate(_fix_date($user->create_date()));
 
             my $status = 'Active';
             if (_expired($user)) {
@@ -1528,9 +1524,7 @@ sub handle_item_elements {
         $details = $self->retrieve_copy_details_by_barcode($copy->barcode()) unless($details);
         if ($details->{circ}) {
             if (!$details->{circ}->checkin_time()) {
-                my $due = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($details->{circ}->due_date()));
-                $due->set_time_zone('UTC');
-                $optionalfields->DateDue($due->iso8601());
+                $optionalfields->DateDue(_fix_date($details->{circ}->due_date()));
             }
         }
     }
@@ -2981,4 +2975,12 @@ sub _problem_from_event {
     );
 }
 
+# "Fix" dates for output so they validate against the schema
+sub _fix_date {
+    my $date = shift;
+    my $out = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($date));
+    $out->set_time_zone('UTC');
+    return $out->iso8601();
+}
+
 1;
index 5f91712..89b38d5 100644 (file)
@@ -1,21 +1,21 @@
-<RequestId>
+<ncip:RequestId>
 [% IF data.RequestId.AgencyId -%]
-<AgencyId>[% data.RequestId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.RequestId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
 [% IF data.RequestId.RequestIdentifierType -%]
-<RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</RequestIdentifierType>
+<ncip:RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</ncip:RequestIdentifierType>
 [% END -%]
-<RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</RequestIdentifierValue>
-</RequestId>
+<ncip:RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</ncip:RequestIdentifierValue>
+</ncip:RequestId>
 [% IF data.ItemId -%]
-<ItemId>
+<ncip:ItemId>
 [% IF data.ItemId.AgencyId -%]
-<AgencyId>[% data.ItemId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.ItemId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
 [% IF data.ItemId.ItemIdentifierType -%]
-<ItemIdentifierType>[% data.ItemId.ItemIdentifierType | xml %]</ItemIdentifierType>
+<ncip:ItemIdentifierType>[% data.ItemId.ItemIdentifierType | xml %]</ncip:ItemIdentifierType>
 [% END -%]
-<ItemIdentifierValue>[% data.ItemId.ItemIdentifierValue | xml %]</ItemIdentifierValue>
-</ItemId>
+<ncip:ItemIdentifierValue>[% data.ItemId.ItemIdentifierValue | xml %]</ncip:ItemIdentifierValue>
+</ncip:ItemId>
 [% END -%]
 [% INCLUDE "includes/UserOptionalFields.inc" -%]
index ea3aa3d..a14c22f 100644 (file)
@@ -1,20 +1,20 @@
-<RequestId>
+<ncip:RequestId>
 [% IF data.RequestId.AgencyId -%]
-<AgencyId>[% data.RequestId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.RequestId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
-<RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</RequestIdentifierValue>
+<ncip:RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</ncip:RequestIdentifierValue>
 [% IF data.RequestId.RequestIdentifierType -%]
-<RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</RequestIdentifierType>
+<ncip:RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</ncip:RequestIdentifierType>
 [% END %]
-</RequestId>
-<UserId>
+</ncip:RequestId>
+<ncip:UserId>
 [% IF data.UserId.AgencyId -%]
-<AgencyId>[% data.UserId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.UserId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
-<UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</UserIdentifierValue>
+<ncip:UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</ncip:UserIdentifierValue>
 [% IF data.UserId.UserIdentifierType -%]
-<UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</UserIdentiferiType>
+<ncip:UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</ncip:UserIdentiferiType>
 [% END -%]
-</UserId>
+</ncip:UserId>
 [% INCLUDE "includes/UserOptionalFields.inc" -%]
 [% INCLUDE "includes/ItemOptionalFields.inc" -%]
index 29943b0..5a21760 100644 (file)
@@ -1,22 +1,22 @@
-<ItemId>
+<ncip:ItemId>
 [% IF data.ItemId.AgencyId -%]
-<AgencyId>[% data.ItemId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.ItemId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
 [% IF data.ItemId.ItemIdentifierType -%]
-<ItemIdentifierType>[% data.ItemId.ItemIdentifierType | xml %]</ItemIdentifierType>
+<ncip:ItemIdentifierType>[% data.ItemId.ItemIdentifierType | xml %]</ncip:ItemIdentifierType>
 [% END -%]
-<ItemIdentifierValue>[% data.ItemId.ItemIdentifierValue | xml %]</ItemIdentifierValue>
-</ItemId>
+<ncip:ItemIdentifierValue>[% data.ItemId.ItemIdentifierValue | xml %]</ncip:ItemIdentifierValue>
+</ncip:ItemId>
 [% IF data.UserId -%]
-<UserId>
+<ncip:UserId>
 [% IF data.UserId.AgencyId -%]
-<AgencyId>[% data.UserId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.UserId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
 [% IF data.UserId.UserIdentifierType -%]
-<UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</UserIdentifierType>
+<ncip:UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</ncip:UserIdentifierType>
 [% END -%]
-<UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</UserIdentifierValue>
-</UserId>
+<ncip:UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</ncip:UserIdentifierValue>
+</ncip:UserId>
 [% END -%]
 [% INCLUDE "includes/UserOptionalFields.inc" -%]
 [% INCLUDE "includes/ItemOptionalFields.inc" -%]
index 661a94b..dd82830 100644 (file)
@@ -1,4 +1,4 @@
 [% INCLUDE "includes/CheckInItemResponse.inc" %]
 [% IF data.DateDue -%]
-<DateDue>[% data.DateDue | xml %]</DateDue>
+<ncip:DateDue>[% data.DateDue | xml %]</ncip:DateDue>
 [% END -%]
index 35928f9..1efc4e9 100644 (file)
@@ -1,91 +1,91 @@
 [% IF data.ItemOptionalFields -%]
-<ItemOptionalFields>
+<ncip:ItemOptionalFields>
 [% IF data.ItemOptionalFields.BibliographicDescription -%]
-<BibliographicDescription>
+<ncip:BibliographicDescription>
 [% IF data.ItemOptionalFields.BibliographicDescription.Author -%]
-<Author>
+<ncip:Author>
 [% data.ItemOptionalFields.BibliographicDescription.Author | xml %]
-</Author>
+</ncip:Author>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.Title -%]
-<Title>
+<ncip:Title>
 [% data.ItemOptionalFields.BibliographicDescription.Title | xml %]
-</Title>
+</ncip:Title>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.Publisher -%]
-<Publisher>
+<ncip:Publisher>
 [% data.ItemOptionalFields.BibliographicDescription.Publisher | xml %]
-</Publisher>
+</ncip:Publisher>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.PublicationDate -%]
-<PublicationDate>
+<ncip:PublicationDate>
 [% data.ItemOptionalFields.BibliographicDescription.PublicationDate | xml %]
-</PublicationDate>
+</ncip:PublicationDate>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.Edition -%]
-<Edition>
+<ncip:Edition>
 [% data.ItemOptionalFields.BibliographicDescription.Edition | xml %]
-</Edition>
+</ncip:Edition>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.BibliographicRecordId;
       id = data.ItemOptionalFields.BibliographicDescription.BibliographicRecordId -%]
-<BibliographicRecordId>
-<BibliographicRecordIdentifier>
+<ncip:BibliographicRecordId>
+<ncip:BibliographicRecordIdentifier>
 [% id.BibliographicRecordIdentifier | xml %]
-</BibliographicRecordIdentifer>
+</ncip:BibliographicRecordIdentifer>
 [% IF id.BibliographicRecordIdentifierCode -%]
-<BibliographicRecordIdentifierCode>
+<ncip:BibliographicRecordIdentifierCode>
 [% id.BibliographicRecordIdentifierCode | xml %]
-</BibliographicRecordIdentifierCode>
+</ncip:BibliographicRecordIdentifierCode>
 [% END -%]
 [% IF id.AgencyId -%]
-<AgencyId>
+<ncip:AgencyId>
 [% id.AgencyId | xml %]
-</AgencyId>
+</ncip:AgencyId>
 [% END -%]
-</BibliographicRecordId>
+</ncip:BibliographicRecordId>
 [% END -%]
 [% IF data.ItemOptionalFields.BibliographicDescription.BibliographicItemId;
       id = data.ItemOptionalFields.BibliographicDescription.BibliographicItemId -%]
-<BibliographicItemId>
-<BibliographicItemIdentifier>
+<ncip:BibliographicItemId>
+<ncip:BibliographicItemIdentifier>
 [% id.BibliographicItemIdentifier | xml %]
-</BibliographicItemIdentifier>
+</ncip:BibliographicItemIdentifier>
 [% IF id.BibliographicItemIdentifierCode -%]
-<BibliographicItemIdentifierCode>
+<ncip:BibliographicItemIdentifierCode>
 [% id.BibliographicItemIdentifierCode | xml %]
-</BibliographicItemIdentifierCode>
+</ncip:BibliographicItemIdentifierCode>
 [% END -%]
-</BibliographicItemId>
+</ncip:BibliographicItemId>
 [% END -%]
-</BibliographicDescription>
+</ncip:BibliographicDescription>
 [% END -%]
 [% IF data.ItemOptionalFields.ItemDescription -%]
-<ItemDescription>
-<CallNumber>
+<ncip:ItemDescription>
+<ncip:CallNumber>
 [% data.ItemOptionalFields.ItemDescription.CallNumber | xml %]
-</CallNumber>
-</ItemDescription>
+</ncip:CallNumber>
+</ncip:ItemDescription>
 [% END -%]
 [% IF data.ItemOptionalFields.CirculationStatus -%]
-<CirculationStatus>
+<ncip:CirculationStatus>
 [% data.ItemOptionalFields.CirculationStatus | xml %]
-</CirculationStatus>
+</ncip:CirculationStatus>
 [% END -%]
 [% IF data.ItemOptionalFields.DateDue -%]
-<DateDue>
+<ncip:DateDue>
 [% data.ItemOptionalFields.DateDue | xml %]
-</DateDue>
+</ncip:DateDue>
 [% END -%]
 [% IF data.ItemOptionalFields.ItemUseRestrictionType -%]
-<ItemUseRestrictionType>
+<ncip:ItemUseRestrictionType>
 [% data.ItemOptionalFields.ItemUseRestrictionType | xml %]
-</ItemUseRestrictionType>
+</ncip:ItemUseRestrictionType>
 [% END -%]
 [% IF data.ItemOptionalFields.PhysicalCondition -%]
-<PhysicalCondition>
+<ncip:PhysicalCondition>
 [% data.ItemOptionalFields.PhysicalCondition | xml %]
-</PhysicalCondition>
+</ncip:PhysicalCondition>
 [% END -%]
-</ItemOptionalFields>
+</ncip:ItemOptionalFields>
 [% END -%]
index 4a66689..f1555c2 100644 (file)
@@ -1,18 +1,18 @@
 [% FOREACH id IN data.UserId -%]
-<UserId>
-<UserIdentifierValue>
+<ncip:UserId>
+<ncip:UserIdentifierValue>
 [% id.UserIdentifierValue | xml %]
-</UserIdentifierValue>
+</ncip:UserIdentifierValue>
 [% IF id.UserIdentifierType -%]
-<UserIdentifierType>
+<ncip:UserIdentifierType>
 [% id.UserIdentifierType | xml %]
-</UserIdentifierType>
+</ncip:UserIdentifierType>
 [% END -%]
 [% IF id.AgencyId -%]
-<AgencyId>
+<ncip:AgencyId>
 [% id.AgencyId %]
-</AgencyId>
+</ncip:AgencyId>
 [% END -%]
-</UserId>
+</ncip:UserId>
 [% END -%]
 [% INCLUDE "includes/UserOptionalFields.inc" -%]
index f59fa05..8f8f4dc 100644 (file)
@@ -1,15 +1,15 @@
-<FromAgencyId>
-<AgencyId>
+<ncip:FromAgencyId>
+<ncip:AgencyId>
 [%- data.fromagencyid -%]
-</AgencyId>
-</FromAgencyId>
-<ToAgencyId>
-<AgencyId>
+</ncip:AgencyId>
+</ncip:FromAgencyId>
+<ncip:ToAgencyId>
+<ncip:AgencyId>
 [%- data.toagencyid -%]
-</AgencyId>
-</ToAgencyId>
+</ncip:AgencyId>
+</ncip:ToAgencyId>
 [% FOREACH version IN data.versions -%]
-<VersionSupported>
+<ncip:VersionSupported>
 [%- version | xml -%]
-</VersionSupported>
+</ncip:VersionSupported>
 [% END -%]
index 661a94b..dd82830 100644 (file)
@@ -1,4 +1,4 @@
 [% INCLUDE "includes/CheckInItemResponse.inc" %]
 [% IF data.DateDue -%]
-<DateDue>[% data.DateDue | xml %]</DateDue>
+<ncip:DateDue>[% data.DateDue | xml %]</ncip:DateDue>
 [% END -%]
index 1aaadb3..6032c92 100644 (file)
@@ -1,22 +1,22 @@
-<RequestId>
+<ncip:RequestId>
 [% IF data.RequestId.AgencyId -%]
-<AgencyId>[% data.RequestId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.RequestId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
-<RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</RequestIdentifierValue>
+<ncip:RequestIdentifierValue>[% data.RequestId.RequestIdentifierValue | xml %]</ncip:RequestIdentifierValue>
 [% IF data.RequestId.RequestIdentifierType -%]
-<RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</RequestIdentifierType>
+<ncip:RequestIdentifierType>[% data.RequestId.RequestIdentifierType | xml %]</ncip:RequestIdentifierType>
 [% END %]
-</RequestId>
-<UserId>
+</ncip:RequestId>
+<ncip:UserId>
 [% IF data.UserId.AgencyId -%]
-<AgencyId>[% data.UserId.AgencyId | xml %]</AgencyId>
+<ncip:AgencyId>[% data.UserId.AgencyId | xml %]</ncip:AgencyId>
 [% END -%]
-<UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</UserIdentifierValue>
+<ncip:UserIdentifierValue>[% data.UserId.UserIdentifierValue | xml %]</ncip:UserIdentifierValue>
 [% IF data.UserId.UserIdentifierType -%]
-<UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</UserIdentiferiType>
+<ncip:UserIdentifierType>[% data.UserId.UserIdentifierType | xml %]</ncip:UserIdentiferiType>
 [% END -%]
-</UserId>
-<RequestType>[% data.RequestType | xml %]</RequestType>
-<RequestScopeType>[% data.RequestScopeType | xml %]</RequestScopeType>
+</ncip:UserId>
+<ncip:RequestType>[% data.RequestType | xml %]</ncip:RequestType>
+<ncip:RequestScopeType>[% data.RequestScopeType | xml %]</ncip:RequestScopeType>
 [% INCLUDE "includes/UserOptionalFields.inc" -%]
 [% INCLUDE "includes/ItemOptionalFields.inc" -%]
index 669d7ec..9253b2d 100644 (file)
@@ -1,12 +1,12 @@
-<ResponseHeader>
-<FromAgencyId>
-<AgencyId>
+<ncip:ResponseHeader>
+<ncip:FromAgencyId>
+<ncip:AgencyId>
 [% header.FromAgencyId.AgencyId | xml %]
-</AgencyId>
-</FromAgencyId>
-<ToAgencyId>
-<AgencyId>
+</ncip:AgencyId>
+</ncip:FromAgencyId>
+<ncip:ToAgencyId>
+<ncip:AgencyId>
 [% header.ToAgencyId.AgencyId  | xml %]
-</AgencyId>
-</ToAgencyId>
-</ResponseHeader>
+</ncip:AgencyId>
+</ncip:ToAgencyId>
+</ncip:ResponseHeader>
index 9e68adc..560fcfb 100644 (file)
 [% IF data.UserOptionalFields -%]
-<UserOptionalFields>
+<ncip:UserOptionalFields>
 [% IF data.UserOptionalFields.NameInformation -%]
-<NameInformation>
-<PersonalNameInformation>
-<StructuredPersonalUserName>
+<ncip:NameInformation>
+<ncip:PersonalNameInformation>
+<ncip:StructuredPersonalUserName>
 [% IF data.UserOptionalFields.NameInformation.GivenName -%]
-<GivenName>[% data.UserOptionalFields.NameInformation.GivenName | xml %]</GivenName>
+<ncip:GivenName>[% data.UserOptionalFields.NameInformation.GivenName | xml %]</ncip:GivenName>
 [% END -%]
-<Surname>[% data.UserOptionalFields.NameInformation.Surname | xml %]</Surname>
+<ncip:Surname>[% data.UserOptionalFields.NameInformation.Surname | xml %]</ncip:Surname>
 [% IF data.UserOptionalFields.NameInformation.Prefix -%]
-<Prefix>[% data.UserOptionalFields.NameInformation.Prefix %]</Prefix>
+<ncip:Prefix>[% data.UserOptionalFields.NameInformation.Prefix %]</ncip:Prefix>
 [% END -%]
 [% IF data.UserOptionalFields.NameInformation.Suffix -%]
-<Suffix>[% data.UserOptionalFields.NameInformation.Suffix %]</Suffix>
+<ncip:Suffix>[% data.UserOptionalFields.NameInformation.Suffix %]</ncip:Suffix>
 [% END -%]
 [% IF data.UserOptionalFields.NameInformation.Initials -%]
-<Initials>[% data.UserOptionalFields.NameInformation.Initials %]</Initials>
+<ncip:Initials>[% data.UserOptionalFields.NameInformation.Initials %]</ncip:Initials>
 [% END -%]
-</StructuredPersonalUserName>
-</PersonalNameInformation>
-</NameInformation>
+</ncip:StructuredPersonalUserName>
+</ncip:PersonalNameInformation>
+</ncip:NameInformation>
 [% END -%]
 [% IF data.UserOptionalFields.UserAddressInformation -%]
 [% FOREACH element IN data.UserOptionalFields.UserAddressInformation -%]
-<UserAddressInformation>
-<UserAddressRoleType>[% element.UserAddressRoleType | xml %]</UserAddressRoleType>
+<ncip:UserAddressInformation>
+<ncip:UserAddressRoleType>[% element.UserAddressRoleType | xml %]</ncip:UserAddressRoleType>
 [% IF element.PhysicalAddress -%]
-<PhysicalAddress>
-<StructuredAddress>
-<Line1>[% element.PhysicalAddress.Line1 | xml %]</Line1>
+<ncip:PhysicalAddress>
+<ncip:StructuredAddress>
+<ncip:Line1>[% element.PhysicalAddress.Line1 | xml %]</ncip:Line1>
 [% IF element.PhysicalAddress.Line2 -%]
-<Line2>[% element.PhysicalAddress.Line2 | xml %]</Line2>
+<ncip:Line2>[% element.PhysicalAddress.Line2 | xml %]</ncip:Line2>
 [% END -%]
 [% IF element.PhysicalAddress.Locality -%]
-<Locality>[% element.PhysicalAddress.Locality | xml %]</Locality>
+<ncip:Locality>[% element.PhysicalAddress.Locality | xml %]</ncip:Locality>
 [% END -%]
 [% IF element.PhysicalAddress.Region -%]
-<Region>[% element.PhysicalAddress.Region | xml %]</Region>
-[% END -%]
-[% IF element.PhysicalAddress.PostalCode -%]
-<PostalCode>[% element.PhysicalAddress.PostalCode | xml %]</PostalCode>
+<ncip:Region>[% element.PhysicalAddress.Region | xml %]</ncip:Region>
 [% END -%]
 [% IF element.PhysicalAddress.Country -%]
-<Country>[% element.PhysicalAddress.Country | xml %]</Country>
+<ncip:Country>[% element.PhysicalAddress.Country | xml %]</ncip:Country>
+[% END -%]
+[% IF element.PhysicalAddress.PostalCode -%]
+<ncip:PostalCode>[% element.PhysicalAddress.PostalCode | xml %]</ncip:PostalCode>
 [% END -%]
-</StructuredAddress>
-</PhysicalAddress>
+</ncip:StructuredAddress>
+<ncip:PhysicalAddressType>Postal Address</ncip:PhysicalAddressType>
+</ncip:PhysicalAddress>
 [% ELSIF element.ElectronicAddress -%]
-<ElectronicAddress>
-<ElectronicAddressType>[% element.ElectronicAddress.Type | xml %]</ElectronicAddressType>
-<ElectronicAddressData>[% element.ElectronicAddress.Data | xml %]</ElectronicAddressData>
-</ElectronicAddress>
+<ncip:ElectronicAddress>
+<ncip:ElectronicAddressType>[% element.ElectronicAddress.Type | xml %]</ncip:ElectronicAddressType>
+<ncip:ElectronicAddressData>[% element.ElectronicAddress.Data | xml %]</ncip:ElectronicAddressData>
+</ncip:ElectronicAddress>
 [% END -%]
-</UserAddressInformation>
+</ncip:UserAddressInformation>
 [% END -%]
 [% END -%]
 [% IF data.UserOptionalFields.UserPrivilege -%]
 [% FOREACH privilege IN data.UserOptionalFields.UserPrivilege -%]
-<UserPrivilege>
-<AgencyId>[% privilege.AgencyId | xml -%]</AgencyId>
-<AgencyUserPrivilegeType>[% privilege.AgencyUserPrivilegeType | xml %]</AgencyUserPrivilegeType>
+<ncip:UserPrivilege>
+<ncip:AgencyId>[% privilege.AgencyId | xml -%]</ncip:AgencyId>
+<ncip:AgencyUserPrivilegeType>[% privilege.AgencyUserPrivilegeType | xml %]</ncip:AgencyUserPrivilegeType>
 [% IF privilege.ValidFromDate -%]
-<ValidFromDate>[% privilege.ValidFromDate | xml %]</ValidFromDate>
+<ncip:ValidFromDate>[% privilege.ValidFromDate | xml %]</ncip:ValidFromDate>
 [% END -%]
 [% IF privilege.ValidToDate -%]
-<ValidToDate>[% privilege.ValidToDate | xml %]</ValidToDate>
+<ncip:ValidToDate>[% privilege.ValidToDate | xml %]</ncip:ValidToDate>
 [% END -%]
 [% IF privilege.UserPrivilegeDescription -%]
-<UserPrivilegeDescription>[% privilege.UserPrivilegeDescription | xml %]</UserPrivilegeDescription>
+<ncip:UserPrivilegeDescription>[% privilege.UserPrivilegeDescription | xml %]</ncip:UserPrivilegeDescription>
 [% END -%]
 [% IF privilege.UserPrivilegeStatus -%]
-<UserPrivilegeStatus>
-<UserPrivilegeStatusType>
+<ncip:UserPrivilegeStatus>
+<ncip:UserPrivilegeStatusType>
 [% privilege.UserPrivilegeStatus.UserPrivilegeStatusType | xml %]
-</UserPrivilegeStatusType>
+</ncip:UserPrivilegeStatusType>
 [% IF privilege.UserPrivilegeStatus.DateOfUserPrivilegeStatus -%]
-<DateOfUserPrivilegeStatus>
+<ncip:DateOfUserPrivilegeStatus>
 [% privilege.UserPrivilegeStatus.DateOfUserPrivilegeStatus | xml %]
-</DateOfUserPrivilegeStatus>
+</ncip:DateOfUserPrivilegeStatus>
 [% END -%]
-</UserPrivilegeStatus>
+</ncip:UserPrivilegeStatus>
 [% END -%]
-</UserPrivilege>
+</ncip:UserPrivilege>
 [% END -%]
 [% END -%]
 [% IF data.UserOptionalFields.UserLanguage -%]
 [% FOREACH language IN data.UserOptionalFields.UserLanguage -%]
-<UserLanguage>[% language | xml %]</UserLanguage>
+<ncip:UserLanguage>[% language | xml %]</ncip:UserLanguage>
 [% END -%]
 [% END -%]
 [% IF data.UserOptionalFields.BlockOrTrap -%]
 [% FOREACH block IN data.UserOptionalFields.BlockOrTrap -%]
-<BlockOrTrap>
-<AgencyId>[% block.AgencyId | xml %]</AgencyId>
-<BlockOrTrapType>[% block.BlockOrTrapType | xml %]</BlockOrTrapType>
+<ncip:BlockOrTrap>
+<ncip:AgencyId>[% block.AgencyId | xml %]</ncip:AgencyId>
+<ncip:BlockOrTrapType>[% block.BlockOrTrapType | xml %]</ncip:BlockOrTrapType>
 [% IF block.ValidFromDate -%]
-<ValidFromDate>[% block.ValidFromDate %]</ValidFromDate>
+<ncip:ValidFromDate>[% block.ValidFromDate %]</ncip:ValidFromDate>
 [% END -%]
 [% IF block.ValidToDate -%]
-<ValidToDate>[% block.ValidToDate %]</ValidToDate>
+<ncip:ValidToDate>[% block.ValidToDate %]</ncip:ValidToDate>
 [% END %]
-</BlockOrTrap>
+</ncip:BlockOrTrap>
 [% END -%]
 [% END -%]
-</UserOptionalFields>
+</ncip:UserOptionalFields>
 [% END -%]
index 844f1d4..b9198da 100644 (file)
@@ -1 +1 @@
-</NCIPMessage>
+</ncip:NCIPMessage>
index caa38cc..2086746 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version = '1.0' encoding='UTF-8'?>
-<NCIPMessage version='http://www.niso.org/schemas/ncip/v2_02/ncip_v2_02.xsd' xmlns='http://www.niso.org/2008/ncip'>
+<ncip:NCIPMessage ncip:version='http://www.niso.org/schemas/ncip/v2_02/ncip_v2_02.xsd' xmlns:ncip='http://www.niso.org/2008/ncip'>
index 2fd57db..5d87fe3 100644 (file)
@@ -1,18 +1,18 @@
-<Problem>
+<ncip:Problem>
 [% IF problem.Scheme -%]
-<ProblemType Scheme="[% problem.Scheme | xml %]">
+<ncip:ProblemType Scheme="[% problem.Scheme | xml %]">
 [% ELSE -%]
-<ProblemType>
+<ncip:ProblemType>
 [% END -%]
 [% problem.ProblemType | xml %]
-</ProblemType>
-<ProblemDetail>
+</ncip:ProblemType>
+<ncip:ProblemDetail>
 [% problem.ProblemDetail | xml %]
-</ProblemDetail>
-<ProblemElement>
+</ncip:ProblemDetail>
+<ncip:ProblemElement>
 [% problem.ProblemElement | xml %]
-</ProblemElement>
-<ProblemValue>
+</ncip:ProblemElement>
+<ncip:ProblemValue>
 [% problem.ProblemValue | xml %]
-</ProblemValue>
-</Problem>
+</ncip:ProblemValue>
+</ncip:Problem>
index 3b8994b..c39a16a 100644 (file)
@@ -1,4 +1,4 @@
-<[% type %]>
+<ncip:[% type %]>
 [% IF header;
       INCLUDE "includes/ResponseHeader.inc";
    END;
@@ -8,4 +8,4 @@
       INCLUDE "includes/problem.inc";
    END;
 -%]
-</[% type %]>
+</ncip:[% type %]>