|
Markup::TreeNode - Class representing a marked-up node |
use Markup::TreeNode;
my $new_node = Markup::TreeNode->new(tagname => 'p');
This module exists pretty much soley for the Markup::Tree manpage. I'm sure you can find plenty of other uses for it, but that's probably the best. Please let me know if and how you use this outside of it's purpose, I'm very intrested :).
At object instantiation (initilization) the following properties can be set. Addtionally, they can be read/written in a standard hash way: print $node->{'text'}.
text property to see what the declaration was
(intact minus the <! >.
element_types marked with -->ignore will be overlooked
(but not children of -->ignore (unless they also are -->ignore))
by the Markup::Tree manpage's foreach_node and save_as methods.
tagname will be either
asp-style or php-style depending on wheter the
tag was started and ended with % or ?.
Because it would disturb the natural flow of things later, pis are treated differently when they are found within quotes, as in an attribute. Instead of thier normal tagging, <pi language=``style''></pi> they are instead represented in the following format: {pi:language=style:the pi information found}.
Example:
<p>some text</p>
<?php print "<p>some more text</p>"; ?>
becomes
<p>
some text
</p>
<pi language = "php-style">
print "<p>some more text</p>";
</pi>
whereas
<p class = "<?=print "classname";?>">some text</p>
becomes
<p class = "{pi:language=php-style:=print %QUOTE%classname%QUOTE%;}">
some text
</p>
Make sense?
get_section('navigation')
or something like that. Currently used only by the
Markup::Match* modules.
element_types this is the name of the element.
For -->pi element_types this is either
asp-style or php-style depending on wheter the
tag was started and ended with % or ?.
For all other elements it is usually the same as element_type.
Markup::TreeNode.
If empty the value of this property is '(empty)'.
Markup::TreeNodess.
Markup::TreeNode)Markup::TreeNode)child_nums.
Markup::TreeNode)child_nums.
The difference between this method and the attach_child method is that this
method will add the specified child as the first child of it's children,
rather than the last.
child_nums.
next_node is a text, returns its text. If all fails, undef is returned.
Markup::TreeNode in the tree or undef if at the bottom
(or if the algo screwed up).
Markup::TreeNode in the tree or undef if at the top
(or if the algo screwed up).
Markup::TreeNode)Markup::TreeNode, position)Markup::TreeNodeThis method will insert the specified node either before or after itself, depending on the position.
Please let me know if you find any bugs.
BPrudent (Brandon Prudent)
Email: xlacklusterx@hotmail.com
|
Markup::TreeNode - Class representing a marked-up node |