Thanks for reporting this, but I suspect you aren't running the latest
release - it seems to have been fixed in Saxon 8.3.
=20
Michael Kay
http://www.saxonica.com/
_____ =20
From: saxon-help-admin@...
[mailto:saxon-help-admin@...] On Behalf Of
Marcus.Edwards@...
Sent: 20 March 2005 08:20
To: saxon-help@...
Subject: [saxon] Bug: NPE in GlobalVariableDefinition.explain()
All,
Passing the '-e' (explain) flag into net.sf.saxon.Query with the =
following
XQuery results in a NPE:
---8<---
declare variable $aVariable as xs:date external;
<result>
{$aVariable}
</result>
---8<---
Exception stacktrace is
---8<---
declare variable aVariable :=3D java.lang.NullPointerException
at
net.sf.saxon.query.GlobalVariableDefinition.explain(GlobalVariableDefinit=
ion
.java:188)
at
net.sf.saxon.query.StaticQueryContext.explainGlobalVariables(StaticQueryC=
ont
ext.java:602)
at net.sf.saxon.Query.doMain(Query.java:364)
at net.sf.saxon.Query.main(Query.java:76)
Fatal error during transformation: null
---8<---
I figure that this is because the explain is happening during static
compilation and the external variable values have not been bound yet.
Perhaps the following change to =
net.sf.saxon.query.GlobalVariableDefinition
would be better?
---8<---
/**
* Produce diagnostic output showing the compiled and optimized
expression tree for a function
* @param pool the namepool to be used
*/
public void explain(NamePool pool) {
System.err.print("declare variable " + =
pool.getDisplayName(nameCode)
+ " :=3D ");
if(isParameter) System.err.print("<external>");
else value.display(4, pool, System.err);
System.err.println(";");
}
---8<---
HTH,
Marcus Edwards
Digital Steps Limited=20
1 Bell Court, Leapale Lane, Guildford, Surrey GU1 4LY=20
Switchboard: +44 (0)14 8346 9480=20
Direct: +44 (0)14 8346 9483=20
Mobile: +44 (0)78 1587 4017
---------------------------------------------------------------------
Disclaimer
This e-mail and any attachments may be confidential and/or legally
privileged.=20
If you have received this email and you are not a named addressee, =
please=20
inform the sender at Digital Steps Ltd by phone on +44 (0)1483 469 480 =
or by
reply email and then delete the email from your system. If you are not a
named=20
addressee you must not use, disclose, distribute, copy, print or rely on
this=20
email. Although Digital Steps Ltd routinely screens for viruses, =
addressees=20
should check this email and any attachments for viruses. Digital Steps =
Ltd=20
makes no representation or warranty as to the absence of viruses in this
email=20
or any attachments.
------------------------------------------------------- SF email is
sponsored by - The IT Product Guide Read honest & candid reviews on =
hundreds
of IT Products from real users. Discover which products truly live up to =
the
hype. Start reading now. =
http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dick
_______________________________________________ saxon-help mailing list
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help=20
|