[xslt] Re: [xml] Problem in xsltSaveResultToFile

On 27.05.2005 19:00, Oksana Drobnic wrote:
Hi Igor,

Ho Oksana,

Sorry, to bother you. However, I've got the same problem with
xsltSaveResultToFile() as it was mentioned on the maling list.

As if that were a reason to bother me :) No, no, I'm joking, I am gladly bothered, that keeps me from becoming forgotten, I am a social person :)

I'm using VC7 on Win XP.

Oh, I am so sorry.

I tried bin that you provide & I've
downloded source code and recompiled libxml2 and libxslt without
iconv and zlib I had to swith off ftp as well as I had some error
undefined simbols (something like ..SOCKETS.. I don't remember exact
name when compiling libxml2).

You made it, that counts :)

As a result I've got: libxml2.dll,
libxslt.dll, libexslt.dll and xsltproc.exe that is running fine.
However, when I'm using the example program from the tutorial website
(exact copy attached that is built in VC7 project (I'm not good with
makefiles) with foo.xml and foo.xsl it's crashing in runtime on
xsltSaveResultToFile on heapalloc (in both cases witn your bin and
with mine freshly recompiled).
C:\New Folder\xslttets\Debug>xslttets.exe --param rootid "'asect1'"
foo.xsl foo.xml.

printscren of error is in the error.bmp.

As one can clearly see on that screenshot, which mentions 'System.NullReferenceException', the exception thrown is a part of the .NET runtime. You compiled your program as managed C++, an act that brought you some amount of trouble.

I compiled your program here using my libxml/libxslt binaries, without touching your code. Let's see that step in action:

  C:\Temp\boo> cl /MD /IC:\Opt\fsw\include xslttest.cpp \
    /link /LIBPATH:C:\Opt\fsw\lib libxslt.lib libxml2.lib



Neat. Compiles without any trouble. Now let's see it running. I'll start it with fingers crossed, here it goes:

  C:\Temp\boo> xslttest.exe --param rootid "'asect1'" foo.xsl foo.xml
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>s1 foo</title>
  <body bgcolor="#ffffff" text="#000000">
  <table width="100%" border="0" cellspacing="0" cellpadding="4"><tr><td
  bgcolor="#006699"><font color="#ffffff" size="+1"><b>Foo</b>

Now, that is the expected output, I'd wager. Now relax, realise it is friday evening, turn off the screen and... and if I give you any more advice I could be sued for promoting potentially damaging beverages :)

By the way, I'll post a copy of this to libxslt mailing list, perhaps there are others who could find it informative.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]