Complete freeze editing XSLT

Having trouble installing Oxygen? Got a bug to report? Post it all here.
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Complete freeze editing XSLT

Post by martindholmes »

Hi there,

I've had repeated instances of oXygen freezing when I'm editing an XSLT file; I have to kill the app and restart it. The file is pretty small (only 282 lines), and the freeze always seems to happen when I'm typing a new tag, as I type the = sign after an attribute, or the following quote. The app stops responding, the window stops repainting itself (so any window opened over it leaves it just grey or white), and I'm doomed. I'm having to use XMLSpy just to edit XSLT files (I haven't seen the problem with XML files).

Has anyone seen this before? Any suggestions for fixes? I'm using oXygen 5.1 on Windows XP Pro, fully updated, and I have Tag Insight turned on (with the default settings).

All help appreciated,
Martin
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Post by martindholmes »

Some additional info:

-I'm running the latest update of Java 1.5: J2SE Version 1.5.0 (build 1.5.0_02-b09).

-I'm running on dual monitors. oXygen is on the left monitor; if I move it to the right (which I'd prefer to do), the popup menus etc. continue to appear on the left monitor, but I guess that's a Java issue.

Cheers,
Martin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Martin,

We will try to see if we can reproduce that and let you know our findings.

Best Regards,
George
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Martin,

We were able to reproduce the problem and it is our problem, thanks for reporting it. It will be corrected in the next release.

Best Regards,
George
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi again,

Can you provide more information about the first problem (freezing)? It will help to see the stylesheet and what you do to make it freeze. Also we made available a development snapshot with support for Saxon 8.4 a couple of weeks ago [1], can you try with that and see if you get the same problem?

[1] http://www.oxygenxml.com/update/saxon8.4/oxygen.tar.gz

Best Regards,
George
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Post by martindholmes »

Hi there,

This is the stylesheet (hope it comes through OK on the forum):

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">

<!-- Bibliography elements, going to MLA style. This is complicated! -->
<!-- First, make sure the items are processed in a list, sorted into the correct order. -->
<xsl:template match="listBibl">
<fo:list-block provisional-distance-between-starts="0" provisional-label-separation="0" space-before="0.25cm" space-after="0.25cm">
<xsl:for-each select="biblStruct">
<xsl:sort select="descendant::name[1]/@reg" data-type="text" order="ascending"></xsl:sort>
<xsl:sort select="descendant::name[2]/@reg" data-type="text" order="ascending"></xsl:sort>
<xsl:sort select="descendant::date" data-type="text" order="ascending"></xsl:sort>
<fo:list-item space-after="0.5em">
<fo:list-item-label end-indent="label-end()">
<fo:block></fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select=".">
<!--<xsl:sort select="descendant::name[1]/@reg" data-type="text" order="ascending"></xsl:sort>
<xsl:sort select="descendant::name[2]/@reg" data-type="text" order="ascending"></xsl:sort>
<xsl:sort select="descendant::date" data-type="text" order="ascending"></xsl:sort>-->
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:for-each>
</fo:list-block>
</xsl:template>

<!-- Suppress the head element: already handled. -->
<xsl:template match="div[@type='Bibliography']/head"></xsl:template>

<!-- We need a template to handle each of the title types appropriately. -->
<!-- Basic book title: -->
<xsl:template name="MonographTitle">
<xsl:param name="InTitle"/>
<xsl:if test="string-length($InTitle) > 0">
<fo:inline font-style="italic"><xsl:apply-templates select="$InTitle" /><xsl:if test="not(substring($InTitle/text(), string-length(InTitle/text()))='?')"><xsl:text>. </xsl:text></xsl:if></fo:inline>
</xsl:if>
</xsl:template>

