Re: [xslt] xsltParseStylesheetDoc Crash
- From: Daniel Veillard <veillard redhat com>
- To: Jason Keirstead <jason keirstead org>
- Cc: xslt gnome org
- Subject: Re: [xslt] xsltParseStylesheetDoc Crash
- Date: Tue, 25 Mar 2003 14:57:03 -0500
On Tue, Mar 25, 2003 at 03:03:43PM -0400, Jason Keirstead wrote:
> On March 25, 2003 02:33 pm, Daniel Veillard wrote:
> > So it's probably somewhere else and that could be version or linking
> > problems what are the versions you used ?
> > did you used xml2-config ? and xslt-config ? for the compile and
> > linking flags.
>
> Yes of course I use the linking flags provided by xml2-config and xslt-config,
> everything should be linked properly. I am very sure it is not a linking issue.
Okay, I got annoyed enough that I wrote a test.c doing exactly what
you say does not work, ... I don't know what your string routine does,
my libraries are C code, I just remplaced them with const char * and
used strlen, big surprize, it works here !!!
paphio:~/tmp -> gcc -o tst `xml2-config --cflags` `xslt-config --cflags` test.c
`xml2-config --libs` `xslt-config --libs`
paphio:~/tmp -> ./tst
<?xml version="1.0" encoding="UTF-8"?>
<message direction="0" from="UserFrom" subject="" importance="1" timestamp="11:26:53 am">
<from>
<contact contactDisplayName="UserFrom"/>
</from>
<to>
<contact contactDisplayName="UserTo"/>
</to>
<body bgcolor="#000000" color="#000000" font="Arial"><![CDATA[This is an
incoming message]]></body>
</message>
--------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<table><tr><td><xsl:value-of select="from/contact/@contactDisplayName"/>:
</td><td><xsl:value-of select="body"/></td></tr></table>
</xsl:template>
</xsl:stylesheet>
--------
<?xml version="1.0"?>
<table><tr><td>:
</td><td></td></tr></table>
paphio:~/tmp ->
I would have considered your job to actually make a standalone version
of the failing code, as well as comply to the bug report/help suggested
steps. Joining the list when asking for help would have been a
courtesy gesture too, oh well ...
the code is attached. It should work in a similar way on your installation
from there this should make cristal clear that xmlParseMemory() is NOT
the problem, I use it in thousands of regression tests before any release.
Now I don't know what your string routine does, how you linked the application
nor other parameters but it seems clear to me that the code you're pointing
at is simply working. The fact that you refused to build a standalone
test and I had to do it myself is especially unpleasant, but I can cope
with that level, but not too often, the day I will be pissed off for good
I will go write some commercial software and ask for a large check when
someone starts to ask for help.
Now based on this code you should be able to do the normal debugging
job to change it back to your original code until this fails. You then
will be able to pinpoint where your problem was.
Daniel
PS. the stylesheet is wrong it should be
<xsl:template match="/message"> instead of <xsl:template match="/">
considering the embeded XPath expressions and you input.
PS2: freeing the allocated structures is described in the tutorial and not
present in this code.
--
Daniel Veillard | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]