losing line breaks with xslt:transform(...)
Friday, 26 July 2013 · 11 messages · last reply 31 Jul 2013
SG
Simon Görke26 Jul 2013 14:46 #
Hi,
I have small issue regarding the
xslt:transform function (or what lies beneath). We are currently migrating a larger number of existing stylesheets into a basex-environment (before they were used with saxon on the filesystem).
The problem is, that all line breaks which are generated explicitly in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. Line feeds within a xsl:text element are correctly transformed. See below for the xslt and example output.
First we thought this might be linked to the whitespace chopping of the database where the transformation result is stored, however I get the same behavior when directly looking at the output of xslt:transform(...) in the basex-gui.
Is there any options to influence this behavior? We are using saxon9 within basex version 7.6.
Thanks for your help
Simon
-------------------------------
Excerpt from example stylesheet:
...
<Document>
<xsl:text>
block1 line1
block1 line2
</xsl:text><xsl:text>
</xsl:text>
<xsl:text>block2 line1</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>block2 line2</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>block3 line1</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>block3 line2</xsl:text></Document>
....
------------------------------------
Result when running the stylesheet with saxon on the filesystem; All line break variants actually result in new lines:
<Document>
block1 zeile1
block1 zeile2
block2 zeile1
block2 zeile1
block3 zeile1
block3 zeile1
</Document>
----------------------------------
Result from calling
xslt:transform in basex (saxon is used also within basex);
Only the line break within the xsl:text is visible in the output: <Document>
block1 line1
block1 line2block2 line1block2 line2block3 line1block3 line2 </Document>
----------------------------------CG
Christian Grün26 Jul 2013 14:56 #
Hi Simon,
not sure if that helps, but you can try to deactivate whitespace chopping in the prolog of your XQuery expression:
declare option db:chop "no";
...
Best,
Christian
___________________________
2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>:
Quoted text · Simon Görke · 78 lines
> Hi, > > I have small issue regarding the xslt:transform function (or what lies > beneath). We are currently migrating a larger number of existing stylesheets > into a basex-environment (before they were used with saxon on the > filesystem). > > The problem is, that all line breaks which are generated explicitly in the > stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. > Line feeds within a xsl:text element are correctly transformed. See below > for the xslt and example output. > > First we thought this might be linked to the whitespace chopping of the > database where the transformation result is stored, however I get the same > behavior when directly looking at the output of xslt:transform(...) in the > basex-gui. > Is there any options to influence this behavior? We are using saxon9 within > basex version 7.6. > > Thanks for your help > Simon > > > ------------------------------- > Excerpt from example stylesheet: > ... > <Document> > <xsl:text> > block1 line1 > block1 line2 > </xsl:text> > > <xsl:text>
</xsl:text> > <xsl:text>block2 line1</xsl:text> > <xsl:text>
</xsl:text> > <xsl:text>block2 line2</xsl:text> > > <xsl:text> > </xsl:text> > > <xsl:text>block3 line1</xsl:text> > > <xsl:text> > </xsl:text> > > <xsl:text>block3 line2</xsl:text> > > </Document> > .... > > ------------------------------------ > Result when running the stylesheet with saxon on the filesystem; > All line break variants actually result in new lines: > <Document> > block1 zeile1 > block1 zeile2 > block2 zeile1 > block2 zeile1 > block3 zeile1 > block3 zeile1 > </Document> > ---------------------------------- > > Result from calling xslt:transform in basex (saxon is used also within > basex); > Only the line break within the xsl:text is visible in the output: > <Document> > block1 line1 > block1 line2block2 line1block2 line2block3 line1block3 line2 > </Document> > ---------------------------------- > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
SG
Simon Görke30 Jul 2013 14:21 #
Christian,
thanks for the hint, but no change for the better. I also tried with the basex-internal xslt-processor (instead of saxon) but resulted in the same problem.
Any ideas welcome...
Greets,
Simon
Quoted text · Christian Grün · 92 lines
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen at gmail.com] Gesendet: Freitag, 26. Juli 2013 14:56 An: Simon Görke Cc: BaseX Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) Hi Simon, not sure if that helps, but you can try to deactivate whitespace chopping in the prolog of your XQuery expression: declare option db:chop "no"; ... Best, Christian 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: > Hi, > > I have small issue regarding the xslt:transform function (or what lies > beneath). We are currently migrating a larger number of existing > stylesheets into a basex-environment (before they were used with saxon > on the filesystem). > > The problem is, that all line breaks which are generated explicitly in > the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. > Line feeds within a xsl:text element are correctly transformed. See > below for the xslt and example output. > > First we thought this might be linked to the whitespace chopping of > the database where the transformation result is stored, however I get > the same behavior when directly looking at the output of > xslt:transform(...) in the basex-gui. > Is there any options to influence this behavior? We are using saxon9 > within basex version 7.6. > > Thanks for your help > Simon > > > ------------------------------- > Excerpt from example stylesheet: > ... > <Document> > <xsl:text> > block1 line1 > block1 line2 > </xsl:text> > > <xsl:text>
</xsl:text> > <xsl:text>block2 line1</xsl:text> > <xsl:text>
</xsl:text> > <xsl:text>block2 line2</xsl:text> > > <xsl:text> > </xsl:text> > > <xsl:text>block3 line1</xsl:text> > > <xsl:text> > </xsl:text> > > <xsl:text>block3 line2</xsl:text> > > </Document> > .... > > ------------------------------------ > Result when running the stylesheet with saxon on the filesystem; All > line break variants actually result in new lines: > <Document> > block1 zeile1 > block1 zeile2 > block2 zeile1 > block2 zeile1 > block3 zeile1 > block3 zeile1 > </Document> > ---------------------------------- > > Result from calling xslt:transform in basex (saxon is used also within > basex); Only the line break within the xsl:text is visible in the > output: > <Document> > block1 line1 > block1 line2block2 line1block2 line2block3 line1block3 line2 > </Document> > ---------------------------------- > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Christian Grün30 Jul 2013 17:25 #
Hi Simon,
could you provide us with a minimized example that demonstrates the (mis)behavior?
Thanks in advance
Christian
___________________________
2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>:
Quoted text · Simon Görke · 112 lines
> Christian, > > thanks for the hint, but no change for the better. I also tried with the > basex-internal xslt-processor (instead of saxon) but resulted in the same > problem. > > Any ideas welcome... > > Greets, > Simon > > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Freitag, 26. Juli 2013 14:56 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > not sure if that helps, but you can try to deactivate whitespace chopping in > the prolog of your XQuery expression: > > declare option db:chop "no"; > ... > > Best, > Christian > ___________________________ > > 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Hi, >> >> I have small issue regarding the xslt:transform function (or what lies >> beneath). We are currently migrating a larger number of existing >> stylesheets into a basex-environment (before they were used with saxon >> on the filesystem). >> >> The problem is, that all line breaks which are generated explicitly in >> the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >> Line feeds within a xsl:text element are correctly transformed. See >> below for the xslt and example output. >> >> First we thought this might be linked to the whitespace chopping of >> the database where the transformation result is stored, however I get >> the same behavior when directly looking at the output of >> xslt:transform(...) in the basex-gui. >> Is there any options to influence this behavior? We are using saxon9 >> within basex version 7.6. >> >> Thanks for your help >> Simon >> >> >> ------------------------------- >> Excerpt from example stylesheet: >> ... >> <Document> >> <xsl:text> >> block1 line1 >> block1 line2 >> </xsl:text> >> >> <xsl:text>
</xsl:text> >> <xsl:text>block2 line1</xsl:text> >> <xsl:text>
</xsl:text> >> <xsl:text>block2 line2</xsl:text> >> >> <xsl:text> >> </xsl:text> >> >> <xsl:text>block3 line1</xsl:text> >> >> <xsl:text> >> </xsl:text> >> >> <xsl:text>block3 line2</xsl:text> >> >> </Document> >> .... >> >> ------------------------------------ >> Result when running the stylesheet with saxon on the filesystem; All >> line break variants actually result in new lines: >> <Document> >> block1 zeile1 >> block1 zeile2 >> block2 zeile1 >> block2 zeile1 >> block3 zeile1 >> block3 zeile1 >> </Document> >> ---------------------------------- >> >> Result from calling xslt:transform in basex (saxon is used also within >> basex); Only the line break within the xsl:text is visible in the >> output: >> <Document> >> block1 line1 >> block1 line2block2 line1block2 line2block3 line1block3 line2 >> </Document> >> ---------------------------------- >> >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
SG
Simon Görke31 Jul 2013 11:47 #
Hi Christian,
I narrowed it down a little bit. Though turning it off in the xquery prologue as proposed did not help, the problem seems actually to be linked to the chopping option.
What I did not mention in my first posting is that the xslts are also stored in a (second) basex database.
What I found out is that the result of the transformation is ok (i.e. with all the line breaks required) if I *manually* create the database for the xslts in the basex-gui and *manually* set the chopping option to off in the creation window.
Surprisingly, when I create the databases automatically using the following xml-snippet
<commands>
<set option='chop'>false</set>
<create-db name='fromgme'/>
<create-db name='export'/>
<create-db name='xslt'/>
</commands>All databases have chopping set to off according to the GUI, but still the line breaks are lost in the transformation ???
I also found this thread
http://www.mail-archive.com/basex-talk at mailman.uni-konstanz.de/msg02257.html
with a similar problem, however locally setting the chop value as proposed is no remedy for my problem.
return (# db:chop "no" #) {
xslt:transform($xml,$xslt)
}Is there a possibility to disable chopping globally ? Our databases are either huge or contain text, but not both...
Thanks in advance
Simon
Quoted text · Christian Grün · 125 lines
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen at gmail.com] Gesendet: Dienstag, 30. Juli 2013 17:26 An: Simon Görke Cc: BaseX Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) Hi Simon, could you provide us with a minimized example that demonstrates the (mis)behavior? Thanks in advance Christian 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: > Christian, > > thanks for the hint, but no change for the better. I also tried with > the basex-internal xslt-processor (instead of saxon) but resulted in > the same problem. > > Any ideas welcome... > > Greets, > Simon > > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Freitag, 26. Juli 2013 14:56 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > not sure if that helps, but you can try to deactivate whitespace > chopping in the prolog of your XQuery expression: > > declare option db:chop "no"; > ... > > Best, > Christian > ___________________________ > > 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Hi, >> >> I have small issue regarding the xslt:transform function (or what >> lies beneath). We are currently migrating a larger number of existing >> stylesheets into a basex-environment (before they were used with >> saxon on the filesystem). >> >> The problem is, that all line breaks which are generated explicitly >> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >> Line feeds within a xsl:text element are correctly transformed. See >> below for the xslt and example output. >> >> First we thought this might be linked to the whitespace chopping of >> the database where the transformation result is stored, however I get >> the same behavior when directly looking at the output of >> xslt:transform(...) in the basex-gui. >> Is there any options to influence this behavior? We are using saxon9 >> within basex version 7.6. >> >> Thanks for your help >> Simon >> >> >> ------------------------------- >> Excerpt from example stylesheet: >> ... >> <Document> >> <xsl:text> >> block1 line1 >> block1 line2 >> </xsl:text> >> >> <xsl:text>
</xsl:text> >> <xsl:text>block2 line1</xsl:text> >> <xsl:text>
</xsl:text> >> <xsl:text>block2 line2</xsl:text> >> >> <xsl:text> >> </xsl:text> >> >> <xsl:text>block3 line1</xsl:text> >> >> <xsl:text> >> </xsl:text> >> >> <xsl:text>block3 line2</xsl:text> >> >> </Document> >> .... >> >> ------------------------------------ >> Result when running the stylesheet with saxon on the filesystem; All >> line break variants actually result in new lines: >> <Document> >> block1 zeile1 >> block1 zeile2 >> block2 zeile1 >> block2 zeile1 >> block3 zeile1 >> block3 zeile1 >> </Document> >> ---------------------------------- >> >> Result from calling xslt:transform in basex (saxon is used also >> within basex); Only the line break within the xsl:text is visible in >> the >> output: >> <Document> >> block1 line1 >> block1 line2block2 line1block2 line2block3 line1block3 line2 >> </Document> >> ---------------------------------- >> >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
IL
Imsieke, Gerrit, le-tex31 Jul 2013 12:19 #
Irrespective of the actual cause I’d like to reinforce my (and others’) point of view that chopping-by-default is non-XMLish and should be discarded.
Quoted text · Simon Görke · 185 lines
On 31.07.2013 11:47, Simon Görke wrote: > Hi Christian, > > I narrowed it down a little bit. Though turning it off in the xquery > prologue as proposed did not help, the problem seems actually to be linked > to the chopping option. > What I did not mention in my first posting is that the xslts are also stored > in a (second) basex database. > > What I found out is that the result of the transformation is ok (i.e. with > all the line breaks required) if I *manually* create the database for the > xslts in the basex-gui and *manually* set the chopping option to off in the > creation window. > > Surprisingly, when I create the databases automatically using the following > xml-snippet > > <commands> > <set option='chop'>false</set> > <create-db name='fromgme'/> > <create-db name='export'/> > > <create-db name='xslt'/> > > </commands> > > All databases have chopping set to off according to the GUI, but still the > line breaks are lost in the transformation ??? > > I also found this thread > > http://www.mail-archive.com/basex-talk at mailman.uni-konstanz.de/msg02257.html > > with a similar problem, however locally setting the chop value as proposed > is no remedy for my problem. > > return (# db:chop "no" #) { > xslt:transform($xml,$xslt) > } > > Is there a possibility to disable chopping globally ? Our databases are > either huge or contain text, but not both... > > Thanks in advance > Simon > > > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Dienstag, 30. Juli 2013 17:26 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > could you provide us with a minimized example that demonstrates the > (mis)behavior? > > Thanks in advance > Christian > ___________________________ > > 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Christian, >> >> thanks for the hint, but no change for the better. I also tried with >> the basex-internal xslt-processor (instead of saxon) but resulted in >> the same problem. >> >> Any ideas welcome... >> >> Greets, >> Simon >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Freitag, 26. Juli 2013 14:56 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> not sure if that helps, but you can try to deactivate whitespace >> chopping in the prolog of your XQuery expression: >> >> declare option db:chop "no"; >> ... >> >> Best, >> Christian >> ___________________________ >> >> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>> Hi, >>> >>> I have small issue regarding the xslt:transform function (or what >>> lies beneath). We are currently migrating a larger number of existing >>> stylesheets into a basex-environment (before they were used with >>> saxon on the filesystem). >>> >>> The problem is, that all line breaks which are generated explicitly >>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>> Line feeds within a xsl:text element are correctly transformed. See >>> below for the xslt and example output. >>> >>> First we thought this might be linked to the whitespace chopping of >>> the database where the transformation result is stored, however I get >>> the same behavior when directly looking at the output of >>> xslt:transform(...) in the basex-gui. >>> Is there any options to influence this behavior? We are using saxon9 >>> within basex version 7.6. >>> >>> Thanks for your help >>> Simon >>> >>> >>> ------------------------------- >>> Excerpt from example stylesheet: >>> ... >>> <Document> >>> <xsl:text> >>> block1 line1 >>> block1 line2 >>> </xsl:text> >>> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line1</xsl:text> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line2</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line1</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line2</xsl:text> >>> >>> </Document> >>> .... >>> >>> ------------------------------------ >>> Result when running the stylesheet with saxon on the filesystem; All >>> line break variants actually result in new lines: >>> <Document> >>> block1 zeile1 >>> block1 zeile2 >>> block2 zeile1 >>> block2 zeile1 >>> block3 zeile1 >>> block3 zeile1 >>> </Document> >>> ---------------------------------- >>> >>> Result from calling xslt:transform in basex (saxon is used also >>> within basex); Only the line break within the xsl:text is visible in >>> the >>> output: >>> <Document> >>> block1 line1 >>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>> </Document> >>> ---------------------------------- >>> >>> >>> >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke at le-tex.de, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930
Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler
CG
Hi Simon,
good to hear you could narrow down the problem.
Quoted text · Simon Görke · 2 lines
> Is there a possibility to disable chopping globally ? Our databases are > either huge or contain text, but not both...
the easiest way is to set CHOP=false in your .basex configuration [1].
As Gerrit indicates, the chopping flag caused frequent problems in the past. Due to legacy and storage issues, we are still hesitant to simply change the default, but we are working on it.
Best,
Christian
[1] http://docs.basex.org/wiki/Options
Quoted text · Simon Görke · 131 lines
> -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Dienstag, 30. Juli 2013 17:26 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > could you provide us with a minimized example that demonstrates the > (mis)behavior? > > Thanks in advance > Christian > ___________________________ > > 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Christian, >> >> thanks for the hint, but no change for the better. I also tried with >> the basex-internal xslt-processor (instead of saxon) but resulted in >> the same problem. >> >> Any ideas welcome... >> >> Greets, >> Simon >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Freitag, 26. Juli 2013 14:56 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> not sure if that helps, but you can try to deactivate whitespace >> chopping in the prolog of your XQuery expression: >> >> declare option db:chop "no"; >> ... >> >> Best, >> Christian >> ___________________________ >> >> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>> Hi, >>> >>> I have small issue regarding the xslt:transform function (or what >>> lies beneath). We are currently migrating a larger number of existing >>> stylesheets into a basex-environment (before they were used with >>> saxon on the filesystem). >>> >>> The problem is, that all line breaks which are generated explicitly >>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>> Line feeds within a xsl:text element are correctly transformed. See >>> below for the xslt and example output. >>> >>> First we thought this might be linked to the whitespace chopping of >>> the database where the transformation result is stored, however I get >>> the same behavior when directly looking at the output of >>> xslt:transform(...) in the basex-gui. >>> Is there any options to influence this behavior? We are using saxon9 >>> within basex version 7.6. >>> >>> Thanks for your help >>> Simon >>> >>> >>> ------------------------------- >>> Excerpt from example stylesheet: >>> ... >>> <Document> >>> <xsl:text> >>> block1 line1 >>> block1 line2 >>> </xsl:text> >>> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line1</xsl:text> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line2</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line1</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line2</xsl:text> >>> >>> </Document> >>> .... >>> >>> ------------------------------------ >>> Result when running the stylesheet with saxon on the filesystem; All >>> line break variants actually result in new lines: >>> <Document> >>> block1 zeile1 >>> block1 zeile2 >>> block2 zeile1 >>> block2 zeile1 >>> block3 zeile1 >>> block3 zeile1 >>> </Document> >>> ---------------------------------- >>> >>> Result from calling xslt:transform in basex (saxon is used also >>> within basex); Only the line break within the xsl:text is visible in >>> the >>> output: >>> <Document> >>> block1 line1 >>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>> </Document> >>> ---------------------------------- >>> >>> >>> >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> >
SG
Simon Görke31 Jul 2013 16:23 #
Hi there,
Setting CHOP=false in the .basex configuration solves my xslt issue but seems to have an ugly side-effect (bug?):
Using basex commands in xml syntax is not working any more;
if I call:
basexclient.bat -c cmd.xmlwith the content of cmd.xml being (for example):
<commands>
<create-db name='xslt'/>
</commands>it always returns " Syntax: <commands><...></commands>".
Executing the same without CHOP=false in .basex works like a charm.
Is there any chance this could be fixed?
Best,
Simon
Quoted text · Christian Grün · 148 lines
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen at gmail.com] Gesendet: Mittwoch, 31. Juli 2013 12:39 An: Simon Görke Cc: BaseX Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) Hi Simon, good to hear you could narrow down the problem. > Is there a possibility to disable chopping globally ? Our databases > are either huge or contain text, but not both... the easiest way is to set CHOP=false in your .basex configuration [1]. As Gerrit indicates, the chopping flag caused frequent problems in the past. Due to legacy and storage issues, we are still hesitant to simply change the default, but we are working on it. Best, Christian [1] http://docs.basex.org/wiki/Options > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Dienstag, 30. Juli 2013 17:26 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > could you provide us with a minimized example that demonstrates the > (mis)behavior? > > Thanks in advance > Christian > ___________________________ > > 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Christian, >> >> thanks for the hint, but no change for the better. I also tried with >> the basex-internal xslt-processor (instead of saxon) but resulted in >> the same problem. >> >> Any ideas welcome... >> >> Greets, >> Simon >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Freitag, 26. Juli 2013 14:56 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> not sure if that helps, but you can try to deactivate whitespace >> chopping in the prolog of your XQuery expression: >> >> declare option db:chop "no"; >> ... >> >> Best, >> Christian >> ___________________________ >> >> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>> Hi, >>> >>> I have small issue regarding the xslt:transform function (or what >>> lies beneath). We are currently migrating a larger number of >>> existing stylesheets into a basex-environment (before they were used >>> with saxon on the filesystem). >>> >>> The problem is, that all line breaks which are generated explicitly >>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>> Line feeds within a xsl:text element are correctly transformed. See >>> below for the xslt and example output. >>> >>> First we thought this might be linked to the whitespace chopping of >>> the database where the transformation result is stored, however I >>> get the same behavior when directly looking at the output of >>> xslt:transform(...) in the basex-gui. >>> Is there any options to influence this behavior? We are using saxon9 >>> within basex version 7.6. >>> >>> Thanks for your help >>> Simon >>> >>> >>> ------------------------------- >>> Excerpt from example stylesheet: >>> ... >>> <Document> >>> <xsl:text> >>> block1 line1 >>> block1 line2 >>> </xsl:text> >>> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line1</xsl:text> >>> <xsl:text>
</xsl:text> >>> <xsl:text>block2 line2</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line1</xsl:text> >>> >>> <xsl:text> >>> </xsl:text> >>> >>> <xsl:text>block3 line2</xsl:text> >>> >>> </Document> >>> .... >>> >>> ------------------------------------ >>> Result when running the stylesheet with saxon on the filesystem; All >>> line break variants actually result in new lines: >>> <Document> >>> block1 zeile1 >>> block1 zeile2 >>> block2 zeile1 >>> block2 zeile1 >>> block3 zeile1 >>> block3 zeile1 >>> </Document> >>> ---------------------------------- >>> >>> Result from calling xslt:transform in basex (saxon is used also >>> within basex); Only the line break within the xsl:text is visible in >>> the >>> output: >>> <Document> >>> block1 line1 >>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>> </Document> >>> ---------------------------------- >>> >>> >>> >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> >
CG
Christian Grün31 Jul 2013 16:27 #
Hi Simon,
I remember that there was such an issue with 7.6. Could you please see if it has been fixed in the 7.7 beta [1] (which will be final in a week)?
Thanks,
Christian
[1] http://files.basex.org/releases/latest/
___________________________
2013/7/31 Simon Görke <simon.goerke at ils.uni-stuttgart.de>:
Quoted text · Simon Görke · 187 lines
> Hi there, > > Setting CHOP=false in the .basex configuration solves my xslt issue but > seems to have an ugly side-effect (bug?): > Using basex commands in xml syntax is not working any more; > if I call: > > basexclient.bat -c cmd.xml > > with the content of cmd.xml being (for example): > > <commands> > <create-db name='xslt'/> > </commands> > > it always returns " Syntax: <commands><...></commands>". > > Executing the same without CHOP=false in .basex works like a charm. > > Is there any chance this could be fixed? > > Best, > Simon > > > > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Mittwoch, 31. Juli 2013 12:39 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > good to hear you could narrow down the problem. > >> Is there a possibility to disable chopping globally ? Our databases >> are either huge or contain text, but not both... > > the easiest way is to set CHOP=false in your .basex configuration [1]. > > As Gerrit indicates, the chopping flag caused frequent problems in the past. > Due to legacy and storage issues, we are still hesitant to simply change the > default, but we are working on it. > > Best, > Christian > > [1] http://docs.basex.org/wiki/Options > > > >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Dienstag, 30. Juli 2013 17:26 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> could you provide us with a minimized example that demonstrates the >> (mis)behavior? >> >> Thanks in advance >> Christian >> ___________________________ >> >> 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>> Christian, >>> >>> thanks for the hint, but no change for the better. I also tried with >>> the basex-internal xslt-processor (instead of saxon) but resulted in >>> the same problem. >>> >>> Any ideas welcome... >>> >>> Greets, >>> Simon >>> >>> >>> >>> -----Ursprüngliche Nachricht----- >>> Von: Christian Grün [mailto:christian.gruen at gmail.com] >>> Gesendet: Freitag, 26. Juli 2013 14:56 >>> An: Simon Görke >>> Cc: BaseX >>> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >>> >>> Hi Simon, >>> >>> not sure if that helps, but you can try to deactivate whitespace >>> chopping in the prolog of your XQuery expression: >>> >>> declare option db:chop "no"; >>> ... >>> >>> Best, >>> Christian >>> ___________________________ >>> >>> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>>> Hi, >>>> >>>> I have small issue regarding the xslt:transform function (or what >>>> lies beneath). We are currently migrating a larger number of >>>> existing stylesheets into a basex-environment (before they were used >>>> with saxon on the filesystem). >>>> >>>> The problem is, that all line breaks which are generated explicitly >>>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>>> Line feeds within a xsl:text element are correctly transformed. See >>>> below for the xslt and example output. >>>> >>>> First we thought this might be linked to the whitespace chopping of >>>> the database where the transformation result is stored, however I >>>> get the same behavior when directly looking at the output of >>>> xslt:transform(...) in the basex-gui. >>>> Is there any options to influence this behavior? We are using saxon9 >>>> within basex version 7.6. >>>> >>>> Thanks for your help >>>> Simon >>>> >>>> >>>> ------------------------------- >>>> Excerpt from example stylesheet: >>>> ... >>>> <Document> >>>> <xsl:text> >>>> block1 line1 >>>> block1 line2 >>>> </xsl:text> >>>> >>>> <xsl:text>
</xsl:text> >>>> <xsl:text>block2 line1</xsl:text> >>>> <xsl:text>
</xsl:text> >>>> <xsl:text>block2 line2</xsl:text> >>>> >>>> <xsl:text> >>>> </xsl:text> >>>> >>>> <xsl:text>block3 line1</xsl:text> >>>> >>>> <xsl:text> >>>> </xsl:text> >>>> >>>> <xsl:text>block3 line2</xsl:text> >>>> >>>> </Document> >>>> .... >>>> >>>> ------------------------------------ >>>> Result when running the stylesheet with saxon on the filesystem; All >>>> line break variants actually result in new lines: >>>> <Document> >>>> block1 zeile1 >>>> block1 zeile2 >>>> block2 zeile1 >>>> block2 zeile1 >>>> block3 zeile1 >>>> block3 zeile1 >>>> </Document> >>>> ---------------------------------- >>>> >>>> Result from calling xslt:transform in basex (saxon is used also >>>> within basex); Only the line break within the xsl:text is visible in >>>> the >>>> output: >>>> <Document> >>>> block1 line1 >>>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>>> </Document> >>>> ---------------------------------- >>>> >>>> >>>> >>>> _______________________________________________ >>>> BaseX-Talk mailing list >>>> BaseX-Talk at mailman.uni-konstanz.de >>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>> >> >
SG
Simon Görke31 Jul 2013 17:02 #
Hi,
I can confirm that 7.7beta fixes the xml command problem described before.
Unfortunately, our front-end (which works fine with 7.6) returns xquery errors with 7.7beta.
I did not read the changelog and cannot check in detail right now (we have to get it running using 7.6), but I will come back to it when 7.7 is actually released.
Thanks a lot for your help!
Simon
Quoted text · Christian Grün · 201 lines
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen at gmail.com] Gesendet: Mittwoch, 31. Juli 2013 16:28 An: Simon Görke Cc: BaseX Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) Hi Simon, I remember that there was such an issue with 7.6. Could you please see if it has been fixed in the 7.7 beta [1] (which will be final in a week)? Thanks, Christian [1] http://files.basex.org/releases/latest/ 2013/7/31 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: > Hi there, > > Setting CHOP=false in the .basex configuration solves my xslt issue > but seems to have an ugly side-effect (bug?): > Using basex commands in xml syntax is not working any more; if I call: > > basexclient.bat -c cmd.xml > > with the content of cmd.xml being (for example): > > <commands> > <create-db name='xslt'/> > </commands> > > it always returns " Syntax: <commands><...></commands>". > > Executing the same without CHOP=false in .basex works like a charm. > > Is there any chance this could be fixed? > > Best, > Simon > > > > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Mittwoch, 31. Juli 2013 12:39 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > good to hear you could narrow down the problem. > >> Is there a possibility to disable chopping globally ? Our databases >> are either huge or contain text, but not both... > > the easiest way is to set CHOP=false in your .basex configuration [1]. > > As Gerrit indicates, the chopping flag caused frequent problems in the past. > Due to legacy and storage issues, we are still hesitant to simply > change the default, but we are working on it. > > Best, > Christian > > [1] http://docs.basex.org/wiki/Options > > > >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Dienstag, 30. Juli 2013 17:26 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> could you provide us with a minimized example that demonstrates the >> (mis)behavior? >> >> Thanks in advance >> Christian >> ___________________________ >> >> 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>> Christian, >>> >>> thanks for the hint, but no change for the better. I also tried with >>> the basex-internal xslt-processor (instead of saxon) but resulted in >>> the same problem. >>> >>> Any ideas welcome... >>> >>> Greets, >>> Simon >>> >>> >>> >>> -----Ursprüngliche Nachricht----- >>> Von: Christian Grün [mailto:christian.gruen at gmail.com] >>> Gesendet: Freitag, 26. Juli 2013 14:56 >>> An: Simon Görke >>> Cc: BaseX >>> Betreff: Re: [basex-talk] losing line breaks with >>> xslt:transform(...) >>> >>> Hi Simon, >>> >>> not sure if that helps, but you can try to deactivate whitespace >>> chopping in the prolog of your XQuery expression: >>> >>> declare option db:chop "no"; >>> ... >>> >>> Best, >>> Christian >>> ___________________________ >>> >>> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>>> Hi, >>>> >>>> I have small issue regarding the xslt:transform function (or what >>>> lies beneath). We are currently migrating a larger number of >>>> existing stylesheets into a basex-environment (before they were >>>> used with saxon on the filesystem). >>>> >>>> The problem is, that all line breaks which are generated explicitly >>>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>>> Line feeds within a xsl:text element are correctly transformed. See >>>> below for the xslt and example output. >>>> >>>> First we thought this might be linked to the whitespace chopping of >>>> the database where the transformation result is stored, however I >>>> get the same behavior when directly looking at the output of >>>> xslt:transform(...) in the basex-gui. >>>> Is there any options to influence this behavior? We are using >>>> saxon9 within basex version 7.6. >>>> >>>> Thanks for your help >>>> Simon >>>> >>>> >>>> ------------------------------- >>>> Excerpt from example stylesheet: >>>> ... >>>> <Document> >>>> <xsl:text> >>>> block1 line1 >>>> block1 line2 >>>> </xsl:text> >>>> >>>> <xsl:text>
</xsl:text> >>>> <xsl:text>block2 line1</xsl:text> >>>> <xsl:text>
</xsl:text> >>>> <xsl:text>block2 line2</xsl:text> >>>> >>>> <xsl:text> >>>> </xsl:text> >>>> >>>> <xsl:text>block3 line1</xsl:text> >>>> >>>> <xsl:text> >>>> </xsl:text> >>>> >>>> <xsl:text>block3 line2</xsl:text> >>>> >>>> </Document> >>>> .... >>>> >>>> ------------------------------------ >>>> Result when running the stylesheet with saxon on the filesystem; >>>> All line break variants actually result in new lines: >>>> <Document> >>>> block1 zeile1 >>>> block1 zeile2 >>>> block2 zeile1 >>>> block2 zeile1 >>>> block3 zeile1 >>>> block3 zeile1 >>>> </Document> >>>> ---------------------------------- >>>> >>>> Result from calling xslt:transform in basex (saxon is used also >>>> within basex); Only the line break within the xsl:text is visible >>>> in the >>>> output: >>>> <Document> >>>> block1 line1 >>>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>>> </Document> >>>> ---------------------------------- >>>> >>>> >>>> >>>> _______________________________________________ >>>> BaseX-Talk mailing list >>>> BaseX-Talk at mailman.uni-konstanz.de >>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>> >> >
CG
Christian Grün31 Jul 2013 17:44 #
Hi Simon,
Quoted text · Simon Görke · 2 lines
> Unfortunately, our front-end (which works fine with 7.6) returns xquery > errors with 7.7beta.
I’m sorry to hear that. Don’t hesitate to give me an update when you’ve found the reason.
Best,
Christian
Quoted text · Simon Görke · 217 lines
> I did not read the changelog and cannot check in detail right now (we have > to get it running using 7.6), but I will come back to it when 7.7 is > actually released. > > Thanks a lot for your help! > > Simon > > > -----Ursprüngliche Nachricht----- > Von: Christian Grün [mailto:christian.gruen at gmail.com] > Gesendet: Mittwoch, 31. Juli 2013 16:28 > An: Simon Görke > Cc: BaseX > Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) > > Hi Simon, > > I remember that there was such an issue with 7.6. Could you please see if it > has been fixed in the 7.7 beta [1] (which will be final in a week)? > > Thanks, > Christian > > [1] http://files.basex.org/releases/latest/ > ___________________________ > > 2013/7/31 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >> Hi there, >> >> Setting CHOP=false in the .basex configuration solves my xslt issue >> but seems to have an ugly side-effect (bug?): >> Using basex commands in xml syntax is not working any more; if I call: >> >> basexclient.bat -c cmd.xml >> >> with the content of cmd.xml being (for example): >> >> <commands> >> <create-db name='xslt'/> >> </commands> >> >> it always returns " Syntax: <commands><...></commands>". >> >> Executing the same without CHOP=false in .basex works like a charm. >> >> Is there any chance this could be fixed? >> >> Best, >> Simon >> >> >> >> >> >> -----Ursprüngliche Nachricht----- >> Von: Christian Grün [mailto:christian.gruen at gmail.com] >> Gesendet: Mittwoch, 31. Juli 2013 12:39 >> An: Simon Görke >> Cc: BaseX >> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >> >> Hi Simon, >> >> good to hear you could narrow down the problem. >> >>> Is there a possibility to disable chopping globally ? Our databases >>> are either huge or contain text, but not both... >> >> the easiest way is to set CHOP=false in your .basex configuration [1]. >> >> As Gerrit indicates, the chopping flag caused frequent problems in the > past. >> Due to legacy and storage issues, we are still hesitant to simply >> change the default, but we are working on it. >> >> Best, >> Christian >> >> [1] http://docs.basex.org/wiki/Options >> >> >> >>> -----Ursprüngliche Nachricht----- >>> Von: Christian Grün [mailto:christian.gruen at gmail.com] >>> Gesendet: Dienstag, 30. Juli 2013 17:26 >>> An: Simon Görke >>> Cc: BaseX >>> Betreff: Re: [basex-talk] losing line breaks with xslt:transform(...) >>> >>> Hi Simon, >>> >>> could you provide us with a minimized example that demonstrates the >>> (mis)behavior? >>> >>> Thanks in advance >>> Christian >>> ___________________________ >>> >>> 2013/7/30 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>>> Christian, >>>> >>>> thanks for the hint, but no change for the better. I also tried with >>>> the basex-internal xslt-processor (instead of saxon) but resulted in >>>> the same problem. >>>> >>>> Any ideas welcome... >>>> >>>> Greets, >>>> Simon >>>> >>>> >>>> >>>> -----Ursprüngliche Nachricht----- >>>> Von: Christian Grün [mailto:christian.gruen at gmail.com] >>>> Gesendet: Freitag, 26. Juli 2013 14:56 >>>> An: Simon Görke >>>> Cc: BaseX >>>> Betreff: Re: [basex-talk] losing line breaks with >>>> xslt:transform(...) >>>> >>>> Hi Simon, >>>> >>>> not sure if that helps, but you can try to deactivate whitespace >>>> chopping in the prolog of your XQuery expression: >>>> >>>> declare option db:chop "no"; >>>> ... >>>> >>>> Best, >>>> Christian >>>> ___________________________ >>>> >>>> 2013/7/26 Simon Görke <simon.goerke at ils.uni-stuttgart.de>: >>>>> Hi, >>>>> >>>>> I have small issue regarding the xslt:transform function (or what >>>>> lies beneath). We are currently migrating a larger number of >>>>> existing stylesheets into a basex-environment (before they were >>>>> used with saxon on the filesystem). >>>>> >>>>> The problem is, that all line breaks which are generated explicitly >>>>> in the stylesheets (e.g. by using <xsl:text>
</xsl:text>) get lost. >>>>> Line feeds within a xsl:text element are correctly transformed. See >>>>> below for the xslt and example output. >>>>> >>>>> First we thought this might be linked to the whitespace chopping of >>>>> the database where the transformation result is stored, however I >>>>> get the same behavior when directly looking at the output of >>>>> xslt:transform(...) in the basex-gui. >>>>> Is there any options to influence this behavior? We are using >>>>> saxon9 within basex version 7.6. >>>>> >>>>> Thanks for your help >>>>> Simon >>>>> >>>>> >>>>> ------------------------------- >>>>> Excerpt from example stylesheet: >>>>> ... >>>>> <Document> >>>>> <xsl:text> >>>>> block1 line1 >>>>> block1 line2 >>>>> </xsl:text> >>>>> >>>>> <xsl:text>
</xsl:text> >>>>> <xsl:text>block2 line1</xsl:text> >>>>> <xsl:text>
</xsl:text> >>>>> <xsl:text>block2 line2</xsl:text> >>>>> >>>>> <xsl:text> >>>>> </xsl:text> >>>>> >>>>> <xsl:text>block3 line1</xsl:text> >>>>> >>>>> <xsl:text> >>>>> </xsl:text> >>>>> >>>>> <xsl:text>block3 line2</xsl:text> >>>>> >>>>> </Document> >>>>> .... >>>>> >>>>> ------------------------------------ >>>>> Result when running the stylesheet with saxon on the filesystem; >>>>> All line break variants actually result in new lines: >>>>> <Document> >>>>> block1 zeile1 >>>>> block1 zeile2 >>>>> block2 zeile1 >>>>> block2 zeile1 >>>>> block3 zeile1 >>>>> block3 zeile1 >>>>> </Document> >>>>> ---------------------------------- >>>>> >>>>> Result from calling xslt:transform in basex (saxon is used also >>>>> within basex); Only the line break within the xsl:text is visible >>>>> in the >>>>> output: >>>>> <Document> >>>>> block1 line1 >>>>> block1 line2block2 line1block2 line2block3 line1block3 line2 >>>>> </Document> >>>>> ---------------------------------- >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> BaseX-Talk mailing list >>>>> BaseX-Talk at mailman.uni-konstanz.de >>>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>>> >>> >> >
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery