Re: [xsl] Suggestion for handling an endless loop

Subject: Re: [xsl] Suggestion for handling an endless loop
From: "Mark Giffin m1879@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Dec 2019 00:06:23 -0000
Sorry to be so late in responding to this. No, I was not using Oxygen, I 
was running the DITA OT from the command line only. So the XSLT 
processor used would be the one that comes with DITA OT version 3.3.2 
(Saxon-HE-9.8.0-14.jar). But the DITA OT is basically an Ant 
application, and it calls the XSLT processor. The loop that happened was 
an Ant loop calling out to XSLT. When I tried running the XML file by 
itself using the Saxon command line, it ran fine, it did not go into an 
endless loop.

So it appears to be an Ant problem at this point. I have not had time to 
run it through the DITA OT with Saxon using the -T option, but thanks 
for that suggestion.

Mark

On 10/18/2019 4:09 PM, Michael Kay mike@xxxxxxxxxxxx wrote:
> You're in oXygen though, aren't you? I think oXygen chooses a 
> different XSLT processor based on the version attribute you specify.
>
> With this kind of thing the devil is always in the detail. I've seen 
> similar problems, for example, because a stylesheet did
>
> <xsl:if test="contains(//title, 'xxx')">....
>
> In 1.0 that ignores any title after the first; in 2.0 it has to search 
> the whole document so it can report an error if there is more than one 
> title. If that's done within a loop and it's a large document then the 
> effect can be dramatic. But that's just an anecdote about the sort of 
> thing that can happen; there are 100 other possible explanations and 
> you can't diagnose this kind of thing without detailed probing.
>
> Comparing the -T output of the two runs might yield interesting insights.
>
> Michael Kay
> Saxonica
>
>> On 18 Oct 2019, at 23:35, Mark Giffin m1879@xxxxxxxxxxxxx 
>> <mailto:m1879@xxxxxxxxxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx 
>> <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
>>
>> Text change in stylesheet only, so I changed this:
>>
>> <xsl:stylesheet version="2.0">
>>
>> to this:
>>
>> <xsl:stylesheet version="1.0">
>>
>> That's the entire fix. I did not change XSLT processors or any other 
>> code.
>>
>>
>> On 10/18/2019 2:54 PM, Michael Kay mike@xxxxxxxxxxxx wrote:
>>> When you say you "change it to 1.0", do you mean that you change the 
>>> version number in the xsl:stylesheet element, or that you change the 
>>> XSLT processor you are using, or both?
>>>
>>> Michael Kay
>>> Saxonica
>>>
>>>> On 18 Oct 2019, at 22:06, Mark Giffin m1879@xxxxxxxxxxxxx 
>>>> <mailto:m1879@xxxxxxxxxxxxx> 
>>>> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx 
>>>> <mailto:xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>> wrote:
>>>>
>>>> I'm getting what appears to be an endless loop while running XSLT 
>>>> 2.0. It hangs when transforming a certain XML file, and I can watch 
>>>> the memory consumption rise to as much as 9 GB, and it apparently 
>>>> will never end. I have to force it to stop. When I change it back 
>>>> to XSLT 1.0, it runs fine, and when it hits the same file it hung 
>>>> up on with 2.0, it transforms in a second or two with 1.0. The XSLT 
>>>> does not use any 2.0 capabilities yet. The only change is changing 
>>>> 2.0 to 1.0 in <xsl:stylesheet version="2.0">.
>>>>
>>>> I'm interested in methods to debug something like this. Where to 
>>>> look? I notice Oxygen has an XSLT profiler.
>>>>
>>>> Details:
>>>> The XSLT is running under the DITA Open Toolkit version 3.3.2 (late 
>>>> model). I am converting an HTML-based publishing output from a much 
>>>> older version of the DITA OT, 1.8.5 (where the code worked). It 
>>>> looks like the 3.3.2 OT uses Saxon-HE-9.8.0-14.jar.
>>>>
>>>> Thanks,
>>>> Mark
>>>>
>>>
>>> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
>>> EasyUnsubscribe 
>>> <http://lists.mulberrytech.com/unsub/xsl-list/805141> (by email)
>>
>> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
>> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> 
>> (by email)
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/805141> 
> (by email <>)

Current Thread