Bug 144749 - kxsldbg does not honor file encoding
Summary: kxsldbg does not honor file encoding
Status: RESOLVED FIXED
Alias: None
Product: kxsldbg
Classification: Miscellaneous
Component: kxsldbg (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Keith Isdale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-27 16:07 UTC by Ana Guerrero
Modified: 2008-03-25 23:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
test1.xml (78 bytes, text/xml)
2007-04-27 16:10 UTC, Ana Guerrero
Details
test1.xslt (290 bytes, text/x-xslt)
2007-04-27 16:11 UTC, Ana Guerrero
Details
test2.xslt (317 bytes, text/x-xslt)
2007-04-27 16:12 UTC, Ana Guerrero
Details
Patch to kxsldb to address reported crash bug (6.72 KB, patch)
2008-02-17 09:36 UTC, Keith Isdale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ana Guerrero 2007-04-27 16:07:41 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Debian testing/unstable Packages

Bug exported from the Debian Bug Tracking System:
http://bugs.debian.org/321277

First mail:

This was report against version: 3.3.2

I'm (not surprisingly) using UTF-8 as encoding for my files, and I'm
also running an UTF-8 locale. But somehow kxsldbg assumes that my files
are in latin1, displaying characters such as german umlaut characters
incorrectly.
Syntax Highlighting would be nice, too.
The most useful thing would be to see which template is responsible for
which line of the output file by clicking at the respective nodes
(apart from the line unit being unsuiteable for XML... better set
breakpoints and such on certain nodes!)


Second mail, version 3.5.6

It's slightly different right now; my input file in UTF-8 is
displayed corretly, the output file is ISO-8859-15 and isn't displayed
correctly. The XML declaration correctly gives the encoding.

Attached is a trivial test case, unfortunately this crashes kxsldbg
instead...

P.S. the proper file name for a XSLT file is .xslt IMHO... your default
file name pattern definitely should include .xslt
And actually you might consider naming it kxsltdbg, since it only does
XSL-T, doesn't it?

P.P.S. test1.xslt doesn't produce valid XML as output; but test2.xslt
also triggers the crash in kxsldbg.
Comment 1 Ana Guerrero 2007-04-27 16:10:45 UTC
Created attachment 20427 [details]
test1.xml
Comment 2 Ana Guerrero 2007-04-27 16:11:34 UTC
Created attachment 20428 [details]
test1.xslt
Comment 3 Ana Guerrero 2007-04-27 16:12:22 UTC
Created attachment 20429 [details]
test2.xslt
Comment 4 Keith Isdale 2008-01-13 07:51:31 UTC
Hi,

I am the original author of kxsldbg and I recently saw this bug.


You wrote:
>I'm (not surprisingly) using UTF-8 as encoding for my files, and I'm 
> also running an UTF-8 locale. But somehow kxsldbg assumes that my files 
> are in latin1, displaying characters such as german umlaut characters 
> incorrectly. 

I assume that the output view is being referred to here which defaults to UTF-8 and this document is not UTF-8 hense the problem. 

Solution: 
   1) Click in the "Settings" menu in KXsldbg 
   2) click "Configure Editor"    
   3) click "filetype" in the list on left of dialog
   4) create a new file type for the ISO-8859-15 encoded document like the following :
           Name : ISO-8859-15 Document
           Section :   Markup
           Variables:  kate: indent-mode none; encoding ISO-8859-15;
           File extensions: *.15xml
           MIME types : text/xml
    5) configure kxsldbg to use test1.15.xml as the output file name to use
    6) re-run the style sheet then click on the "Output" icon to view the result of the XSLT transformation


Do you see what I mean?


Regarding the crash mentioned: I still can no reproduce I have used the
  * xml version 2.6.21
  * xslt version 1.1.14
  * kxsldbg version that comes with KDE version 3.5.8. 
Please provide a backtrace/coredump to progress any further and or some general hints on quickly getting a Debian system setup as per this email thread. 

Regarding the comment that kxsldbg can generate invalid XML; that is correct and is the behavior of the underlying xml/xslt engine used. Sorry not much I can do about that. Try chatting with the people on the libxslt lists since xsltproc generates the same output as kxsldbg in this case.

You wrote:
> Syntax Highlighting would be nice, too. 

