The XML format is intended to be simple and map fairly closely to the source POD. The documentation here
shows the POD marker and the tag that it maps to.
=pod(oranyotherwaytobeginthedocument)
<pod>
<!-- Pod::SAX v0.14, using POD::Parser v1.13 -->
The comment is automatically generated so that you can see what version of Pod::SAX was used in parsing
this document. The closing "</pod>" tag is generated when the end of the POD is reached.
=head1and=headN
<head1>Text here</head1>
All head levels are supported.
Paragraphs
Plain paragraphs are represented with:
<para>text</para>
Verbatim
Verbatim sections (i.e. when you indent the text) are represented with:
<verbatim>text</verbatim>
=over/=back
Pod::SAX automatically detects whether a list is itemized or ordered (i.e. whether it should have bullet
points or numbers), and so =over/=back are represented by:
<itemizedlist> </itemizedlist>
and
<orderedlist> </orderedlist>
respectively. The indent value (as in "=over 4") is saved in the "indent_width" attribute, although for
most purposes this can be ignored.
=item
For both bulleted and numbered lists, the =item tag always maps to:
<listitem>text</listitem>
If a paragraph follows an =item tag (and occurs before any =back) then the paragraph is included
immediately after the tag, so for example:
=item foo
Some text about foo
Maps to:
<listitem>foo
<para>Some text about foo</para>
</listitem>
=beginfoo
And "=for foo" (the two are semantically equivalent in Pod)
<markup type="foo" ordinary_paragraph="0">text here</markup>
If the markup section is meant for ordinary processing (see the perlpodspec section on "About Data
Paragraphs and "=begin/=end" Regions"), which means the type name begins with a colon as in:
=begin :biblio
Then the markup produced indicates that using:
<markup type="biblio" ordinary_paragraph="1"/>
And the parser will expand all interior Pod commands as it should.
Note: There is no special treatment of =begin html or =begin XML or any variant thereof. The contents of
those markers will simply be treated as text, and it is up to the user of this module to parse that data
as XML if they wish to do so.
SequencesorFormattingCodes
Sequences in POD consist of the following:
L<> - Links
E<> - Entities
I<> - Italics
B<> - Bold
C<> - Code
F<> - Filename
S<> - Non breaking space
X<> - Index marker
Z<> - Null
Most sequences are simply converted to tags of the same name, case preserved:
<B>This is bold text</B> and also <I>some in italics</I>.
Special treatment is given to the L<> E<> and S<> tags only.
Links
Links in Pod are... funky.
Parsing links is really hard, so don't expect that I've got this right. Basically though you've got this
mapping:
L<foo/bar>
=> <link type="pod" page="foo" section="bar">foo</link>
L<Some Foo|foo>
=> <link type="pod" page="foo" section="">Some Foo</link>
L<select(3)>
=> <link type="man" page="select(3)" section="">select(3)</link>
L<http://foo.com>
=> <xlink href="http://foo.com">http://foo.com</xlink>
And many variations thereof! Basically it should do the right thing
Entities
In POD an E<> marker defines an entity. In pod these are single characters only, and take either a text
form, in which case they map to the standard HTML entities (e.g. ouml, Agrave etc), or a decimal number
in which case they map to the unicode character at that code point.
In Pod::SAX entities are always converted to unicode and never generate any tags or markers in the data
stream so it will be as though the entity was never there.
Non-BreakingSpace
Non breaking space is simply achieved by changing all space within the S<> section into the unicode
codepoint 160 - the non-breaking space character. Normally this is enough to do the right thing, but if
you need to you can detect this with a regexp.