Example: XML Cyrillic ISO8859-5 to UTF-8 translation
This example shows the operation of the system. An XML-to-XML translation performs a bulkcopy of the content and then copies a literal UTF-8 into the XML encoding declaration.
The input file is in ISO8859-5, a single-byte Cyrillic codepage. In this example, the XML declaration changes from ISO8859-5 to UTF-8; the encoding also changes to UTF-8.
Translate file:
prologue
xlt_infile: xml text test
who:
date:
xlt_outfile:
type: xlt
end_prologue
{ { OP COMMENT }
{ COMMENT {This translation translates the encoding from whatever it is into utf-8 by saving utf-8 in the outbound declaration} }
}
{ { OP BULKCOPY }
{ ERR 0 }
}
{ { OP COPY }
{ ERR 0 }
{ IN =utf-8 }
{ OUT ?xml.&encoding }
}