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@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@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@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@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@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:textblock2 line1</xsl:text> xsl:text
</xsl:text> xsl:textblock2 line2</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 line1</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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.
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@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@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@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@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@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:textblock2 line1</xsl:text> xsl:text
</xsl:text> xsl:textblock2 line2</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 line1</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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@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@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@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@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:textblock2 line1</xsl:text> xsl:text
</xsl:text> xsl:textblock2 line2</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 line1</xsl:text>
xsl:text </xsl:text>
xsl:textblock3 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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de