Project

Profile

Help

Support #3446 ยป Support #10103 - 2017-09-15T15_54_04Z.eml

Gerben Abbink, 2017-09-15 17:54

 
Return-Path: <gerben.abbink@gmail.com>
Received: from mi006.mc1.hosteurope.de ([80.237.138.249]) by wp245.webpack.hosteurope.de running ExIM with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1dsssQ-0001Fj-83; Fri, 15 Sep 2017 17:49:58 +0200
Received: from mail-lf0-f42.google.com ([209.85.215.42]) by mx0.webpack.hosteurope.de (mi006.mc1.hosteurope.de) with esmtps (TLSv1.2:AES128-GCM-SHA256:128) id 1dsssN-0005xb-Rm for inbox+saxonica+f38e+saxon@plan.io; Fri, 15 Sep 2017 17:49:58 +0200
Received: by mail-lf0-f42.google.com with SMTP id d4so2856664lfj.7 for <inbox+saxonica+f38e+saxon@plan.io>; Fri, 15 Sep 2017 08:49:55 -0700
Received: by 10.25.21.92 with HTTP; Fri, 15 Sep 2017 08:49:54 -0700
Date: Fri, 15 Sep 2017 17:49:54 +0200
From: Gerben Abbink <gerben.abbink@gmail.com>
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon@plan.io>
Message-ID: <CALOFD2XMT65SwJ1pjhtq_S62f8LoZ=PZ1HpYSQpNOOKp5t03oA@mail.gmail.com>
In-Reply-To: <redmine.journal-10099.20170915113141.f941b4b7dfeb841f@plan.io>
References: <redmine.issue-3446.20170915112002@plan.io>
<redmine.journal-10099.20170915113141.f941b4b7dfeb841f@plan.io>
Subject: Re: [Saxon - Support #3446] How can i see which attribute has an
invalid value?
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary=001a11401a161fea2405593c582c
Content-Transfer-Encoding: 7bit
Delivery-date: Fri, 15 Sep 2017 17:49:58 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
bh=IvuHGu3PC8Ppbyy561vtuZU1mT75ZHjxJtxwpZKM7n4=;
b=bE2PKuIMYUF9xfk6dQBEsBUUvalofNw70gnQijxBDtMky1AxEJEuKa/862JDp3xYaV
6IyNfwxPdklpDlx0GDwfzbSiDWqESSJ2/UWpwrOcTaOZchZgGXvysIWUZYN2RFw+V9GN
ZypGE8yDV34x4EvIrZ5dX68JBxeEHGaf3C8hNBHHaCWOVYmUiiQLuy5UTQM8CgjC4yBP
oY3EeYG2wjivF64b+lI3TSri0Bfeh1MENRA2YOeLS2YyUL1NlROmwuq89VgHKtzZZq9J
OoEAzxgXHJb6yV7htL9HMTE+fIN/RX8+7ZKXdUay+0/aQ9gt0SBDIM3iWf8tA26jUt5l wKxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;
s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date
:message-id:subject:to; bh=IvuHGu3PC8Ppbyy561vtuZU1mT75ZHjxJtxwpZKM7n4=;
b=iUk5sBT6ISco4dGLS15K1RtzlrrdKQFLKP16WImp2/q4hEcftQRRFWXUO5Sjhl4iyq
xK5GX7X9ux688Zun1hwbRZM0p5CLPeSUYvB9vW1fcU+6Rfah8bbVcM9axomQZbyMNioS
j3HRBpdcMJulEJ5+PihafHGfAZ7Tf36i1rSJ9q81dB/DVFRj7f/lORiNQQUHMke42rhC
avCGLIoiR3LxITOCC+QFz6tc0HG9UXPAa8u6V2yhxpA9WTmGrpAX3I/YUMEG9w1Mdlk/
WF+3ZEqMh9CESV4pWjiYC0OOi5cOMl1akBjOEuVdMBA0Ar1nQx+Wh58+IMUvlWixQCi9 MwVg==
X-Gm-Message-State: AHPjjUgBcJ6cdbFHwqwvrHeHMjpmxk6zUnYVXml6jhBIZmhXXqg4ZYr8
FAxBh5jzqBpmV2xijHWVPbDKp63pb8t8p4xA7PI=
X-Google-Smtp-Source: AOwi7QCdOVBGRrK+TS06dOcjtDbNSkh8kyPpxg0IZYCx9ZN8H3EWJoUWHepsWi7+qM5FeeKn8OBpOmlaadQRxLgqH60=
X-Received: by 10.25.168.133 with SMTP id r127mr837980lfe.103.1505490594947;
Fri, 15 Sep 2017 08:49:54 -0700 (PDT)
X-HE-Virus-Scanned: Yes
X-HE-Spam-Level: +++
X-HE-Spam-Score: 3.0
X-HE-Spam-Report: Content analysis details: (3.0 points) pts rule name
description ---- ----------------------
-------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE
RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.42 listed in
list.dnswl.org] 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source
[209.85.215.42 listed in dnsbl.sorbs.net] 2.5 RCVD_IN_SORBS_HTTP RBL: SORBS:
sender is open HTTP proxy server 0.0 FREEMAIL_FROM Sender email is commonly
abused enduser mail provider (gerben.abbink[at]gmail.com) 0.1 HTML_MESSAGE
BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or
DK signature from author's domain -0.1 DKIM_VALID Message has at least one
valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature,
not necessarily valid
X-HE-SPF: PASSED
Envelope-to: inbox+saxonica+f38e+saxon@plan.io


