Re: [Gestalt-users] Gexslt crash with xsl:import: URI format?
Status: Alpha
Brought to you by:
colin-adams
From: Colin P. A. <co...@co...> - 2006-09-01 15:53:59
|
>>>>> "Florent" == Florent Georges <dar...@ya...> writes: >> so that it looks like: >> -- attributes_prepared: attributes_prepared Florent> Done. >> Then compile afresh (geant compile_ise_debug - that should take >> only a few seconds, as it will be an incremental compile), and >> run the test again, posting the new stack trace here. Florent> Running the new build on the reduced sample I sent Florent> today (with the three little files), I get the following Florent> error: Florent> gexslt: system execution failed. Following is the set of Florent> recorded exceptions: Florent> ------------------------------------------------------------------------------- Florent> Class / Object Routine Nature of exception Effect Florent> ------------------------------------------------------------------------------- Florent> XM_XSLT_FUNCTION prepare_attributes @6 not_excluded: Florent> <000000000349B80C> Precondition violated. Fail Florent> So in the same file I commented out the following line Florent> in function_fingerprint: Florent> if not attributes_prepared then prepare_attributes Florent> end Which is the wrong try. In general in Eiffel, if a routine has a precondition, you must first check that you can meet the pre-condition before you may call the routine. So the obvious try would be: if not attributes_prepared and not is_excluded then prepare_attributes end It looks like that would have been sufficient to fix your problem. But I didn't do this. The is_excluded was my way of implementing [xsl:]use-when conditional compilation - if the use-when clause returns false, then I marked the element and is_excluded. So whole parts of the tree are logically excluded. Hence the pre-conditions. But it's slightly error prone. Rather than wait for another such error to be uncovered, or to write a proof checker, I now (as of today) physically remove the excluded elements prior to begining the compile process. (MHK does it with a filter, but that is conceptually harder - I prefer the straight-forward approach) This seems to fix your problem. Florent> Then the transformation (on the simplified sample) run Florent> at the end, and produced no output I get that too. Florent> nodes, that is correct). Then I came back to the Florent> original files, and there I got the following stacktrace Florent> (and biginning of output): Florent> I let you deduce the conclusion ;-). I put the two Florent> files (input + stylesheet) there: Florent> http://www.fgeorges.org/tmp/hello-world.xsl Florent> http://www.fgeorges.org/tmp/test-hello-world.xts.xsl I trust you meant stylesheet + input? If not, then I gets dozens of compile errors. If you did, then I get no errors, and a load of output looking like this: <?xml version="1.0" encoding="UTF-8"?> <elem1 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:hw="http://www.fgeorges.org/hello-world"/><elem2 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:hw="http://www.fgeorges.org/hello-world" id="id"/> type="text/xsl" href="http://www.fgeorges.org/xslt-unit/report-to-html.xsl" <elem1 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:hw="http://www.fgeorges.org/hello-world"/><elem2 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:hw="http://www.fgeorges.org/hello-world" id="id"/> Tests: hello-world(), arity 0 hello-world(), arity 0 Tests: hello-world(), arity 1 hello-world(), arity 1 Tests: hello-world() hello-world() Tests: 'elem' template rule 'elem' template rule Tests: False negative False negative test: [success] [FAILED !] test: [success] [FAILED !] test: hello-world(), arity 0 [success] [FAILED !] hello-world(), arity 0 test: hello-world(), arity 1 [success] [FAILED !] hello-world(), arity 1 test: 'elem' #1 [success] [FAILED !] 'elem' #1 test: 'elem' #2 [success] [FAILED !] 'elem' #2 test: [success] [FAILED !] Since this is not well-formd XML, I was dubious, but as Saxon 8.7.1 produces identical output, I assume the problem is fixed. I should have this checked in to CVS before Tuesday. remember, the procedure to update is: cd %GOBO% cvs update (however you do this in windows) geant install Then re-compile gexslt with: cd %GOBO\src\gexslt geant compile then copy gexslt.exe to %GOBO\bin If by any chance I haven't checked in by then, you can try the fix I showed you above (and repeat if any further instances arise). -- Colin Adams Preston Lancashire |