Re: [xml] save the tree into a dat file



On Tue, 2004-04-06 at 19:01, è?? å­?è¶? wrote:
Hi, 

Can libxml2 parse a XML file into a simple HTML file( without the border, 
color,etc.; just tags and contents)? If so, please give me some pointers 
and possible functions to use.

And how do you save the data in a tree into a dat file using libxml2? What 
functions should I be using? I heard about xmlElemDump(), what does it do? 
I read the spec and didn't understand it. Any other functions?

I want to do this:
1. read an XML document into memory,
2. parse XML data into a tree using libxml2,
3. save elements, contents, atrributes into a dat file, so I can use in 
BREW to render.


I've no idea what "dat files" or "BREW" are, but transforming xml->html
is relatively simple using xslt. You simply need to define the
equivalence - which tags in your originating xml map to which html tags.

If you simply need to transform the file, xsltproc, a command line
utility provided by libxslt, can do the transformation. You would need
to write the xsl file that defines the mapping. If you're writing an
application that needs to read in the xml file and do the transformation
within your application code, libxslt provides the necessary functions.
Details here:

http://xmlsoft.org/XSLT/

Cheers,
John




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