Several days ago I passed the first milestone in the generative XML work (conversion from XML to SXML). Reverse conversion looks simplier, but I just was not able to start working on this task.
It's the well-known problem for me. After finishing a product (in this case, passing the milestone), I have a period of unproductivity. Sometimes it's very long. The only solution is to make the first step, and finally I've done it.
Back to programming.
The function "node_to_scm" does two things:
* validates input parameters (alerts and returns if they are NULLs),
* and reports that the input node type is unsupported.
In the next days I'll add code into the middle, after the first thing and before the second thing.
For the Scheme side, I've created the function "x:current-node" which returns the current node of the XSLT context. This function will work as soon as "node_to_scm/tt>" works.
While creating "x:current-node", I also tempered to create "x:current-nodelist". But I didn't find a corresponding item in xsltproc's C code. But it should be, as I don't believe that XSLT XPath function "position()" is being dynamically calculated. Will see later.
Here is another issue. In "apply-templates", I used the following "select":
For some reason, the output file contains this string literally. I'll investigate if it's a bug of xsltproc or my mind.