<!-- Journal title (no final period, because volume info will follow. -->
<xsl:template name="JournalTitle">
<xsl:param name="InTitle"/>
<xsl:if test="string-length($InTitle) > 0">
<fo:inline font-style="italic"><xsl:apply-templates select="$InTitle" /></fo:inline><xsl:text> </xsl:text>
</xsl:if>
</xsl:template>

<!-- Analytic (article or chapter) title. -->
<xsl:template name="AnalyticTitle">
<xsl:param name="InTitle"/>
<xsl:if test="string-length($InTitle) > 0">
"<xsl:value-of select="$InTitle" /><xsl:if test="not(substring($InTitle/text(), string-length(InTitle/text()))='?')">.</xsl:if>"<xsl:text> </xsl:text>
</xsl:if>
</xsl:template>

<!-- Unpublished article, lecture or dissertation: the title would be analytic, normally, and the title level="u" element used to record the location.. -->
<xsl:template name="UnpublishedTitle">
<xsl:param name="InTitle"/>
<xsl:if test="string-length($InTitle) > 0">
<xsl:value-of select="$InTitle" /><xsl:if test="not(substring($InTitle/text(), string-length(InTitle/text()))='?')">.</xsl:if><xsl:text> </xsl:text>
</xsl:if>
</xsl:template>

<!-- Template to process a nodelist consisting of name elements -->
<xsl:template name="ProcessNameList">
<xsl:param name="Names" />
<xsl:param name="ReverseFirst" />
<xsl:param name="AddPeriod" />
<!--<xsl:if test="count($Names//name) > 0">-->
<xsl:for-each select="$Names/name">
<xsl:variable name="NameToUse">
<xsl:choose>
<xsl:when test="position()=1 and $ReverseFirst='true'"><xsl:value-of select="@reg" /></xsl:when>
<xsl:otherwise><xsl:value-of select="." /></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="position()=1"><xsl:value-of select="$NameToUse" /></xsl:if>
<xsl:if test="position()>1">,
<xsl:if test="position()=last()">and </xsl:if>
<xsl:value-of select="$NameToUse" />
</xsl:if>
<xsl:if test="position()=last()">
<xsl:if test="$AddPeriod='true'">
<xsl:if test="not(substring($NameToUse, string-length($NameToUse))='.')"><xsl:text>.</xsl:text></xsl:if><xsl:text> </xsl:text>
</xsl:if>
</xsl:if>
</xsl:for-each>
<!--</xsl:if>-->
</xsl:template>

<!-- This template processes authors and editors from a container passed to it. -->
<xsl:template name="ProcessAuthorsAndEditors">
<xsl:param name="TheParent" />
<xsl:param name="ReverseFirst" />
<xsl:choose>
<!-- If there are authors, process them first-->
<xsl:when test="$TheParent/author">
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="Names" select="$TheParent//author" />
<xsl:with-param name="ReverseFirst" select="$ReverseFirst" />
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
<!--Then process editors-->
<xsl:if test="$TheParent/editor">
<xsl:text>Ed. </xsl:text>
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="Names" select="$TheParent//editor" />
<xsl:with-param name="ReverseFirst">false</xsl:with-param>
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:when>

<!--Otherwise process the editors as the primary set-->
<xsl:otherwise>
<xsl:if test="$TheParent/editor">
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="Names" select="$TheParent//editor" />
<xsl:with-param name="ReverseFirst" select="$ReverseFirst" />
<xsl:with-param name="AddPeriod">false</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="count($TheParent//editor) > 1"><xsl:text>, eds. </xsl:text></xsl:when>
<xsl:otherwise><xsl:text>, ed. </xsl:text></xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<!-- This template handles processing of the monogr element for non-journal items. -->
<xsl:template name="ProcessMonogr">
<xsl:param name="TheParent" /><!-- the monogr element that's being processed. -->
<xsl:param name="IsContainer" /><!-- Is this a monogr containing another (analytic) document? -->
<xsl:choose>
<xsl:when test="$IsContainer='true'">
<!-- If it's a container, then it presumably doesn't have authors. -->
<!-- Title comes first, then editors. -->
<xsl:call-template name="MonographTitle">
<xsl:with-param name="InTitle" select="$TheParent/title[@level='m']" />
</xsl:call-template>

<!-- Handle any translators etc.. -->
<xsl:if test="monogr/respStmt">
<xsl:call-template name="ProcessResps">
<xsl:with-param name="TheParent" select="$TheParent/respStmt" />
</xsl:call-template>
</xsl:if>

<!-- Now handle editors. -->
<xsl:if test="$TheParent/editor">
<xsl:text>Ed. </xsl:text>
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="Names" select="$TheParent//editor" />
<xsl:with-param name="ReverseFirst">false</xsl:with-param>
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<!-- If it's a standalone, then process the authors/editors first. -->
<xsl:call-template name="ProcessAuthorsAndEditors">
<xsl:with-param name="TheParent" select="$TheParent" />
<xsl:with-param name="ReverseFirst">true</xsl:with-param>
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
<!-- Handle monograph and unpublished titles. -->
<xsl:call-template name="MonographTitle">
<xsl:with-param name="InTitle" select="$TheParent/title[@level='m']" />
</xsl:call-template>
<xsl:call-template name="UnpublishedTitle">
<xsl:with-param name="InTitle" select="$TheParent/title[@level='u']" />
</xsl:call-template>
<xsl:if test="monogr/respStmt">
<xsl:call-template name="ProcessResps">
<xsl:with-param name="TheParent" select="$TheParent/respStmt" />
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<!-- Now handle the edition, volumes, imprint and other info .-->
<xsl:if test="$TheParent/edition">
<xsl:value-of select="$TheParent/edition" /><xsl:text>. </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/title[@level='s']">
<xsl:value-of select="$TheParent/title[@level='s']" /><xsl:text>. </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/extent">
<xsl:value-of select="$TheParent/extent" /><xsl:text>. </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/imprint/pubPlace">
<xsl:value-of select="$TheParent/imprint/pubPlace" />
</xsl:if>
<xsl:if test="$TheParent/imprint/pubPlace and $TheParent/imprint/publisher">
<xsl:text>: </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/imprint/publisher">
<xsl:value-of select="$TheParent/imprint/publisher" />
</xsl:if>
<xsl:if test="($TheParent/imprint/pubPlace or $TheParent/imprint/publisher) and $TheParent/imprint/date">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/imprint/date">
<xsl:value-of select="$TheParent/imprint/date" />
</xsl:if>
<xsl:if test="$TheParent/imprint/biblScope[@type='pages']">
<xsl:text>, </xsl:text><xsl:value-of select="$TheParent/imprint/biblScope[@type='pages']" />
</xsl:if>
<xsl:if test="string-length($TheParent/imprint) > 0"><xsl:text>. </xsl:text></xsl:if>
</xsl:template>

<!-- This template handles processing of a journal which is a container for an article. -->
<xsl:template name="ProcessJournal">
<xsl:param name="TheParent" />
<xsl:call-template name="JournalTitle">
<xsl:with-param name="InTitle" select="$TheParent/title" />
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="$TheParent/imprint/biblScope[@type='vol']" />
<xsl:text> </xsl:text>
<xsl:text>(</xsl:text><xsl:value-of select="$TheParent/imprint/date" /><xsl:text>)</xsl:text>
<xsl:text>: </xsl:text>
<xsl:value-of select="$TheParent/imprint/biblScope[@type='pages']" />
<xsl:text>. </xsl:text>

</xsl:template>

<!-- This template handles the processing of resp elements for things like translators. -->
<xsl:template name="ProcessResps">
<xsl:param name="TheParent" />
<xsl:if test="$TheParent/resp">
<xsl:value-of select="$TheParent/resp" /><xsl:text> </xsl:text>
</xsl:if>
<xsl:if test="$TheParent/name">
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="ReverseFirst">false</xsl:with-param>
<xsl:with-param name="Names" select="$TheParent" />
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>

<!-- This is the bit that handles the actual entries. -->
<xsl:template match="biblStruct">
<xsl:if test="analytic">
<!-- Journal article or book chapter. These would not have editors, so let's assume all name elements are authors. -->
<xsl:call-template name="ProcessNameList">
<xsl:with-param name="Names" select="analytic//author" />
<xsl:with-param name="ReverseFirst">true</xsl:with-param>
<xsl:with-param name="AddPeriod">true</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="AnalyticTitle">
<xsl:with-param name="InTitle" select="analytic/title[@level='a']" />
</xsl:call-template>
</xsl:if>
<xsl:choose>
<xsl:when test="analytic">
<!-- there's an article or chapter already specified; what follows contains it. -->
<xsl:choose>
<xsl:when test="monogr/title[@level='j']">
<xsl:call-template name="ProcessJournal">
<xsl:with-param name="TheParent" select="monogr" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="ProcessMonogr">
<xsl:with-param name="IsContainer">true</xsl:with-param>
<xsl:with-param name="TheParent" select="monogr" />
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<!-- this is a monograph alone, and not a container. -->
<!-- is it a book or a journal? -->

<!-- it's a book or equivalent. -->
<xsl:call-template name="ProcessMonogr">
<xsl:with-param name="IsContainer">false</xsl:with-param>
<xsl:with-param name="TheParent" select="monogr" />
</xsl:call-template>


</xsl:otherwise>
</xsl:choose>

<xsl:apply-templates select="note" />
</xsl:template>

</xsl:stylesheet>


I'm on a deadline with a complicated project right now, so I'm not really in a position to test a beta release, but as soon as the dust clears next month I'll give it a go. If there's any other info I can provide, ask away.

Cheers,
Martin
Post Reply