Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
Library | Service | Contents | Index

Using Internet File System (iFS) to Build XML Applications, 4 of 11

## Using the iFS Parsers

When you drop a new XML file, whose structure iFS understands, into a folder, Oracle XML Parser for Java can dissect the XML file and store the separate attributes in the iFS schema. By defining an iFS subclass, you are specifying which attributes go into which columns. You can also let iFS make a default attribute-to-column mapping.

Once parsed, the attributes originally within the file become attributes of the file, This is extra metadata that you can edit and use as search criteria in the file system.

Consider an XML-based company standard insurance claim form. You can instruct iFS to parse the XML insurance claim files, extracting the attribute tag information from each file and storing these chunks separately in a table.

You can then search on the XML attributes, such as region or agent, as you would for any attribute in a file. The data is now also available for use by a relational application, such as insurance industry analytical tools.

Because the XML file has been parsed does not mean that this is the end of that file. When someone opens the original XML file, the XML renderer reconstructs it. See "Rendering XML in iFS" .

### Standard iFS Parsers and Custom Parsers

In iFS your XML application will require a custom parser if the document format produced by the application needs it.

#### When Must iFS Parser be Explicitly Invoked?

iFS parser is invoked depending on how the documents produced by your application are entered into iFS.

- If the XML documents are uploaded using protocol servers, iFS XML parser will be invoked automatically by the protocol servers.

- If the XML documents are uploaded by an application, you must explicitly invoke either the iFS XML parser or a custom parser.If not, the XML documents will be read in as raw data, instead of being parsed into objects.

- If your application defines a custom class that produces documents in a format other than XML, create a custom parser using the classes and methods provided as part of the iFS Java API.

  The custom parser will create iFS repository objects of your custom class.

  For example, assume you have defined a Memo class that subclasses the Document class. The Memo class includes the following custom attributes: To, From, Date, and Text (the content of the memo).

  To store Memo objects in iFS requires a parser.

  - If the Memo documents are in XML, you can use the iFS `SimpleXmlParser()` to extract the attributes

  - If the Memo documents are stored in a special format, create a custom parser and specify how to extract the attributes

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index