--001a11401a161fea2405593c582c
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Thank you very very much for your quick response, I could not find it
myself. It works perfectly: Attribute name and error offset in the XPath
expression are both available.

On Fri, Sep 15, 2017 at 1:31 PM, Saxonica Developer Community <
notifications@plan.io> wrote:

> --- In your reply, please do not write below this line ---
> Issue #3446 <https://saxonica.plan.io/issues/3446?pn=1#change-10099> has
> been updated by Michael Kay.
>
> - *File* exception.tiff
> <https://saxonica.plan.io/attachments/723/exception.tiff> added
>
> In the attached debugger screenshot !!
>
> you can see that XPathException.locator.containingLocation.attributeName
> contains the name of the attribute in error.
>
> Of course this won't always be available and you must write your
> ErrorListener carefully to check that what you are looking for is actually
> there.
> ------------------------------
> Support #3446: How can i see which attribute has an invalid value?
> <https://saxonica.plan.io/issues/3446?pn=1#change-10099>
>
> - Author: Gerben Abbink
> - Status: New
> - Priority: Low
> - Assignee:
> - Category:
> - Sprint/Milestone:
> - Legacy ID:
> - Applies to branch:
> - Fix Committed on Branch:
> - Fixed in Maintenance Release:
>
> This stylesheet (the stylesheet is just an example) produces an error in
> line 4:
>
>
> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/
> 1999/XSL/Transform">
> <xsl:template match="/">
> <xsl:number count="aaa///bbb" from="aaa///bbb"></xsl:number>
> </xsl:template>
> </xsl:stylesheet>
>
> My installed error listener is called with parameter e, an XPathException.
> The only information i can retreive is this:
>
> e.getLocator().getLineNumber() = 4
> e.getMessage() = Unexpected token "/" at start of expression.
>
> There is no indication which one of the two attributes is wrong. I tried
>
> e.getCause() = null
> e.getException() = null
> e.getErrorObject() = null
>
> There is also no information about the location of the error in the XPath
> expression. However, if i evaluate "aaa///bbb" using XPathCompiler, an
> exception SaxonApiException is thrown and getCause() (also an
> XPathException) gives me the actual location, via
> getLocator().getColumnNumber(), so that information seems to be available.
>
> How can i tell which one of the attribute values is wrong (in Java code)
> and what the position of the error in the XPath expression is?
>
> Thank you.
> Files exception.tiff
> <https://saxonica.plan.io/attachments/download/723/exception.tiff> (287
> KB)
> ------------------------------
>
> 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/>
>

