XML-LibXML-LazyBuilder

 view release on metacpan or  search on metacpan

lib/XML/LibXML/LazyBuilder.pm  view on Meta::CPAN


our @EXPORT = qw(
);

our $VERSION = '0.08';

# This is a map of all the DOM level 3 node names for
# non-element/attribute nodes. Note how there is no provision for
# processing instructions.
my %NODES = (
    '#cdata-section'     => 1,
    '#comment'           => 1,
    '#document'          => 1,
    '#document-fragment' => 1,
    '#text'              => 1,
);

# Note this is and will remain a stub until appropriate behaviour can
# be worked out.

# (Perhaps a name of ?foo for processing instructions?)

t/XML-LibXML-LazyBuilder.t  view on Meta::CPAN

    my $e2 = $sub->();

    #diag($d->toString);

    is($e->namespaceURI, 'urn:x-foo:', 'propagated namespace');

    # XXX should really do way more tests here but effit
}

{
    # fragment, processing instruction, DTD, comment, cdata
    my $d = DOM F(
        (P 'xml-stylesheet' => { type => 'text/xsl', href => '/foo.xsl' }),
        (DTD 'foo'),
        (E foo => { xmlns => 'urn:x-wat:' }, E bar => {}, (C 'yo'), (D 'hi')));

    #diag($d->toString(1));

    # only really concerned that the namespaces came out ok
    my $nsuri = $d->documentElement->firstChild->namespaceURI;
    is($nsuri, 'urn:x-wat:', 'namespace survived fragment');



( run in 0.768 second using v1.01-cache-2.11-cpan-454fe037f31 )