.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "XML::XBEL 3" .TH XML::XBEL 3 "2008-01-15" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" XML::XBEL \- OOP for reading and writing XBEL documents. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # creating an XBEL document .Ve .PP .Vb 3 \& use XML::XBEL; \& use XML::XBEL::Folder; \& use XML::XBEL::Bookmark; .Ve .PP .Vb 2 \& my $xbel = XML::XBEL->new(); \& $xbel->new_document({title=>"My Bookmarks"}); .Ve .PP .Vb 3 \& $xbel->add_bookmark({href => "http://foo.com", \& title => "foo", \& desc => "bar"}); .Ve .PP .Vb 3 \& my $folder1 = XML::XBEL::Folder->new({title => "comp"}); \& my $folder2 = XML::XBEL::Folder->new({title => "lang"}); \& my $folder3 = XML::XBEL::Folder->new({title => "perl"}); .Ve .PP .Vb 2 \& my $bm = XML::XBEL::Bookmark->new({"title=>"misc"}); \& $bm->href("http://groups.google.com/groups?q=comp.lang.perl.misc"); .Ve .PP .Vb 3 \& $folder3->add_bookmark($bm); \& $folder2->add_folder($folder3); \& $folder1->add_folder($folder2); .Ve .PP .Vb 1 \& $xbel->add_folder($folder1); .Ve .PP .Vb 1 \& print $xbel->toString(); .Ve .PP .Vb 1 \& # parsing an XBEL document .Ve .PP .Vb 1 \& use XML::XBEL; .Ve .PP .Vb 2 \& my $xbel = XML::XBEL->new(); \& $xbel->parse_file($file); .Ve .PP .Vb 1 \& foreach my $bm ($xbel->bookmarks()) { .Ve .PP .Vb 4 \& print sprintf("%s points to %s\en", \& $bm->title(), \& $bm->href()); \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1OOP\s0 for reading and writing \s-1XBEL\s0 files. .SH "PACKAGE METHODS" .IX Header "PACKAGE METHODS" .Sh "_\|_PACKAGE_\|_\->\fInew()\fP" .IX Subsection "__PACKAGE__->new()" Returns an \fI\s-1XML::XBEL\s0\fR object. .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .Sh "$self\->parse_file($file)" .IX Subsection "$self->parse_file($file)" Returns true or false. .Sh "$self\->parse_string($string)" .IX Subsection "$self->parse_string($string)" Returns true or false. .Sh "$obj\->new_document(\e%args)" .IX Subsection "$obj->new_document(%args)" Valid arguments are : .IP "* \fBtitle\fR" 4 .IX Item "title" String. .IP "* \fBdesc\fR" 4 .IX Item "desc" String. .IP "* \fBinfo\fR" 4 .IX Item "info" Hash ref, with the following key/value pairs : .RS 4 .IP "* \fIowner\fR" 6 .IX Item "owner" Array ref. .RE .RS 4 .RE .PP Returns true or false. .Sh "$obj\->title($title)" .IX Subsection "$obj->title($title)" Get/set the title for an \s-1XBEL\s0 document. .PP Returns a string when called with no arguments; otherwise returns true or false. .Sh "$obj\->desc($description)" .IX Subsection "$obj->desc($description)" Get/set the description for an \s-1XBEL\s0 document. .PP Returns a string when called with no arguments; otherwise returns true or false. .Sh "$obj\->info(\e%args)" .IX Subsection "$obj->info(%args)" Get/set the metadata for an \s-1XBEL\s0 document. .PP Valid args are : .IP "* \fBowner\fR" 4 .IX Item "owner" Array reference .PP Returns an array reference when called with no arguments; otherwise returns true or false. .Sh "$obj\->bookmarks($recursive)" .IX Subsection "$obj->bookmarks($recursive)" Returns a list of child \fIXML::XBEL::Bookmark\fR objects. .PP Where \fI$recursive\fR is a boolean indicating whether to return all the bookmarks in an \s-1XBEL\s0 document or only its immediate children. .Sh "$obj\->folders($recursive)" .IX Subsection "$obj->folders($recursive)" Returns a list of child \fIXML::XBEL::Folder\fR objects. .PP Where \fI$recursive\fR is a boolean indicating whether to return all the folders in an \s-1XBEL\s0 document or only its immediate children. .Sh "$obj\->aliases($recursive)" .IX Subsection "$obj->aliases($recursive)" Returns a list of child \fIXML::XBEL::Alias\fR objects. .PP Where \fI$recursive\fR is a boolean indicating whether to return all the aliases in an \s-1XBEL\s0 document or only its immediate children. .Sh "$obj\->find_by_id($id)" .IX Subsection "$obj->find_by_id($id)" Returns an \fIXML::XBEL::Bookmark\fR or \fIXML::XBEL::Folder\fR object whose id attribute matches \f(CW$id\fR. .Sh "$obj\->find_by_href($href)" .IX Subsection "$obj->find_by_href($href)" Returns a list of \fIXML::XBEL::Bookmark\fR objects whose href attribute matches \f(CW$href\fR. .Sh "$obj\->add_bookmark((XML::XBEL::Bookmark || \e%args))" .IX Subsection "$obj->add_bookmark((XML::XBEL::Bookmark || %args))" Add a new bookmark to an \s-1XBEL\s0 document. .PP If passed a hash ref, valid arguments are the same as those defined for the \fIXML::XBEL::Bookmark\fR object constructor. .Sh "$obj\->add_folder((XML::XBEL::Folder || \e%args))" .IX Subsection "$obj->add_folder((XML::XBEL::Folder || %args))" Add a new folder to an \s-1XBEL\s0 document. .PP If passed a hash ref, valid arguments are the same as those defined for the \fIXML::XBEL::Folder\fR object constructor. .Sh "$obj\->add_alias((XML::XBEL::Alias || \e%args))" .IX Subsection "$obj->add_alias((XML::XBEL::Alias || %args))" Add a new alias to an \s-1XBEL\s0 document. .PP If passed a hash ref, valid arguments are the same as those defined for the \fIXML::XBEL::Alias\fR object constructor. .Sh "$obj\->\fIadd_separator()\fP" .IX Subsection "$obj->add_separator()" Add a new separator to an \s-1XBEL\s0 document. .Sh "$obj\->toString($format)" .IX Subsection "$obj->toString($format)" .Sh "$obj\->toFile($filename,$format)" .IX Subsection "$obj->toFile($filename,$format)" .Sh "$obj\->toFH(\e*$fh,$format)" .IX Subsection "$obj->toFH(*$fh,$format)" .Sh "$obj\->toSAX(A::SAX::Handler)" .IX Subsection "$obj->toSAX(A::SAX::Handler)" Generate \s-1SAX\s0 events for the \s-1XBEL\s0 object. .SH "VERSION" .IX Header "VERSION" 1.4 .SH "DATE" .IX Header "DATE" $Date: 2005/04/02 20:54:52 $ .SH "AUTHOR" .IX Header "AUTHOR" Aaron Straup Cope .SH "SEE ALSO" .IX Header "SEE ALSO" XML::XBEL::Folder .PP XML::XBEL::Bookmark .PP XML::XBEL::Alias .PP XML::XBEL::Separator .SH "BUGS" .IX Header "BUGS" It's possible. Please report all bugs via http://rt.cpan.org .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2004 Aaron Straup Cope. All rights reserved. .PP This is free software, you may use it and distribute it under the same terms as Perl itself.