Project

Profile

Help

Bug #4509 ยป Re_ [Saxon - Bug #4509] Saxon 10 DOM builder creates redundant namespace attributes - 2020-04-01T11_37_55Z.eml

Gerben Abbink, 2020-04-01 13:37

 
X-He-Spam-Score: -2.0
Return-Path: <gerben.abbink@gmail.com>
Delivered-To: dropbox@plan.io
Received: from m.launchco.com ([127.0.0.1])
by m.launchco.com with LMTP id gJHLCQt9hF63RwAAa1G0NA
for <dropbox@plan.io>; Wed, 01 Apr 2020 13:37:47 +0200
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on m.launchco.com
X-Spam-Level:
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham
autolearn_force=no version=3.4.2
X-Spam-Report:
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at
* https://www.dnswl.org/, no trust
* [209.85.210.51 listed in list.dnswl.org]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
* [209.85.210.51 listed in wl.mailspike.net]
* 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
* provider (romeo_82[at]ukr.net) (s.fischer[at]gmx.info)
* (gerben.abbink[at]gmail.com)
* 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
* 0.0 HTML_MESSAGE BODY: HTML included in message
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
* author's domain
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
X-Spam-Score: -2.0
Envelope-to: inbox+saxonica+f38e+saxon@plan.io
Authentication-Results: m.launchco.com; dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: m.launchco.com;
dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XWLTp3nU";
dkim-atps=neutral
Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))
(No client certificate requested)
by m.launchco.com (Postfix) with ESMTPS id C0877868D3
for <inbox+saxonica+f38e+saxon@plan.io>; Wed, 1 Apr 2020 13:37:46 +0200 (CEST)
Received: by mail-ot1-f51.google.com with SMTP id 22so25554942otf.0
for <inbox+saxonica+f38e+saxon@plan.io>; Wed, 01 Apr 2020 04:37:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=M1nVtqlKWev9+4B2EuLDAhJYuB2YRIM1IKtLRFuVg+Y=;
b=XWLTp3nUvYIr1rPL/yAj9qKX2bTlyGj7Q+5Gj4BiwoLrv70SSkEhhmnmxPxwTySLnO
w4UIl4JKflabqViWmmbSolLFjuYHUQqluW8vXB5rqrPHP6R0rZayLDJ2GsE2NjSaHyMZ
LBl3M10pyJbQcze04V3Okmum6vGuWjBQ8wwzLTB+BwUb9Rcg4Sg9UfwMKHMe1rUqh5WL
xCbfw7x/sr/lEfVnUYBOdJb5GyXm2mqkxSTM7F1yef2hslzRS+R4D3Sw3vNlXwt9VMLs
E0pzAxUGe/uQw8hkq/984XUJkfMFWEfBk070iwLIoWDlo1XiVJXuzeemTSIrsHMnXcCl
IyXQ==
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;
bh=M1nVtqlKWev9+4B2EuLDAhJYuB2YRIM1IKtLRFuVg+Y=;
b=bFWI10l69JzsPFFuoqFLLO4UJsn3IRgDZ+xLnZFlG1VfQolgR9Uo4LWhZf0YKVROTZ
RwcFtdLdUFdXJnLvYGCd2BPTClI68tmj2rFLE7dlS26Yzt3ZecA42Fd3yiUC2vo+2Gj4
ZEq6M6IAcXky8g1k8R4C5rWo6osgaBzztH1USDqNBAqHy6DxJQ6hmCp3H8tmhq0N21ce
cXQcKocj0OMhq/f/IXeafgx7jkC4DgjR3K6LrgKU+C0n8irxjNg/+CaLhgbLOqaLWhsI
jGI9jG2RrwmZmBxXqjXRL7W/w+2u2skoixCWIguA/bv8NvjK2rlvyanX4sgakpBArIsu
T/PA==
X-Gm-Message-State: ANhLgQ3vXoPSHRCySed2hTvqHBQM/Wjz9PALfwUomH6fIkEqOnORbfW7
+YWHx5jKoGi4VqKmB76PCtwyHqleYpr4FiinC2jeFwxfy4Y=
X-Google-Smtp-Source: ADFU+vuvKZNy64IMvr1TEiUwpF/YxUUoHYra6p7WX3geWuJGxNpRL+aDHSXis3oGo8S49HbocAQZh5sghbmaQqXzJJY=
X-Received: by 2002:a9d:364b:: with SMTP id w69mr16296460otb.332.1585741065282;
Wed, 01 Apr 2020 04:37:45 -0700 (PDT)
MIME-Version: 1.0
References: <redmine.issue-4509.20200331070026@plan.io> <redmine.journal-15196.20200331162256.d1a9948205fce830@plan.io>
In-Reply-To: <redmine.journal-15196.20200331162256.d1a9948205fce830@plan.io>
From: Gerben Abbink <gerben.abbink@gmail.com>
Date: Wed, 1 Apr 2020 13:37:34 +0200
Message-ID: <CALOFD2X5eEJckNLFcx=K_ziJTaCp7WxaMa5qORidG9Xp5CTWZw@mail.gmail.com>
Subject: Re: [Saxon - Bug #4509] Saxon 10 DOM builder creates redundant
namespace attributes
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon@plan.io>
Content-Type: multipart/alternative; boundary="000000000000e6eaf905a2391cb2"

--000000000000e6eaf905a2391cb2
Content-Type: text/plain; charset="UTF-8"

I do not call builder.setTreeModel(DOMObjectModel.getInstance()). The tree
model i use is net.sf.saxon.om.TreeModel$TinyTree.

On Tue, Mar 31, 2020 at 6:22 PM Saxonica Developer Community <
notifications@plan.io> wrote:

> --- In your reply, please do not write below this line ---
> Issue #4509 <https://saxonica.plan.io/issues/4509?pn=1#change-15196> has
> been updated by Michael Kay.
>
>
> The wonders of DOM.
>
> I'm seeing a.getAttributes().getLength() == 0, so
> a.getAttributes().itemAt(0).getNodeName() throws an NPE.
>
> I've also checked in the debugger and on this path we're not adding any
> attributes to the DOM element.
>
> I'm afraid I'm not going to be able to make any progress on this unless
> you can provide precise code that reproduces the problem.
> ------------------------------
> Bug #4509: Saxon 10 DOM builder creates redundant namespace attributes
> <https://saxonica.plan.io/issues/4509?pn=1#change-15196>
>
> - Author: Gerben Abbink
> - Status: In Progress
> - Priority: Normal
> - Assignee: Michael Kay
> - Category: DOM Interface
> - Sprint/Milestone:
> - Legacy ID:
> - Applies to branch: 10
> - Fix Committed on Branch:
> - Fixed in Maintenance Release:
>
> I have this XML:
>
> <root xmlns="namespace">
> <element/>
> <element/>
> </root>
>
> I build a DOM using net.sf.saxon.s9api.DocumentBuilder.
>
> In the resulting DOM each "element" node has a "namespace" attribute.
>
> In version 9 this was not the case, only the root had a "namespace" atribute.
>
> Is this change by design or is it a bug?
>
> ------------------------------
>
> You have received this notification because you have either subscribed to
> or are involved in a project on Saxonica Developer Community site. To
> change your notification preferences, please click here:
> https://saxonica.plan.io/my/account?tour=mail_preferences
>
> This notification was cheerfully delivered by <https://plan.io/>
> [image: Planio] <https://plan.io/>
>

--000000000000e6eaf905a2391cb2
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I do not call=C2=A0builder.setTreeModel(DOMObjectModel.get=
Instance()). The tree model i use is=C2=A0net.sf.saxon.om.TreeModel$TinyTre=
e.</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr=
">On Tue, Mar 31, 2020 at 6:22 PM Saxonica Developer Community &lt;<a href=
=3D"mailto:notifications@plan.io">notifications@plan.io</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>







<div style=3D"font-family:ProximaNova-Regular,Helvetica,Arial,sans-serif;fo=
nt-size:14px;line-height:1.4em;color:rgb(51,52,52)">
<table width=3D"100%" cellspacing=3D"0" cellpadding=3D"0" style=3D"border-s=
pacing:0px;border-collapse:collapse;width:100%">
<tbody><tr><td style=3D"text-align:center;width:100%;font-family:MarketWeb,=
Helvetica,Arial,sans-serif;font-size:0.8em;color:rgb(215,215,215)"><p>--- I=
n your reply, please do not write below this line ---</p></td></tr>
<tr><td>Issue <a href=3D"https://saxonica.plan.io/issues/4509?pn=3D1#change=
-15196" style=3D"color:rgb(0,136,183)" target=3D"_blank">#4509</a> has been=
updated by Michael Kay.

<ul>
</ul>

<p>The wonders of DOM.</p>
<p>I&#39;m seeing <code style=3D"font-family:Hack,Consolas,Menlo,&quot;Libe=
ration Mono&quot;,Courier,monospace;font-size:85%;background-color:rgb(236,=
236,236);border-radius:3px;padding:0.2em;margin:0px">a.getAttributes().getL=
ength() =3D=3D 0</code>, so <code style=3D"font-family:Hack,Consolas,Menlo,=
&quot;Liberation Mono&quot;,Courier,monospace;font-size:85%;background-colo=
r:rgb(236,236,236);border-radius:3px;padding:0.2em;margin:0px">a.getAttribu=
tes().itemAt(0).getNodeName()</code> throws an NPE.</p>
<p>I&#39;ve also checked in the debugger and on this path we&#39;re not add=
ing any attributes to the DOM element.</p>
<p>I&#39;m afraid I&#39;m not going to be able to make any progress on this=
unless you can provide precise code that reproduces the problem.</p>
<hr style=3D"width:100%;height:1px;background:rgb(204,204,204);border:0px;m=
argin:1.2em 0px">
<h1 style=3D"font-family:ProximaNova-Bold,Helvetica,Arial,sans-serif;font-w=
eight:normal;margin:0px;font-size:1.3em;line-height:1.4em"><a href=3D"https=
://saxonica.plan.io/issues/4509?pn=3D1#change-15196" style=3D"color:rgb(0,1=
36,183);text-decoration:none" target=3D"_blank">Bug #4509: Saxon 10 DOM bui=
lder creates redundant namespace attributes</a></h1>

