Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

Problems with SSAX/SXML


Hey all,

I've been working with a ported version of SSAX to Chez (I think I
started with the R5RS version from SF). When I remember porting this
thing, I remember runningg the verification tests and things seemed to
be working fine. However, now, there appears to be a bit of a problem
with using SXML->HTML which is unexpected. I wonder if someone is here
who has used the software and can help me understand what is going
wrong?

(define (make-field-xml article ft)
  (sxml->html `(,(getprop
                   'prefs
                   (string->symbol
                     (string-append
                       (symbol->string ft)
                       "-html-tag")))
                (@ (class ,(symbol->string ft)))
                ,(getprop article ft))))

(define (make-article-string article)
  (with-output-to-string
    (lambda ()
      (display (getprop 'prefs 'article-start))
      (loop ((for field-type (in-list (getprop 'prefs 'field-order))))
        (display (make-field-xml article field-type)))
      (display (getprop 'prefs 'article-end)))))

This is the basic code that I am using. (SXML->HTML ...) seems to be
giving me a string like expected, but all the strings are appended at
the end with the characters "#t". What's with that?

(SXML->HTML '(p "Test")) : "<p>Test</p>#t"

I'm thinking now that something must be wrong with my port, but I don't
remember changing too much to make it work. Also, rerunning the
verifications on the tree-trans and SXML->HTML files seems to indicate
that everything is fine. :-S I am a bit confused.
--
Aaron Hsu <aaron.@sacrificumdeo.net>

Aaron Hsu writes:
> [...]
> This is the basic code that I am using. (SXML->HTML ...) seems to be
> giving me a string like expected, but all the strings are appended at
> the end with the characters "#t". What's with that?
> (SXML->HTML '(p "Test")) : "<p>Test</p>#t"

Could it be that "<p>Test</p>" is the output of `SXML->HTML', written
to `current-output-port', and that #t is the return value of that
procedure, also written to `current-output-port' because you are in
the REPL?

Just like

   (begin (display "foo") #t)

--
Emlio C. Lopes                            Ich leb und wei nit wie lang,
Munich, Germany                            ich stirb und wei nit wann,
                                           ich fahr und wei nit wohin,
                 (Martinus von Biberach)   mich wundert, dass ich frhlich bin!

On 2007-04-08 07:45:14 -0500, Emilio Lopes <e@gmx.net> said:

Apparently that's what it is. I don't know why it shows up in my code,
since I shouldn't be writing out the return value of SXML->HTML.
--
Aaron Hsu <aaron.@sacrificumdeo.net>
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc