承接 ottosmops/xmlvalidator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ottosmops/xmlvalidator

Composer 安装命令:

composer require ottosmops/xmlvalidator

包简介

Validate XML-Files, also parts

README 文档

README

Software License Tests Packagist Downloads

This package was developed to validate Mets files for the DFG-Viewer. It is possible to validate only parts of a xml-file. Validation is possible with xsd, rng and xsl (Schematron). To validate only parts of an XML file, specify the root element of that part. In the tests folder is a copy of dmj/dfgviewer-schema.

Installation

composer require ottosmops/xmlvalidator

Usage

There is the one and only method validate:

<?php

require('vendor/autoload.php');

use Ottosmops\XmlValidator\XmlValidator;

class test {
    public static function index() {
        $option = ['file'   => 'tests/data/valid/mets_001.xml',
                    'ns'     => 'mets',
                    'nsuri'  => 'https://www.loc.gov/METS/',
                    'root'   => 'mets',
                    'schema' => 'https://www.loc.gov/standards/mets/mets.xsd'];

        $validator = new XmlValidator($option);
        if (!$validator->validate()) {
            print("validated mets: is not valid".PHP_EOL);
            print($validator->getErrors());
        } else {
            print("validated mets: is valid".PHP_EOL);
        }
    }
}

test::index();

You can find more examples in the tests folder.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 144
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: XSLT

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固