<ul><li>Author: Gerben Abbink</li>
<li>Status: In Progress</li>
<li>Priority: Normal</li>
<li>Assignee: Michael Kay</li>
<li>Category: DOM Interface</li>
<li>Sprint/Milestone: </li>
<li>Legacy ID: </li>
<li>Applies to branch: 10</li>
<li>Fix Committed on Branch: </li>
<li>Fixed in Maintenance Release: </li></ul>

<pre style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot;,C=
ourier,monospace;font-size:85%;background-color:rgb(236,236,236);margin:1em=
0px;padding:8px;border:none;border-radius:3px;width:auto;overflow:auto hid=
den"><code style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&q=
uot;,Courier,monospace;font-size:85%;background-color:rgb(236,236,236);bord=
er-radius:3px;margin:0px;padding:0px">I have this XML:

&lt;root xmlns=3D&quot;namespace&quot;&gt;
&lt;element/&gt;
&lt;element/&gt;
&lt;/root&gt;

I build a DOM using net.sf.saxon.s9api.DocumentBuilder.

In the resulting DOM each &quot;element&quot; node has a &quot;namespace&qu=
ot; attribute.

In version 9 this was not the case, only the root had a &quot;namespace&quo=
t; atribute.

Is this change by design or is it a bug?
</code></pre>


