XML Parser (XML File Converter)

 

Introduction

 

RC-WinTrans comes with a ready-made file converter for XML files.  However, XML files can have a variety of structures, so in many cases an additional converter must be realized in order

to support a specific XML file structure.  Essentially the XML file converter needs to know which parts of a particular XML file are to be translated.  This information is provided to the XML converter via XSL extended stylesheets.  These stylesheets are called XML parsers.  An XML parser points out the elements to be translated in an XML file.

 

RC-WinTrans processes (reads/writes) XML files using an XSL transformation.  An XSL stylesheet acts as a parser reading a certain XML file format and specifying which data is to be translated.

 

 

Obtaining an XML Parser for a Specific XML File

 

Contact Schaudin.com if you need an XML parser to translate your specific XML format file with RC-WinTrans.  Please send us an example of your XML file(s) as well.

 

The RC-WinTrans Developer Help contains information and examples to help maintain/create XML parser files.

 

 

Activating an XML Parser Stylesheet  (.xsl File)

 

Option 1:  Local Folder

Place the XML parser stylesheet (.xsl) in the same folder as the XML files to be translated.  This causes the XML parser to be used only on XML files located in the same folder.

 

Usage: Used when all XML files to be translated are only in one folder.

 

----------------------------------------------------------------------------------------------------------------------------------------------

 

Option 2:  General "FileConverter" Folder

Putting the XML parser style sheets in the "FileConverter" folder causes the XML parser to be used globally for XML files in any folder.

Usage: Used when the XML files to be translated are in different folders.

 

RC-WINTRANS 9.0 – 9.3

Place the XML parser file in the RC-WinTrans installation folder named "FileConverter":

<installdir>\RC-WinTrans\RC-WinTrans 10l\FileConverter\

 

RC-WinTrans 9.4

Use the menu commands "File" | "Folders..." | "XML Parser Stylesheets (All User)..."
The Windows file explorer will be opened for the "FileConverters" folder.
Copy the .xls files to this folder.

 

RC-WINTRANS 10 and later:

 

>> Drag&Drop

Move and drop the XML Parser stylesheet file to the RC-WinTrans application window.
RC-WinTrans will copy the file to the "FileConverters" folder."

The Windows file explorer will be opened to view the file in the "FileConverters" folder.

 

>> Copy to "File Converters" Folder

Use the menu commands "File" | "Folders..." | "XML Parser Stylesheets (All User)..."
The Windows file explorer will be opened for the "FileConverters" folder.
Copy the .xls files to this folder.

 

RC-WinTrans will look for the XML parser stylesheet (.xsl) in the same folder as the one containing the XML file to be translated (local folder, option 1) first.  If a converter is not found there, RC-WinTrans will check the "FileConverters" folder (option 2) for the required XML parser styesheet.

 

 

XML Parser File Naming Convention

 

XML parser files (file extension:.xsl) have a predefined file naming convention.  It dictates that the file name begin with the prefix "XMLParser-" followed by the name of the root element of the XML file for which the parser is made.

 

EXAMPLE:  "XMLParser-Symbols.xsl"; "XMLParser-docroot.xsl"

 

Note:  If the name of the XML root element contains a namespace then an underline character must be used in the file name for the ':' between the namespace and the root element name

 

EXAMPLE:  root element name       <mnts:materials>

                  XML parser file name    "XMLParser-mnts_materials"

 

 

Examples

 

Examples to use in creating your own XML parser (XSL stylesheet) to translate an XML file can be found in the RC-WinTrans Developer Help.

 

 

^ TOP ^