Validate XML using a custom DTD in PHP

前端 未结 4 1310
温柔的废话
温柔的废话 2021-01-02 03:37

Is there a way (without installing any libraries) of validating XML using a custom DTD in PHP?

4条回答
  •  情深已故
    2021-01-02 04:27

    Trying to complete "owenmarshall" answer:

    in xml-validator.php:

    add html, header, body, ...

    
    $dom->Load('template-format.xml');
    if ($dom->validate()) {
    echo "This document is valid!\n";
    } ?>

    template-format.xml:

    
    
    
    
    
        





    ]>

提交回复
热议问题