File: 21catalog.t

package info (click to toggle)
libxml-libxml-perl 2.0116%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,420 kB
  • sloc: perl: 6,139; ansic: 3,752; xml: 182; sh: 64; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

use strict;
use warnings;

use Test::More tests => 1;

use XML::LibXML;

# XML::LibXML->load_catalog( "example/catalog.xml" );

# the following document should not be able to get parsed
# if the catalog is not available

my $doc = XML::LibXML->new( catalog => "example/catalog.xml" )->parse_string(<<EOF);
<!DOCTYPE article
  PUBLIC "-//Perl//XML LibXML V4.1.2//EN"
  "http://axkit.org/xml-libxml/test.dtd">
<article>
<pubData>Something here</pubData>
<pubArticleID>12345</pubArticleID>
<pubDate>2001-04-01</pubDate>
<pubName>XML.com</pubName>
<section>Foo</section>
<lead>Here's some leading text</lead>
<rest>And here is the rest...</rest>
</article>
EOF

# TEST
ok($doc, 'Doc was parsed with catalog');