On Thu, 2 Mar 2006 13:15:51 +0100
Ricardo Mones <[EMAIL PROTECTED]> wrote:
> Sorry for the late reply... :)
Yah, same here sometimes; for some reason email tends to pile up. I
fire off easy emails, then months later notice some slightly harder one
I'd put aside.
> I think you can better try xsltproc and a simple XSLT stylesheet.
> Attached an example of a addressbook XML to XHTML conversion I did
> time ago. Doing it for generating text will be probably easier, there
> is a lot of XSLT tutorials out there if you have doubts.
Thanks very much for the help, but I don't know how to run the script,
or what it outputs. Naturally it probably would be a good thing if I
were to learn XML. Yet a solution to a wishlist bug that requires users
to learn a whole new language (or a variant) seems difficult.
Nothing against XML though. What's desired is a no-brainer solution...
e.g. "upgrade, right click there, and pick the new convert/translate
option".
That being said, some observations on the attached XML. A trial run:
% xsltproc /tmp/sylpheed-addrbook-to-xhtml.xsl ; echo $?
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : error parsing
attribute name
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : attributes
construct error
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : Couldn't find end
of Start Tag mones line 8
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
cannot parse /tmp/sylpheed-addrbook-to-xhtml.xsl
4
...that didn't work. Well maybe the man page for 'xsltproc' will
help; its syntax:
SYNOPSIS
xsltproc [[-V | --version] [-v | --verbose] | {-o | --output} FILE |
--timing |
--repeat | --debug | --novalid | --noout | --maxdepth VALUE |
--html |
--param PARAMNAME PARAMVALUE | --stringparam PARAMNAME
PARAMVALUE |
--nonet | --path "PATHS" | --load-trace | --catalogs |
--xinclude
[--profile | --norman] | --dumpextensions | --nowrite |
--nomkdir |
--writesubtree PATH | --nodtdattr] [STYLESHEET] {FILE...}
...bit of Swiss Army Knife there. I'll take a guess and try passing
the data as FILE. First I need a file. Here are some:
% ls ./.sylpheed/
accountrc filter.xml.bak sylpheed.log
accountrc.bak filterheaderrc sylpheed.log.bak
addrbook--index.xml filterheaderrc.bak sylpheedrc
addrbook--index.xml.bak folderlist.xml sylpheedrc.bak
addrbook-000001.xml folderlist.xml.bak templates/
addrbook-000002.xml imapcache/ tmp/
addrbook-000002.xml.bak menurc uidl/
command_history mimetmp/
filter.xml newscache/
...which one? Probably begins with 'addr'. Copy some of those to '/tmp'
then, and try again:
% xsltproc /tmp/sylpheed-addrbook-to-xhtml.xsl addrbook--index.xml
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : error parsing
attribute name
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : attributes
construct error
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
/tmp/sylpheed-addrbook-to-xhtml.xsl:8: parser error : Couldn't find end
of Start Tag mones line 8
Copyright 2005-2006 by Ricardo Mones <[EMAIL PROTECTED]>
^
cannot parse /tmp/sylpheed-addrbook-to-xhtml.xsl
Nope. Try another one...
% xsltproc /tmp/sylpheed-addrbook-to-xhtml.xsl addrbook-000001.xml
[ same error output as above ]
Doesn't work if the files are redirected in with standard input either.
Beats me what to do. Hope the above isn't too much cruft; my
floundering is included mainly for the benefit of novice users who just
want a CLI one-liner -- as negative examples of "obvious things that
won't work".
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]