Hi
I use xpathscript to process docbook xml articles for our
woundcare
journal World Wide Wounds (www.worldwidewounds.com).
In recent years we have had lots of articles referencing
articles in
Scandanavia, hence a requirement to use ö and other
entities in
authors' names.
Most of the time the processing works OK (they are usually
found in the
citations), but we have an issue at the moment where
ö
in the body of the text results in the output of a two-byte
character,
and yet in a different part of the document (the
bibliography) the
conversion works correctly and the 'o' with two little dots
above it
comes out OK when viewed by firefox using ISO-8859-1
encoding.
Clearly this is a problem in the way I am handling the
incoming xml.
An example of what doesn't work is text in a sidebar, where
my code is:
------------------------------------------------------------
------------
# Sidebar
$t->{'sidebar'} = sub {
my ($node, $t) = _;
my ($fileref);
my $id;
if ($id = findvalue(' id', $node)) {
$t-> .= "<a
name="$id"></a>";
}
# When we find a sidebar,
# put link to it
$t-> .= '<DIV CLASS="sidebar">';
$t-> = '</DIV>';
return 1; #
};
$t->{'para'} = sub {
my ($node, $t2) = _;
my ($id);
my ($anchor);
if ($id = findvalue(' id', $node)) {
$anchor=$id;
}
# we want to get rid of para breaks directly after
# we start a glossary definition, so check for
# $removepara > 0
if ($removepara > 0) {
$t2-> .= "";
} else {
if ($anchor ne "") {
$t2-> .= "<p><a
name="$anchor"></a>";
} else {
$t2-> .= "<p>";
}
# $t2-> = "</p>"; # this
really should work, but it messes up NS4.x
}
#$removepara=0;
$removepara--;
return 1;
};
------------------------------------------------------------
------------
If I use:
<sidebar><para>This article was sponsored by an
educational grant from
Lönd Corp</para></sidebar>
the "Lönd Corp" comes out with a two-byte
character in it.
Is there some easy hack which I am missing which would
automatically
convert the text to the appropriate encoding ? I suspect it
is
something I should be doing in the 'para' subroutines ?
I'm happy to send the three files (main file plus two
library files)
which do the conversion, but in total they come to about 30
pages of
code.
Any help much appreciated.
Regards,
Pete
--
Pete Phillips, Acting Director, | http://www.smtl.co.uk/
Surgical Materials Testing Lab, | http://www.worldwidew
ounds.com/
Princess of Wales Hospital, S Wales | http://www.dressings.org/
a>
Tel/Fax: +44 1656-752820/30 | pete smtl.co.uk
------------------------------------------------------------
---------
To unsubscribe, e-mail: axkit-users-unsubscribe axkit.org
For additional commands, e-mail: axkit-users-help axkit.org
|