greenter/ubl-validator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

greenter/ubl-validator

最新稳定版本:v2.2.0

Composer 安装命令:

composer require greenter/ubl-validator

包简介

OASIS Universal Business Language Schema Validator UBL v2.0, UBL v2.1

README 文档

README

Github Actions Coverage Status Codacy Badge Mutation Badge
OASIS Universal Business Language (UBL) Schema Validator.

Install

Via Composer from packagist.org.

composer require greenter/ubl-validator

Examples

Simple usage.

use Greenter\Ubl\UblValidator; $xml = file_get_contents('20000000001-01-F001-1.xml'); $validator = new UblValidator(); if ($validator->isValid($xml)) { echo 'Success!!!'; } else { echo $validator->getError(); }

Above example follows next steps:

  • Resolve <cbc:UBLVersionID>
  • Find XSD file in base directory
  • Run schemaValidate and gets result

Change UBL XSD directory

This package not include all UBL xsd, but you can add others xsd directory and use other UBL version.

use Greenter\Ubl\UblValidator; use Greenter\Ubl\Resolver\UblPathResolver; $ubl = new UblValidator(); $ubl->pathResolver = new UblPathResolver(); $ubl->pathResolver->baseDirectory = './my-ubl-xsd'; echo $ubl->isValid('<Invoice ...>');

/my-ubl-xsd directory follows this structure:

\my-ubl-xsd │ ├─2.1/ │ ├─ common/ │ └─ maindoc/ │ ├─2.2/ │ ├─ common/ │ └─ maindoc/ 

You can download UBL xsd from oasis-open

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固