Skip to content

Instantly share code, notes, and snippets.

@jmcmichael
Created September 15, 2011 16:21
Show Gist options
  • Save jmcmichael/1219705 to your computer and use it in GitHub Desktop.
Save jmcmichael/1219705 to your computer and use it in GitHub Desktop.
build notes node generation
sub get_notes_node {
my $self = shift;
my $build = $self->subject;
my $doc = $self->_doc;
my $parser = XML::LibXML->new();
my $notes_node = $doc->createElement('aspect');
$notes_node->addChild( $doc->createAttribute("name", "notes") );
my @notes = $build->notes;
for my $note ( @notes ) {
my $v = Genome::MiscNote::View::Status::Xml->create(subject => $note);
my $xml = $v->content;
my $note_node = $parser->parse_string($xml);
my $note_root = $note_node->getDocumentElement;
$notes_node->addChild($note_root);
}
return $notes_node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment