Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

XMLUtils
a module for useful XML utilities for Genex DBs

XMLUtils - a module for useful XML utilities for Genex DBs


NAME

XMLUtils - a module for useful XML utilities for Genex DBs


SYNOPSIS


  use XMLUtils;

  $out_string = pretty_print($in_string);

  assert_element($dom_node, 'node_name');


DESCRIPTION

Methods for transforming information from a GeneX DB into XML.


FUNCTIONS

pretty_print($string)
pretty_print({INDENT=>$val,COLLAPSE=>[@list1],NO_ATTR_BALANCE=>[@list2]},$string)
This function takes an XML string and reformats it. The function takes an optional first parameter anonymous hash reference that enables modification of the internal reformatting parameters.
  • INDENT

    The indent level in spaces. The defualt is 2.

  • COLLAPSE

    A list of tags that should have their beginning and end tags collapsed onto a single line. This will result in any intervening tags collapsed onto the same line. The default is ('feature').

  • NO_ATTR_BALANCE

    A list of attribute names that should not be moved to a separate line. The default is ('xml').

get_genexml_node();
Description: A convenience method for retrieving the root node of the GeneXML document.

Return Value: XML::DOM::Element representing the <GENEXML>

Errors: Will call die() on error

get_header_node();
Description: A convenience method for retrieving the <header> node of the GeneXML document.

Return Value: XML::DOM::Element representing the <header>

Errors: Will call die() on error

get_genex_info_node();
Description: A convenience method for retrieving the <genex_info> node of the GeneXML document.

Return Value: XML::DOM::Element representing the <genex_info>

Errors: Will call die() on error

get_vocabulary_list_node();
Description: A convenience method for retrieving the <controlled_vocabulary_list> node of the GeneXML document.

Return Value: XML::DOM::Element representing the <controlled_vocabulary_list>

Errors: Will call die() on error

get_misc_list_node();
Description: A convenience method for retrieving the <misc_list> node of the GeneXML document.

Return Value: XML::DOM::Element representing the <misc_list>

Errors: Will call die() on error

get_header_list_node($list_name);
Description: A convenience method for retrieving the <$list_name> node from within the <header> of the GeneXML document.

Side Effects: Will create <$list_name> if it does not already exist

Return Value: XML::DOM::Element representing the <$list_name>

Errors: Will call die() on error

get_genex_info_list_node($list_name);
Description: A convenience method for retrieving the <$list_name> node from within the <genex_info> of the GeneXML document.

Side Effects: Will create <$list_name> if it does not already exist

Return Value: XML::DOM::Element representing the <$list_name>

Errors: Will call die() on error

assert_element($dom_node, $node_name);
This raises an exception unless $dom_node is an obect of type XML::DOM::Node, and the tag name is $node_name.

create_id($table_name, $pkey);
Creates an ID value for entering into a document based on $table_name and $pkey.

lokup_id($table_name, $pkey, $create);
Creates an ID value for entering into a document based on $table_name and $pkey.

create_element($name);
A convenience method to create an XML::DOM::Element node named $name, that will die() unless successful.


AUTHOR

Jason Stewart (jes@ncgr.org)


SEE ALSO

perl(1).

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy