Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121185 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 48007 invoked from network); 29 Sep 2023 20:53:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Sep 2023 20:53:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 41F8818004A for ; Fri, 29 Sep 2023 13:53:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 29 Sep 2023 13:52:59 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4054f790190so136606075e9.2 for ; Fri, 29 Sep 2023 13:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696020778; x=1696625578; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=TaAkhgykWo0ua5/J0MvpmIA3sZSVRIqJqy00G5SYBVw=; b=VrLjg6X4v0PfNaaVrmNq4KQWAc3FallUNhe/dqiw5hG61UlPsZZI9Ex9F/HXtOrFiz jZHF+vnIFCX7pig5AZKSjBd3CRgMmyq+gIhsSoE4TYuUtWmAUgHenm9X8FNYaKAX9VWq tZYRiur2MUsG06XqXkax5CiC8SXv+4NYTlwxMHEst26BNWcCzhnEEYYqT19Zmv8kHTsy l0uGThdp+hhSHL1dBtpjOSuX8MSBg9sTsQtOs7/YojSmi3L+mzIqtupsReAmGaPYE+Xx OnXzx1wOgoo4g1cDagHP5GLLhsSCLxLsqkMOkbXeHHiXP0Z5Hizw6L/f5Vp9D9DsPZOw ewiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696020778; x=1696625578; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TaAkhgykWo0ua5/J0MvpmIA3sZSVRIqJqy00G5SYBVw=; b=SVoR4VnXUi9J3P5JtiDDHIgnRFx/ZIBDVGCKsp8PHplFukqsDBCDEAZQRSvxMZfUE6 cmLmPGgYA0EDNVkZ7E/76lWRZxTQ1noMYSbGc2Sgk5fWQEoVyMVGWEn5YLl6c/RVgw21 nafJIk6o46xjgb/d4oUV7FWw8wZoVKoRqNXbWFysi7uqUsr67A/bdDalcr5n5P8a3tv8 NuVGf/eK4paBgvHoCzfTt2m0+HGxBpxH5AwPv75l9Deu1Sxm5exBMyoLKuZ0oJzyXjW6 LX3pIFBFAwznnJj0eaqBkbiiawNN24chwQJn1/+L3qwc1e5SUrHs590+TLUWm+bFD6cL 4wkA== X-Gm-Message-State: AOJu0YxCWMg0JYBhZVNtoeZL/EV8TtZfqiZ31uIwdkk073rnrriWx2Z1 IpLXAnB9Seqj3vyQzxmGa6BfZRfvF98= X-Google-Smtp-Source: AGHT+IFtr1EHS8uwLUcmVRU+ZkY5qvjUgvFLlRe1tuNKsHtlk+jKRGAsjXg9Q5492AV/9mro9O3njw== X-Received: by 2002:a05:600c:294a:b0:403:7b2:6d8f with SMTP id n10-20020a05600c294a00b0040307b26d8fmr4973845wmd.2.1696020778205; Fri, 29 Sep 2023 13:52:58 -0700 (PDT) Received: from [192.168.0.59] (178-117-137-225.access.telenet.be. [178.117.137.225]) by smtp.gmail.com with ESMTPSA id 8-20020a05600c230800b004042dbb8925sm2120225wmo.38.2023.09.29.13.52.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Sep 2023 13:52:57 -0700 (PDT) Message-ID: Date: Fri, 29 Sep 2023 22:52:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: internals@lists.php.net References: <48c7bb29-a52c-416e-b855-be2746dc7a84@gmail.com> <5ace1060-dd75-4cdc-b5e2-a2ea617df586@app.fastmail.com> <59bd7af5-937a-4240-9768-c620e387e8d8@gmail.com> <0fe18a09-14a7-41d2-982f-bca60c662249@app.fastmail.com> Content-Language: en-US In-Reply-To: <0fe18a09-14a7-41d2-982f-bca60c662249@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support From: dossche.niels@gmail.com (Niels Dossche) On 9/29/23 20:22, Larry Garfield wrote: > On Fri, Sep 29, 2023, at 6:12 PM, Niels Dossche wrote: > >>> Unclear to me: Would the XML constants also be aliased into the namespace verbatim, or left globally? >>> >> >> I'll clarify this. >> The intention is to alias them verbatim. > > :thumbs up emoji: > >>> Did you consider making the new classes throw exceptions rather than forcing people to remember to call another "was there an error" global function like it's still 1996? :-) >> >> I did think about it. >> Using exceptions for the parser is not viable. This is because parse >> errors in HTML aren't actually hard errors. >> The errors are recoverable, i.e. the parser spec tells us how to >> proceed when an error occurred. So in a sense, they're closer to >> warnings. Using an exception would abort parsing. >> As a side note, a good amount of the web pages out there violates at >> least one parsing rule, but browsers know by-spec how to proceed in >> that case (which is probably also why they're often not fixed). >> >> I thought about other options as well. E.g. providing a >> getParseErrors() method or letting the factory methods return parse >> errors optionally as well. >> However, I think they're not significantly better than what we have >> now. Furthermore, I think overhauling how the parse errors are handled >> in ext/dom (and maybe by extension ext/simplexml to keep consistency) >> is a bit of a feature creep. See also the motivation in the RFC text. >> Therefore, I would keep the error handling as it is described now in >> the RFC. >> >> If accepted, this RFC would land early in the 8.4 development cycle. >> Therefore, we can gather feedback very early on. If we do notice a >> major problem in how these things are handled, they can be changed by a >> hypothetical future RFC in the same development cycle. That would also >> require thinking about the other XML extensions though. > > All valid, thanks. It would be helpful to include some mention of that in the Errors section to make it clear why exceptions right now are not an option, given the push elsewhere to get rid of the old error handling approaches in favor of exceptions. Ack, will do! :) > > --Larry Garfield > Cheers Niels