next up previous contents index
Next: 3. Signed and binary Up: 2. Principles of conversion Previous: 2.2 Text to XML   Contents   Index


2.3 XML to text conversion

This conversion is a little bit more difficult and even in some cases impossible. Remember, TXT2XML implements only a subset of XML and COBOL. For example, this XML file :

Figure: Nonconvertible XML file
\begin{figure}\par\par
\begin{list}{}{
\setlength{\rightmargin}{\leftmargin...
...st}
\textbf{</city>}
\end{list}
\textbf{</weather>}\end{list}\par
\end{figure}

In this file, the XML element city is a complex one. It includes the simple element sky but also a content (Hot and sunny). The corresponding COBOL copybook would be something like :

Figure: Corresponding COBOL copybook
\begin{figure}\par\par
\begin{list}{}{
\setlength{\rightmargin}{\leftmargin...
...pic x(20).}
\par
\textbf{03 sky pic x(8).}\end{list}
\end{list}\par
\end{figure}

This is impossible in COBOL : a grouping item can't have a picture clause.2.5

So, not all the XML files can be converted. But, with avalid COBOL copybook, the XML file is read one line at the time and data is extracted using the following rules :


next up previous contents index
Next: 3. Signed and binary Up: 2. Principles of conversion Previous: 2.2 Text to XML   Contents   Index
sunuraxi@users.sourceforge.net