X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=README.pod;h=fc667fef37d1467389989b3f7b883c376c771166;hb=eb912094365336d4af3aede041fc636ef8bc7607;hp=35efe2d37a0a31c9cd9b72659500c2f922a347f9;hpb=9ba11a91c8ca59f9b5e1797afd6ee565b654fcb2;p=catagits%2FDOM-Tiny.git diff --git a/README.pod b/README.pod index 35efe2d..fc667fe 100644 --- a/README.pod +++ b/README.pod @@ -77,8 +77,8 @@ names are lowercased and selectors need to be lowercase as well. my $dom = DOM::Tiny->new('

Hi!

'); say $dom->at('p[id]')->text; -If XML processing instructions are found, the parser will automatically switch -into XML mode and everything becomes case-sensitive. +If an XML declaration is found, the parser will automatically switch into XML +mode and everything becomes case-sensitive. # XML semantics my $dom = DOM::Tiny->new('

Hi!

'); @@ -394,7 +394,7 @@ objects. All selectors listed in L are supported. $dom = $dom->append('

I ♥ DOM::Tiny!

'); -Append HTML/XML fragment to this node. +Append HTML/XML fragment to this node (for all node types other than C). # "

Test

123

" $dom->parse('

Test

') @@ -427,8 +427,8 @@ node's content. my $result = $dom->at('div ~ p'); Find first descendant element of this element matching the CSS selector and -return it as a L object or return C if none could be found. -All selectors listed in L are supported. +return it as a L object, or C if none could be found. All +selectors listed in L are supported. # Find first element with "svg" namespace definition my $namespace = $dom->at('[xmlns\:svg]')->{'xmlns:svg'}; @@ -584,7 +584,7 @@ L are supported. my $namespace = $dom->namespace; -Find this element's namespace or return C if none could be found. +Find this element's namespace, or return C if none could be found. # Find namespace for an element with namespace prefix my $namespace = $dom->at('svg > svg\:circle')->namespace; @@ -596,8 +596,8 @@ Find this element's namespace or return C if none could be found. my $sibling = $dom->next; -Return L object for next sibling element or C if there are no -more siblings. +Return L object for next sibling element, or C if there are +no more siblings. # "

123

" $dom->parse('

Test

123

')->at('h1')->next; @@ -606,7 +606,7 @@ more siblings. my $sibling = $dom->next_node; -Return L object for next sibling node or C if there are no +Return L object for next sibling node, or C if there are no more siblings. # "456" @@ -621,8 +621,11 @@ more siblings. my $parent = $dom->parent; -Return L object for parent of this node or C if this node has -no parent. +Return L object for parent of this node, or C if this node +has no parent. + + # "Test" + $dom->parse('

Test

')->at('i')->parent; =head2 parse @@ -631,7 +634,7 @@ no parent. Parse HTML/XML fragment. # Parse XML - my $dom = DOM::Tiny->new->xml(1)->parse($xml); + my $dom = DOM::Tiny->new->xml(1)->parse('I ♥ DOM::Tiny!'); =head2 preceding @@ -659,7 +662,7 @@ before this node as L objects. $dom = $dom->prepend('

I ♥ DOM::Tiny!

'); -Prepend HTML/XML fragment to this node. +Prepend HTML/XML fragment to this node (for all node types other than C). # "

Test

123

" $dom->parse('

123

') @@ -691,7 +694,7 @@ node's content. my $sibling = $dom->previous; -Return L object for previous sibling element or C if there +Return L object for previous sibling element, or C if there are no more siblings. # "

Test

" @@ -701,7 +704,7 @@ are no more siblings. my $sibling = $dom->previous_node; -Return L object for previous sibling node or C if there are +Return L object for previous sibling node, or C if there are no more siblings. # "123" @@ -837,13 +840,13 @@ C, C or C. my $value = $dom->val; Extract value from form element (such as C