--001a11401a161fea2405593c582c
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thank you very very much for your quick response, I coul=
d not find it myself. It works perfectly: Attribute name and error offset=
in the XPath expression are both available.</div><div class=3D"gmail_ext=
ra"><br><div class=3D"gmail_quote">On Fri, Sep 15, 2017 at 1:31 PM, Saxon=
ica Developer Community <span dir=3D"ltr">&lt;<a href=3D"mailto:notificat=
ions@plan.io" target=3D"_blank">notifications@plan.io</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><u></u>







<div style=3D"font-family:&quot;ProximaNova-Regular&quot;,Helvetica,Arial=
,sans-serif;font-size:14px;line-height:1.4em;color:#333434">
<table width=3D"100%" cellspacing=3D"0" cellpadding=3D"0" style=3D"border=
-spacing:0;border-collapse:collapse;width:100%">
<tbody><tr><td class=3D"m_-5472043657835354187header" style=3D"text-align=
:center;width:100%;font-family:MarketWeb,Helvetica,Arial,sans-serif;font-=
size:0.8em;color:#d7d7d7"><p>--- In your reply, please do not write below=
this line ---</p></td></tr>
<tr><td>Issue <a href=3D"https://saxonica.plan.io/issues/3446?pn=3D1#chan=
ge-10099" style=3D"color:#0088b7" target=3D"_blank">#3446</a> has been up=
dated by Michael Kay.

<ul>
<li><strong>File</strong> <a href=3D"https://saxonica.plan.io/attachmen=
ts/723/exception.tiff" style=3D"color:#0088b7" target=3D"_blank">exceptio=
n.tiff</a> added</li>
</ul>

<p>In the attached debugger screenshot !!</p>


<p>you can see that XPathException.locator.<wbr>containingLocation.<wbr>=
attributeName contains the name of the attribute in error.</p>


<p>Of course this won&#39;t always be available and you must write your =
ErrorListener carefully to check that what you are looking for is actuall=
y there.</p>
<hr style=3D"width:100%;height:1px;background:#ccc;border:0;margin:1.2em =
0">
<h1 style=3D"font-family:&quot;ProximaNova-Bold&quot;,Helvetica,Arial,san=
s-serif;font-weight:normal;margin:0px;font-size:1.3em;line-height:1.4em">=
<a href=3D"https://saxonica.plan.io/issues/3446?pn=3D1#change-10099" styl=
e=3D"color:#0088b7;text-decoration:none" target=3D"_blank">Support #3446:=
How can i see which attribute has an invalid value?</a></h1>

<ul><li>Author: Gerben Abbink</li>
<li>Status: New</li>
<li>Priority: Low</li>
<li>Assignee: </li>
<li>Category: </li>
<li>Sprint/Milestone: </li>
<li>Legacy ID: </li>
<li>Applies to branch: </li>
<li>Fix Committed on Branch: </li>
<li>Fixed in Maintenance Release: </li></ul>

<p>This stylesheet (the stylesheet is just an example) produces an error =
in line 4:</p>


<p><u></u><br>&lt;xsl:stylesheet version=3D&quot;3.0&quot; xmlns:xsl=3D&=
quot;<a href=3D"http://www.w3.org/1999/XSL/Transform" target=3D"_blank">h=
ttp://www.w3.org/<wbr>1999/XSL/Transform</a>&quot;&gt;<br> &lt;xsl:tem=
plate match=3D&quot;/&quot;&gt;<br> &lt;xsl:number count=3D&quot;a=
aa///bbb&quot; from=3D&quot;aaa///bbb&quot;&gt;&lt;/xsl:number&gt;<br> =
&lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;</p>


