Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rephrased some sentences.

...

Adding a textfield type form field - the dc:title element

We can use the information in our table to fill out the "Element Form" pane. We can start with the title element.

...

The rest of the form deals with where each element is created, read, updated, and deleted in the XML tree. This is where it would be useful to understand how XML works and to have a basic understanding of XPATHXPath.

Reviewing our OAI DC XML sample record we can determine the location/context of the title element.

Code Block
languagehtml/xml
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/
[http://www.openarchives.org/OAI/2.0/oai_dc.xsd]">
<dc:title>Pioneer days & shanty ways</dc:title>

The full XPATH XPath in this XML document for the dc:title element would be:

Code Block
/oai_dc:dc/dc:title

where /oai_dc:dc is the parent element and dc:title is the child element. The Create dialogue is where we enter the information needed for creating an element in our form. We’ll be entering information into the Path Context, Path, Type, and Value properties in our example. If you had an order-based schema, you would also fill in the Schema field. Here are some definitions for each of those properties:

Path Context: the context in at which the path XPath action with be executed in.

  • document - the XPath query is run from the root element of the document
  • parent - the XPath query is run from the node created/read by its parent’s form field
  • self - only applies to Delete and Update actions and applies to the node selected by the Read action.

Path: An XPath to this element’s parent object. This is used to determine whether where this element is inserted.

...

Type: The type of node that will be created. If XML is specified, an XML snippet is expected in the value Value field.

Value: If the type Type is either Element or Attribute, "element" or "attribute," the name of the element or attribute is expected here. If the type Type is "XML," an XML snippet is expected in which %value% indicates where the value of the form field will be inserted whereever the string %value% is used in the XML snippet.

Review the image below and think about how your other OAI DC elements will be created based on this pattern.

...