Syntax highlighting is already done is is provided by Kate if you are not seeing any fancy highlighting then check how you have configured the Kate editor in kxsldbg , see "Configure Editor" mentioned above.


You wrote:
>
> The most useful thing would be to see which template is responsible for 
> which line of the output file by clicking at the respective nodes 
> (apart from the line unit being unsuiteable for XML... better set 
> breakpoints and such on certain nodes!) 

That is a tough feature to implement and I am yet to port kxsldbg to KDE4. May I suggest that you try the "Walk" functionality in kxsldbg to walk through the stylesheet (select the "Output" view first )

It is possible to set breakpoints on both XSLT nodes and XML nodes; however it is not possible to set breakpoints on the text output functions.

You wrote:
>P.S. the proper file name for a XSLT file is .xslt IMHO... your default 
> file name pattern definitely should include .xslt 

I will see what can be done in the KDE 4 version of kxsldbg to address that problem 

> And actually you might consider naming it kxsltdbg, since it only does 
> XSL-T, doesn't it? 

Sorry I do not plan to change the name of the application at this time. The code to kxsldbg is in SVN so if someone is so motivated that a name change is in order and let me know that they are willing to take up maintenance on this application that would be fine by me

--
Keith 

 

   




 
Comment 5 Ana Guerrero 2008-01-26 01:55:31 UTC
Hi Keith,
the bug submitter sent a reply in the Debian BTS:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321277

-------------------------------------------------------
The input files are UTF-8.
kxsldbg displays them as if they were Latin-1. So it seems like kxsldbg
defaults to using Latin-1 as default output charset.

The files (they're attached here, too) contain a proper XML encoding
specification, and thus should not need any user-defined file type
hacks. kxsldbg should just use the encoding specified in the XML file.

"Configure Editor" doesn't do anything here, no dialog to input any
settings.

It still crashes here, using versions
kxsldbg    3.5.8
kdelibs    3.5.8.dfsg.1
libxml2    2.6.31.dfsg
libxslt1.1 1.1.22

P.S. With the "file name pattern" comment I was referring to the "open
file" dialog extension patterns. It includes odd stuff such as .Xsl, but
lacks the obvious .xslt
I don't see a reason why this would have to wait for KDE 4.

-------------------------------------------------------
Comment 6 Keith Isdale 2008-01-27 23:39:44 UTC
Quoting Ana Guerrero <ana@ekaia.org>:

[bugs.kde.org quoted mail]

Umm, not to my recollection or testing; kxsldbg just displays the file as provided by the xslt 
engine used. 

Will check again when able to.

> The files (they're attached here, too) contain a proper XML encoding
> specification, and thus should not need any user-defined file type
> hacks. kxsldbg should just use the encoding specified in the XML
> file.


Sorry, I am not sure how to do that.
 
> "Configure Editor" doesn't do anything here, no dialog to input any
> settings.


Odd, will check ...

> It still crashes here, using versions
> kxsldbg    3.5.8
> kdelibs    3.5.8.dfsg.1
> libxml2    2.6.31.dfsg
> libxslt1.1 1.1.22
> 
> P.S. With the "file name pattern" comment I was referring to the
> "open
> file" dialog extension patterns. It includes odd stuff such as .Xsl,
> but
> lacks the obvious .xslt
> I don't see a reason why this would have to wait for KDE 4.

Comment 7 Keith Isdale 2008-02-17 09:36:45 UTC
Created attachment 23602 [details]
Patch to kxsldb to address reported crash bug
Comment 8 Keith Isdale 2008-02-17 09:39:39 UTC
I tried again to reproduce and have managed to reproduce the crash bug mentioned. Please try the patch attached to this bug, ie : 
        http://bugs.kde.org/attachment.cgi?id=23602&action=view

Has that fixed the problem?

--
Keith 
Comment 9 Keith Isdale 2008-03-25 23:41:58 UTC
SVN commit 790132 by isdale:

apply bug fix for crash when using newer versions of libxml/libxslt: bug #450549 (debian bug system)
Backport bug fix from trunk
BUG:144749


 M  +2 -2      libqtnotfier/xsldbgevent.cpp  
 M  +41 -37    libxsldbg/nodeview_cmds.cpp  
 M  +13 -12    libxsldbg/variable_cmds.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=790132