15
Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Embed Size (px)

Citation preview

Page 1: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Introduction to the NCIP DTDs and XML Schemas

Tony O’Brien

Oct 2nd 2002

Page 2: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

DTD/XML Schema Basics

• Linked to Implementation Profile 1 document

• Provide formal, unambiguous specification of NCIP message syntax

• Facilitate machine (& human) parsing of NCIP messages

Page 3: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

NCIP has 4 of them!

• ncip_v1_0.dtd (main DTD)

• ncip_v1_0.xsd (main Schema)

• ncip_version.dtd (‘version’ DTD)

• ncip_version.xsd (‘version’ Schema)

Page 4: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Main NCIP DTD

• ncip_v1_0.dtd

• Contains main set of 88 NCIP messages

• Must be supported by NCIP conformant applications

• Uses “datatype” attribute to provide XML-Schema-like type information

Page 5: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Main NCIP XML Schema

• ncip_v1_0.xsd

• Mirrors & is derived from main DTD

• DTD datatype attributes converted into true XML Schema datatypes

• Conformant apps do not currently need to support Schema

• …but Schema will eventually replace DTD

Page 6: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

‘Version’ DTD

• ncip_version.dtd

• Provides ‘NCIP versions supported’ info

• Independent of main DTD

• Implemented for NCIP v1.0

• ….but should remain in use as new versions of NCIP & the main DTD are developed

Page 7: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

‘Version’ XML Schema

• ncip_version.xsd

• Mirrors & is derived from ‘version’ DTD

Page 8: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Location of DTD/Schema files

• Hosted by NISO• www.niso.org/ncip/v1_0/imp1/dtd/

ncip_v1_0.dtd• www.niso.org/ncip/v1_0/imp1/dtd/

ncip_version.dtd• www.niso.org/ncip/v1_0/imp1/xsd/

ncip_v1_0.xsd• www.niso.org/ncip/v1_0/imp1/xsd/

ncip_version.xsd

Page 9: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Top Level Structure of main DTD & XML Schema

• NCIPMessage is the root element• Consists of 1 ‘version’ attribute and 1 child element• Child element is a choice from 88 possible

alternatives• 88 alternatives represent 44 initiation/response

message pairs• These 44 ‘services’ can be further categorised:-

– 4 ‘lookups’ eg. LookupUser/LookupUserResponse– 20 ‘updates’ eg. CheckOutItem/CheckOutItemResponse– 20 ‘notifications’ eg.

ItemShipped/ItemShippedResponse

Page 10: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Top Level Structure of ‘Version’ DTD/Schema

• NCIPVersionMessage is the root element• Consists of 1 ‘version’ element and 1 child

element• Child element is a choice from 2 alternatives• Ie. A single version lookup ‘service’

– LookupVersion/LookupVersionResponse

Page 11: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Initiation Messages

• Consist of an InitiationHeader element, followed by message-specific data

• InitiationHeader contains:-– FromSystemId (s/v, optional)– FromSystemAuthentication (string, optional)– FromAgencyId (s/v, mandatory)– FromAgencyAuthentication (string, optional)– OnBehalfOfAgency (s/v, optional)– ToSystemId (s/v, optional)– ToAgencyId (s/v, mandatory)– ApplicationProfileType (s/v, optional)

Page 12: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Response messages

• Consist of a ResponseHeader, followed by:-– For Lookup and Update Messages: A Problem

element, or response-specific data– For Notification Messages: A MessagingError

element, or nothing at all

• ResponseHeader contains:-– FromSystemId (s/v, optional)– FromSystemAuthentication (string, optional)– FromAgencyId (s/v, mandatory)– FromAgencyAuthentication (string, optional)– ToSystemId (s/v, optional)– ToAgencyId (s/v, mandatory)

Page 13: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

DTD/Schema data types

• boolean

• dateTime (ISO 8601)

• integer

• nonNegativeInteger

• positiveInteger

• string

• ‘Wrapper’ elements

Page 14: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Enumerated Types

• Scheme/Value pairs– Provides namespace for enumerations

• ‘Closed’: No new lists of values may be defined in a given protocol version– Example: General Processing Error

• ‘Open’: New lists of values may be defined without breaking protocol– Example: Agency User Privilege Type

• Nb. In all cases, lists specified by protocol must be supported by conformant apps

Page 15: Introduction to the NCIP DTDs and XML Schemas Tony O’Brien Oct 2 nd 2002

Example Scheme/Value pair

<AgencyUserPrivilegeType><Scheme>http://www.niso.org/ncip/v1_0/imp1/schemes/

agencyuserprivilegetype/public.scm</Scheme>

<Value>Adult</Value></AgencyUserPrivilegeType>

• Nb. A ‘Scheme’ element is always a URI– Guarantees globally unique list name– Does not guarantee presence of list at specified URI