[xslt] XSLT-problems

Hi everbody,

I have the following problems with libxml2-2.3.6 and libxslt-0.7.0:

I create a DOM-tree with the functions xmlNewChild and xmlSetProp. Then
render the DOM-tree with xmlDocDumpMemory into a Buffer and write it to
a file. In the last step I use xsltproc and tranlate the XML document
into a text (SQL). This solution works, but I don't like it, because
it would be much better to avoid the XML file and just use
to produce a result DOM-tree and render it with xmlDocDumpMemory. 

The second, not correctly working solution has several problems:

1.) The XPath function id(...) does not work, so I have to use the much
slower expression //*[ id=   ]

This seems to be an XML, not XSLT problem.
I assume, that the DTD is only used in the first, working case, where
XML file is read by xsltproc and not in the second case, where the tree
is constructed an then processed.

2.) Although I have a 
method="text" and omit-xml-declaration="yes" 
in my xsl:output, the generated file starts with 
<?xml version="1.0" encoding="iso-8859-1"?>
which I don't want in my SQL output

3.) The expressions &lt; and &gt; are not translated to < and >.

The function xsltSaveResultToFilename, that is used by xsltproc
seems to solve the problems 2 and 3, but it writes the output to
a file and not into a buffer.

Can someone please give me some help to solve my problems?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]