<...>2GXL conversion
To create a converter from any other graph exchange format to GXL can be a more complex procedure in some cases. There are two main types of converters that shall be explained here.
The first one are converters from an XML based graph exchange format to GXL and the second one are form non XML based graph exchange formats to GXL. Why this subdivision is important will become clear in the following explainations.
These two types of converters can be devided into two further subtypes (analogous to the chapter about the GXL2<...> conversion), so that there are four main use cases for the GCF :
1) Conversion from an XML based format to GXL
| a) without manipulating the syntax tree of the source document |
| b) with manipulation of the syntax tree of the source document |
2) Conversion from a non XML based format to GXL
| a) without manipulating the syntax tree of the source document |
| b) with manipulation of the syntax tree of the source document |
In the following shall be shown how the GCF works in each of these cases.
Figure 1 illustrates how the GCF works during a conversion from an XML based graph exchange format to GXL without manipulating the syntax tree of the source document.

Figure 1 : Conversion from an XML based exchange format to GXL without manipulating the syntax tree of the drain document
The conversion again starts by parsing the source document. As it is based upon an XML format, you can use the AElfred parser to do this. The parser generates events, which are passed on to the GXLDocumentHandler. The GXLDocumentHandler is the conversion device and that's what is typical for the <...>2GXL conversion. You have to decide here, which construct of the source format shall be converted into which GXL construct and generate the input stream for the GXLConnector. The GXLConnector then uses the default implementation 1 and the GXLOutputAPI to write the resulting gxl file.
So all the user has to do is to implement the conversion device (GXLDocumentHandler) and to initialize the GCF.
There's no demo file available for this use case because the initialization of the GCF should be clear from the chapter about the GXL2<...> conversion, and the implementation of the conversion device depends on the structures of the source and drain format.
If you now want to manipulate the structure of the created GXL document befor you output it, the GCF works as shown in figure 2.

Figure 2 : Conversion from an XML based exchange format to GXL with manipulation of the syntax tree of the drain document
As you can see, you again need two instances of the GXLConnector. The conversion is started by parsing the source document and converting the structures of the source format into gxl structures. The GXLDocumentHandler then generates the input stream for the 1st instance of the GXLConnector, which uses the default implementation 2 to create the syntax tree of the result document. After that you can manipulate it and have to traverse it to generate the input stream for the 2nd instance of the GXLConnector. The 2nd instance then uses the default implementation 1 and the GXLOutputAPI to write the resulting file.
So this variant is nearly similar to the GXL2<...> conversion with manipulation of the syntax tree. You can use the demo file2 to get an idea of how to intialize the GCF and traverse the syntax tree.
If you have a source format that is no XML vocabulary, you cannot use the integrated XML parser. So you have to provide an appropriate parser.
Figure 3 shows how the GCF works if you want to create a converter from any non XML format to GXL without manipulating the syntax tree of the target document.

Figure 3 : Conversion a non XML based exchange format to GXL without manipulating the syntax tree of the drain document
Here you can see that the only difference is that you have to provide a parser for the source format. Having done this, the GCF works as shown in figure 1.
If you now want to manipulate the syntax tree of the target document before you write it to a file, you have to use the GCF in the way shown in figure 2. The only difference is again that you have to provide an appropriate parser for the source fomat.