Commits

Anonymous committed ebe905b

Added the sub-cats.

Comments (0)

Files changed (3)

 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 use IO::All;
 
 use XML::LibXML;
 
-# TEST*1
+# TEST:$num_files=2
+# TEST*$num_files
 foreach my $xml_file (io("./valid-xmls")->all())
 {
     if ($xml_file =~ /\.xml$/)

xslt/products-syndication.dtd

 <!ELEMENT product-syndication (meta?,data)>
 <!ELEMENT meta (#PCDATA)>
 <!ELEMENT data (cat)>
-<!ELEMENT cat (title,desc?)>
+<!ELEMENT cat (title,desc?,cat*)>
 <!ELEMENT desc (p*)>
 <!ELEMENT p (#PCDATA)>
 <!ELEMENT title (#PCDATA)>

xslt/valid-xmls/002-nested-cat.xml

+<?xml version='1.0' encoding='utf-8'?>
+<?xml-stylesheet type="text/xml" href="product-syndication.xsl"?>
+<!DOCTYPE comparison SYSTEM "product-syndication.dtd">
+<product-syndication>
+    <data>
+        <cat id="books">
+            <title>Books</title>
+            <desc>
+                <p>
+                    These are my books.
+                </p>
+            </desc>
+            <cat id="fiction_books">
+                <title>Fiction books</title>
+            </cat>
+            <cat id="computer_books">
+                <title>Computer books</title>
+            </cat>
+        </cat>
+    </data>
+</product-syndication>