Re: [xml] Bug or expected behaviour with xmlNewChild



On 06/08/13 01:34, Daniel Veillard wrote:
On Mon, Aug 05, 2013 at 09:08:39PM +0100, Neil Barnes wrote:
On 05/08/13 04:26, Daniel Veillard wrote:
On Wed, Jul 31, 2013 at 08:32:01PM +0100, Neil Barnes wrote:
This one is really confusing me... I'm the first to admit I'm not at
all sure what I'm doing, but:

I'm trying to create an xhtml file as part of an epub. (I've already
successfully exported an html and imported an xml file into the
program, and I'm getting no error messages.)

My google-fu is weak on this one; I can find nothing relevant in
either the archive or generally on the net.

What I want:

<head>

<title>Unknown</title>

<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />

<link href="../Styles/page_styles.css" rel="stylesheet" type="text/css" />

</head>

   ouch ...

and I cannot find a way to make the link elements terminate.


Code:
doc = htmlNewDoc (NULL, NULL);
   No.
http://www.w3.org/TR/xhtml1/#strict

First XHTML is *XML* , so xmlNewDoc() must be called.
Thank you, Daniel.

I found your example - (a) I failed to use xmlNewDoc() and (b) I
used htmlSaveFile() instead of xmlSaveFormatFileEnc() - as well as
the other errors you point out!

Sorted now.

Thanks again.
[re-adding the mailing-list]

   okay :-)
Actually if you want to help, could you turn your final test program
generating xhtml into something running standalone, then we could add
it to http://xmlsoft.org/examples/index.html
to help future people looking at doing the same kind of code.

There are many parts of the library where we don't have examples,
if we were to extend the set of examples, that would be a great,

Daniel

I'll look into that, Daniel.

At the moment, it's a bit intertwined with a pile of ugly gtk+ code that drags out formatting info from my text processing. I'll see what I can unwind - it's not a long routine. It's now similar to your 'tree2.c' example, which provided the core of it.

There will probably be one or two errors remaining (or at least, not best practice) which you can put down to my lack of knowledge of the format. Naturally, *both* my O'Reilly 'XML' books are currently hiding from me...

Neil



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