Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107293 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 31039 invoked from network); 23 Sep 2019 11:04:03 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 23 Sep 2019 11:04:03 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id A23CA2D1554 for ; Mon, 23 Sep 2019 01:42:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp3.php.net (Postfix) with ESMTPS for ; Mon, 23 Sep 2019 01:42:06 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id u22so16098722qtq.13 for ; Mon, 23 Sep 2019 01:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beberlei-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=16n2i8r1TIrScHBZA0dszMdyFNxTAUirXySupkVdew0=; b=ufAqv93tPzz6NBlezHrsnss5KDqLJLKn0nkni2AP+knb5BrBe7yFiwoUfJxZslPU9J gDFfYfxaOZbPH3JEMgFQQ0m2qxZ5HOi1ej2qSbQJ2W4mvOHAIcq7FEZWqS78+PnhKUjP CbSbJT0d2h2IVOYv283I8Drw05QqAi3h8cWOqJsE+72poyuVx86BdarGyR7F2AZwBA7q gi4zg7rNayTlV6wuSnkz6l3mksovvSmJvG0I2x4IYttvukXWG7x8WM4UB7iFdJhDRrhv fkmcbF1Zjq5xZOuQjlDFv4Kbc4eTfJrsOzOFnh25Cf27rShaURHfLzzqeIbKHc8SYD2G iX2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=16n2i8r1TIrScHBZA0dszMdyFNxTAUirXySupkVdew0=; b=T06K+zA/CVem9luLeaTAKjXUhvalI0wqbXOjPuuKBMiutwbwaXjfcdPZxdUKcbxuzT 186806bR5jZLxE+2pkPaiSBlSeHWh35oXZZvjn82HB6AvU50VmFYhGB/dpPbcS08gI6u EY/dwuX2umDEbkGJLrCBMFiUV5GQ1iO4tQvYZrIMi8ldbJg88w4nxcwnnDAXsZP9VZak 6GScmYizTjZp/GxrCWB5WPS0J0xX35DJZABeT99AcIoPif8W/jHFud4Onrc+25v2n0dM s9FvlozVOFSVScTuGK9HIu6DWACu9nyyr5ZVnag38PnTwx5bdRKn3EbnIGLEzUKv+omk iYGQ== X-Gm-Message-State: APjAAAX9lo6Jve/ZvpHBhZKH19nExSFd/2ZMH8c4qJ5KiUmWkLarZzRY d5CkktaTyFWuZYX4jh5CGgufn+yjL78AVJ8YMn2lVg== X-Google-Smtp-Source: APXvYqyXfQTLAe15I/X9z8PEaV5MvfvWbDd42yj6QgcRg9zRSIwx9eObDdjSB+RroaoR9plbuCoIG2mY1ZNlsPQTwnM= X-Received: by 2002:a0c:a9d3:: with SMTP id c19mr23577128qvb.172.1569228126238; Mon, 23 Sep 2019 01:42:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 23 Sep 2019 10:41:54 +0200 Message-ID: To: Gert Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000094bc0059334655f" X-Envelope-From: Subject: Re: [PHP-DEV] XML Validation From: kontakt@beberlei.de (Benjamin Eberlei) --000000000000094bc0059334655f Content-Type: text/plain; charset="UTF-8" On Mon, Sep 23, 2019 at 9:47 AM Gert wrote: > Is this something that would need an RFC? > I would think this is possible without the RFC. It is similar to https://wiki.php.net/rfc/json_throw_on_error which everyone +1ed You could write out fully the new suggested method signatures, what exception they would throw and how the errors would look like into the bug ticket. > > I'd be willing to take a shot at it myself, but my C experience is > rather limited, so i'm not sure if i could cook up an implementation. > > > On Mon, 23 Sep 2019 at 09:44, Benjamin Eberlei > wrote: > > > > Hi Gert, > > > > On Mon, Sep 23, 2019 at 9:38 AM Gert wrote: > >> > >> Hi Internals, > >> > >> I've been working with XML and validation recently, and the Dom > >> classes do basically everything that is needed. The only thing is that > >> to get the errors of the schema validation we call the > >> `validateSchema` on the DomDocument, and then use the > >> `libxml_get_errors` function to actually get the errors. > >> > >> I'd like to propose either adding a flag to the `validateSchema` to > >> make it throw an error detailing the actual XML errors, or adding a > >> new function that validates and throws with all errors. > >> > >> I'd like to do the same with `schemaValidateSource` as well. > >> > >> Do you think this is something that should be added to PHP itself, or > >> is it something that should be solved by third party packages? > > > > > > this is something that should be added to PHP's dom classes, but the C > development always takes longer than a userland library. > > > > If you please add a ticket on https://bugs.php.net, for this I will > consider it for ext/dom, as I think it would be very useful for PHP 8 to go > away from the warnings and libxml error handling approach to something > better as you suggest. > >> > >> > >> -- > >> PHP Internals - PHP Runtime Development Mailing List > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > --000000000000094bc0059334655f--