XML_NITF
[ class tree: XML_NITF ] [ index: XML_NITF ] [ all elements ]

Class: XML_NITF

Source Location: /XML_NITF-1.1.1/XML/NITF.php

Class Overview

XML_Parser
   |
   --XML_NITF

Simple NITF Parser


Author(s):

Version:

  • Release: 1.0.2

Copyright:

  • 1997-2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 69]
Simple NITF Parser

This class provides basic NITF parsing. Many of the major elements of the NITF standard are supported. This implementation is based off the NITF 3.1 DTD, publicly available at the following URL:

http://www.nitf.org/site/nitf-documentation/nitf-3-1.dtd

Note that not all elements of this standard are not supported.

<sample> <?php

require_once("XML/NITF.php");

$oNITF =& new XML_NITF(); $oNITF->setInputFile("nitf.xml"); $xResult = $oNITF->parse(); if (PEAR::isError($xResult)) { die("Parsing failed: ".$xResult->getMessage()); }

echo $oNITF->getHeadline(); echo $oNITF->getByline();

?> </sample>



[ Top ]


Method Detail

getBibliography   [line 454]

string getBibliography( )

Returns the free-form bibliographic data
  • Return: The bibliography (if one exists) is returned
  • Access: public

[ Top ]

getByline   [line 350]

string getByline( [string $sProperty = 'author'])

Return information about the author of a document
  • Return: The entire byline as we found in the document
  • Access: public

Parameters:

string   $sProperty   —  The field of the byline to retrieve.

[ Top ]

getContent   [line 426]

array &getContent( )

Returns the paragraphs of content
  • Return: An array of elements that represent a single paragraph each
  • Access: public

[ Top ]

getDocData   [line 245]

mixed getDocData( [string $sProperty = null])

Access all or specific elements of the <docdata> block
  • Return: All of the elements from the <docdata> block will be returned if a specific property is not provided. If a specific property is requested and is found in the docdata block, then that property will be returned. If the property cannot be found, null is returned.
  • See: getDocDataElement()
  • Access: public

Parameters:

string   $sProperty   —  The property of the <docdata> block to return, the most common being: +"doc-id" - a unique identifier of this document (string) +"key-list" - a list of keywords provided with the document (array) +"copyright" - the copyright holder (string) +"series" - if the document is part of series (string) +"urgency" - a number between 1 (urgent) and 8 (not urgent) (integer) +"date.issue" - date the document was issued (UNIX timestamp) +"date.release" - date the document is publicly available (UNIX timestamp) +"date.expires" - date the document is no longer valid (UNIX timestamp) +"management-status" - this document's current workflow status

[ Top ]

getHeadline   [line 335]

mixed getHeadline( [integer $nLevel = 1])

Retrieve all headlines or a single headline denoted by key
  • Return: Returns an array if no specific headline element is requested, or a string if the specific headline element requested exists
  • Access: public

Parameters:

integer   $nLevel   —  The key value corresponding to the headline to be retrieved

[ Top ]

getLede   [line 407]

string getLede( )

Returns the lede (sometimes called lead) paragraph
  • Return: Returns the lede paragraph if it is defined, or null otherwise
  • Access: public

[ Top ]

getMedia   [line 375]

array getMedia( [string $sProperty = null])

Query for a list of related media elements
  • Return: Returns an array of all media reference data, or an array of select media reference data determined by the property parameter passed.
  • Access: public

Parameters:

string   $sProperty   —  If supplied, only this property will be returned for each element of the media reference array.

[ Top ]

getMetaData   [line 269]

array getMetaData( )

Retrieve meta data from the NITF file
  • Return: Returns an array of key/value pairs from the meta section
  • Access: public

[ Top ]

getPubData   [line 286]

mixed getPubData( [string $sProperty = null])

Returns all elements or a specific element from the <pubdata> block
  • Return: Returns string, numeric, or array values depending on the property being accessed from the <pubdata> block.
  • Access: public

Parameters:

string   $sProperty   —  The publication property being retrieved

[ Top ]

getRevision   [line 318]

array getRevision( )

Get the revision history
  • Return:

    An array containing key-value arrays. The properties of each array element in this array are:

    +"comment" - Reason for the revision +"function" - Job function of individual performing revision +"name" - Name of the person who made the revision +"norm" - Date of the revision

  • Access: public

[ Top ]

getTagline   [line 440]

string getTagline( )

Returns the tag line (if one exists)
  • Return: The tag line extracted from the NITF data source
  • Access: public

[ Top ]

toString   [line 472]

string &toString( [string $sCRLF = "\n"])

Get a string version of the article
  • Return: A string representing the main headline, author, content, and tagline.
  • Access: public

Parameters:

string   $sCRLF   —  The character(s) used to separate each article element in the string that is returned - often referred to as the CRLF.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:19 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.