MAGE::XML::Writer(3pm) | User Contributed Perl Documentation | MAGE::XML::Writer(3pm) |
Bio::MAGE::XML::Writer - a module for exporting MAGE-ML
use Bio::MAGE::XMLUtils; my $writer = Bio::MAGE::XML::Writer->new(@args); $writer->write($mage); # # attributes to modify where the output is written # # set the output filehandle my $fh = \*STDOUT; $writer->fh($fh); # whether to write data cubes externally (default == FALSE) $writer->external_data($bool); # which directory to write external data cubes (default == /tmp) $writer->external_data_dir($path); # whether the to interpret the C<cube> as data or a file # path (default == FALSE) $writer->cube_holds_path($bool); # # attributes to modify the output format # # which format is the external data file $writer->data_format($dataformat); # to change the level of indent for each new tag (defaul == 2) $writer->indent_increment($num); # to change the beginning indent level (defaul == 0) $writer->indent_level($num); # set to true to not format attributes (default == FALSE) $writer->attrs_on_one_line($bool); # how many extra spaces attributes should be indented past start # tag end (default == 1) $writer->attr_indent($num); # whether to write all sub-tags on the same line (default == undef) $writer->collapse_tag($bool); # # attributes to modify the the document # # to change the encoding (default == ISO-8859-1) $writer->encoding($format); # to set the public id (default == undef) $writer->public_id($id); # to change the system id (default == MAGE-ML.dtd) $writer->system_id($id); # check to see that objects set more than just identifier (default == TRUE) $writer->empty_identifiable_check(); # # attributes to handle identifiers # # whether to create identifiers if not specified (default == FALSE) $writer->generate_new_identifiers(); # code reference to be invoked for creating new identifiers $writer->generate_identifier();
Methods for transforming information from a MAGE-OM objects into MAGE-ML.
The following methods must all be invoked using an instance of Bio::MAGE::XML::Writer;
Default Value: 0 (zero)
Default Value: 2
Default Value: false
<Reporter identifier="Reporter:X Units Per Pixel" name="X Units Per Pixel">
The following illustrates and "attr_indent" of -2:
<Person firstName="John" identifier="Person:John Smith" name="John Smith" lastName="Smith">
Default Value: 1
Currently it controls whether or not to write a newline after each elements start tag, with no method to decide to write or not to write based on the name of the tag.
Default Value: false
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
Default Value: ISO-8859-1
Default Value: undef
<!DOCTYPE MAGE-ML SYSTEM "MAGE-ML.dtd">
Default Value: MAGE-ML.dtd
Default Value: \&identifier_generation
Default Value: false
Default Value: undef
Default Value: false
Default Value: 'tab delimited'
The "external_data_dir" controls what director those files are written to.
Default Value: /tmp
Default Value: false
NOTE: Currently no checking of association values is made, only attributes. So if you want to ensure that an Identifiable object is written, make sure that you set the "name" attribute as well as the "identifier" attribute.
Default Value: true
Hey! The above document had some coding errors, which are explained below:
2020-12-01 | perl v5.32.0 |