<div><div></div></div>

</td></tr>
<tr><td style=3D"font-size:0.8em;width:100%"><hr style=3D"width:100%;height=
:1px;background:rgb(204,204,204);border:0px;margin:1.2em 0px"><p>You have r=
eceived this notification because you have either subscribed to or are invo=
lved in a project on Saxonica Developer Community site.
To change your notification preferences, please click here: <a href=3D"http=
s://saxonica.plan.io/my/account?tour=3Dmail_preferences" style=3D"color:rgb=
(0,136,183)" target=3D"_blank">https://saxonica.plan.io/my/account?tour=3Dm=
ail_preferences</a></p></td><td></td></tr>
<tr><td style=3D"text-align:center;width:100%;font-family:MarketWeb,Helveti=
ca,Arial,sans-serif;font-size:1.2em;color:rgb(215,215,215)"><br><div><a hre=
f=3D"https://plan.io/" style=3D"color:rgb(215,215,215);text-decoration:none=
" target=3D"_blank">This notification was cheerfully delivered by</a></div>=
</td><td></td></tr>
<tr><td style=3D"text-align:center;width:100%"><a href=3D"https://plan.io/"=
title=3D"Planio" style=3D"color:rgb(0,136,183)" target=3D"_blank"><img src=
=3D"https://assets.plan.io/images/planio_logo_gray_204x50.png" height=3D"25=
" width=3D"102" border=3D"0" alt=3D"Planio" style=3D"vertical-align: middle=
; border: none;"></a></td></tr>
</tbody></table>
</div>

</blockquote></div>

--000000000000e6eaf905a2391cb2--
    (1-1/1)