php check_xml_file_structure.php base_file=base.xml check_file=check.xml
if [ "j$?" != "j0" ]; then
echo "Run Error"
fi
测试范例 1
base_1.xml
复制代码 代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<Category>Category文字</Category>
<Title>Title文字</Title>
</item>
</items>
check_1.xml
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<Category>Category文字</Category>
<Title>Title文字</Title>
</item>
<item>
<Category>Category文字</Category>
<Title>Title文字</Title>
<Description>Description文字</Description>
</item>
</items>
测试范例 2
base_2.xml
复制代码 代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item category="Category文字" Title="Title文字"/>
</items>
check_2.xml
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item category="Category文字" Title="Title文字" Description="Description文字" />
<item category="Category文字" Title="Title文字" />
<item category="Category文字" Title="Title文字" Description="Description文字" />
</items>
您可能感兴趣的文章: