How do I make changes to the PO XML format used by RMS system. I need to create XML purchase orders to be exported from RMS and sent to a vendor for translation in a traditional EDI/XML order processing application?
I want to add additional data elements to the default order format. Where is the XML schema located?
I also think that I need to change the xml encoding statement from UTF-16 to UTF-8.
<?xml version="1.0" encoding="UTF-16"?>
The exported XML order document cannot be translated by our vendor due to invalid characters (x'FF' and x'FE') that precede the beginning of the xml document.
*This post is locked for comments
The definition for the PO files is in the POFormats folder in your RMS install folder.
The standard PO output format is defined in RMSPurchaseorder.xsl. XSL files provide stylesheets for creation of XML documents. If you are using a custom PO format, the file should still be in that folder, but may have a different name. The xsl file defines what the resultant xml file will contain.
What I would try is to add the following parameter to the xsl:output statement near the beginning of the file:
encoding="windows-1252"
"windows-1252" is a superset of the "ISO-8859-1" character set, which you could also try. Both use a simple 8-bit encoding of the Latin alphabet (kinda like ASCII, but with some additional characters defined). UTF-8 is a variable length encoding where most of the usual ACSII characters are encoded using 1 byte, while less common characters in the Unicode character set are encoded using 2, 3 or even 4 bytes per character.
You may even want to try 'encoding="UTF-8"'. Your vendor may support that.
All of the parameters tell the xsl parser what format the output file should be in. The default RMS PO file does not specify an encoding, so RMS is using a default from somewhere.
XSL is not specific to RMS. It is a standard just like XML, so Google is your friend here.
Thanks FuncTech... Great info on the UTF-16 hex characters preceding the xml BOM.
Next question is: how do I change the RMS PO export process to use the UTF-8 encoding data stream? Where in RMS system is the XML PO format/schema used by the PO export function?
The fe ff characters are at the beginning of the data stream and are called byte order marks. These are sent at the beginning of the UTF-16 stream in this case to indicate the endianness of the following data stream. That is: for a 16 bit value is the high order or low order byte sent first? UTF-8 will often start the stream with EF BB BF to indicate that this is a UTF-8 data stream.
The various Unicode BOM markers are:
First bytes | Encoding assumed |
---|---|
EF BB BF | UTF-8 |
FE FF | UTF-16 (big-endian) |
FF FE | UTF-16 (little-endian) |
00 00 FE FF | UTF-32 (big-endian) |
FF FE 00 00 | UTF-32 (little-endian) |
None of the above | UTF-8 |
The XML standard specifies that all XML data streams should be encoded in a Unicode character set and support BOM characters at the beginning of the stream. the standard also states that all XML parsers should support BOM's and various Unicode character sets. So the problem is actually with your vendor's system. But that is of no help to you since they probably don't want to change.
Can you set the encoding to ASCII? That is not officially supported by XML, but may be what your vendor is looking for. It would also mean that you cannot send characters outside of the ASCII character set.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156