<p>My installed error listener is called with parameter e, an XPathExcep=
tion.<br>The only information i can retreive is this:</p>


<pre style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot=
;,Courier,monospace;font-size:85%;background-color:#ececec;word-wrap:brea=
k-word;margin:1em 0;padding:8px;border:none;border-radius:3px;width:auto;=
overflow-x:auto;overflow-y:hidden"><code style=3D"font-family:Hack,Consol=
as,Menlo,&quot;Liberation Mono&quot;,Courier,monospace;font-size:85%;back=
ground-color:#ececec;word-wrap:break-word;border-radius:3px;padding:0.2em=
;margin:0;padding:0">e.getLocator().getLineNumber() =3D 4<br> e.getMes=
sage() =3D Unexpected token &quot;/&quot; at start of expression.</code><=
/pre>


<p>There is no indication which one of the two attributes is wrong. I tr=
ied</p>


<pre style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot=
;,Courier,monospace;font-size:85%;background-color:#ececec;word-wrap:brea=
k-word;margin:1em 0;padding:8px;border:none;border-radius:3px;width:auto;=
overflow-x:auto;overflow-y:hidden"><code style=3D"font-family:Hack,Consol=
as,Menlo,&quot;Liberation Mono&quot;,Courier,monospace;font-size:85%;back=
ground-color:#ececec;word-wrap:break-word;border-radius:3px;padding:0.2em=
;margin:0;padding:0">e.getCause() =3D null<br> e.getException() =3D nu=
ll<br> e.getErrorObject() =3D null</code></pre>


<p>There is also no information about the location of the error in the X=
Path expression. However, if i evaluate &quot;aaa///bbb&quot; using XPath=
Compiler, an exception SaxonApiException is thrown and getCause() (also a=
n XPathException) gives me the actual location, via getLocator().getColum=
nNumber()<wbr>, so that information seems to be available.</p>


<p>How can i tell which one of the attribute values is wrong (in Java co=
de) and what the position of the error in the XPath expression is?</p>


<p>Thank you.</p>

<fieldset class=3D"m_-5472043657835354187attachments" style=3D"border:s=
olid #ccc;border-width:1px 0 0 0"><legend>Files</legend>
<a href=3D"https://saxonica.plan.io/attachments/download/723/exceptio=
n.tiff" style=3D"color:#0088b7" target=3D"_blank">exception.tiff</a>
(287 KB)<br>
</fieldset>

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

</td></tr>
<tr><td class=3D"m_-5472043657835354187footer" style=3D"font-size:0.8em;w=
idth:100%"><hr style=3D"width:100%;height:1px;background:#ccc;border:0;ma=
rgin:1.2em 0"><p>You have received this notification because you have eit=
her subscribed to or are involved in a project on Saxonica Developer Comm=
unity site.<br>To change your notification preferences, please click here=
: <a class=3D"m_-5472043657835354187external" href=3D"https://saxonica.pl=
an.io/my/account?tour=3Dmail_preferences" style=3D"color:#0088b7" target=3D=
"_blank">https://saxonica.plan.io/my/<wbr>account?tour=3Dmail_preferences=
</a></p></td><td></td></tr>
<tr><td class=3D"m_-5472043657835354187planio_footer" style=3D"text-align=
:center;width:100%;font-family:MarketWeb,Helvetica,Arial,sans-serif;font-=
size:1.2em;color:#d7d7d7"><br><div><a href=3D"https://plan.io/" style=3D"=
color:#0088b7;color:#d7d7d7;text-decoration:none" target=3D"_blank">This =
notification was cheerfully delivered by</a></div></td><td></td></tr>
<tr><td class=3D"m_-5472043657835354187planio_footer_logo" style=3D"text-=
align:center;width:100%"><a href=3D"https://plan.io/" title=3D"Planio" st=
yle=3D"color:#0088b7" target=3D"_blank"><img 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><br></div>

--001a11401a161fea2405593c582c--
    (1-1/1)