Re: [xml] DTD Mania



Apologies if this is a repeat.  I've been having problems with my mail
server, I sent this before, and never got it back.  

On Wed, May 09, 2001 at 06:06:40PM -0400, Daniel Veillard wrote:
On Wed, May 09, 2001 at 05:40:29PM -0400, David Allen wrote:
- Say I'm dealing with "baz.xml" and "foobar.dtd".  I encounter the
  "blargens" tag, how can I look into the DTD structure to get a list
  of tags which are valid children of "blargens"?  I'm not looking at
  rewriting the validation, but getting a list of what's valid in
  certain contexts for creating XML documents from nothing according
  to the rules of validity.

   This is defined in the valid.c module:
     http://xmlsoft.org/html/libxml-valid.html#XMLVALIDGETVALIDELEMENTS
     xmlValidGetValidElements ()

This doesn't seem like it's going to work.  The documentation says to
use xmlValidGetValidElements(NULL, node->childs, ...) in order to
prepend an element underneath 'node', and to use
xmlValidGetValidElements(node->last, NULL, ...) to append an element
underneath 'node'.

The problem is that if node has no children, then both node->childs
and node->last will be NULL, right?  If the first two args to the
function are NULL, then it always returns -1 (error).

Am I missing something or does this function work only in the case
where you already have child elements?

-- 
David Allen
http://opop.nols.com/
----------------------------------------
A computer, to print out a fact, 
Will divide, multiply, and subtract. 
But this output can be 
No more than debris, 
If the input was short of exact. 
- Gigo 




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