\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// debugXML: Tree debugging APIs

debugXML

debugXML - Tree debugging APIs

Interfaces to a set of routines used for debugging the tree produced by the XML parser.

Author(s): Daniel Veillard

Synopsis

typedef struct _xmlShellCtxt xmlShellCtxt;
typedef xmlShellCtxt * xmlShellCtxtPtr;
const char *	xmlBoolToText		(int boolval);
int	xmlDebugCheckDocument		(FILE * output, 
xmlDocPtr doc); void xmlDebugDumpAttr (FILE * output,
xmlAttrPtr attr,
int depth); void xmlDebugDumpAttrList (FILE * output,
xmlAttrPtr attr,
int depth); void xmlDebugDumpDTD (FILE * output,
xmlDtdPtr dtd); void xmlDebugDumpDocument (FILE * output,
xmlDocPtr doc); void xmlDebugDumpDocumentHead (FILE * output,
xmlDocPtr doc); void xmlDebugDumpEntities (FILE * output,
xmlDocPtr doc); void xmlDebugDumpNode (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpNodeList (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpOneNode (FILE * output,
xmlNodePtr node,
int depth); void xmlDebugDumpString (FILE * output,
const xmlChar * str); int xmlLsCountNode (xmlNodePtr node); void xmlLsOneNode (FILE * output,
xmlNodePtr node); void xmlShell (xmlDocPtr doc,
char * filename,
xmlShellReadlineFunc input,
FILE * output); int xmlShellBase (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellCat (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); typedef int xmlShellCmd (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellDir (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellDu (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr tree,
xmlNodePtr node2); int xmlShellList (xmlShellCtxtPtr ctxt,
char * arg,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellLoad (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2); void xmlShellPrintNode (xmlNodePtr node); void xmlShellPrintXPathError (int errorType,
const char * arg); void xmlShellPrintXPathResult (xmlXPathObjectPtr list); int xmlShellPwd (xmlShellCtxtPtr ctxt,
char * buffer,
xmlNodePtr node,
xmlNodePtr node2); typedef char * xmlShellReadlineFunc (char * prompt); int xmlShellSave (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellValidate (xmlShellCtxtPtr ctxt,
char * dtd,
xmlNodePtr node,
xmlNodePtr node2); int xmlShellWrite (xmlShellCtxtPtr ctxt,
char * filename,
xmlNodePtr node,
xmlNodePtr node2);

Description

Details

Structure xmlShellCtxt

struct _xmlShellCtxt {
    char *	filename
    xmlDocPtr	doc
    xmlNodePtr	node
    xmlXPathContextPtr	pctxt
    int	loaded
    FILE *	output
    xmlShellReadlineFunc	input
} xmlShellCtxt;


Typedef xmlShellCtxtPtr

xmlShellCtxt * xmlShellCtxtPtr;


Function type xmlShellCmd

int	xmlShellCmd			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr node,
xmlNodePtr node2)

This is a generic signature for the XML shell functions.

ctxt: a shell context
arg: a string argument
node: a first node
node2: a second node
Returns: an int, negative returns indicating errors.

Function type xmlShellReadlineFunc

char *	xmlShellReadlineFunc		(char * prompt)

This is a generic signature for the XML shell input function.

prompt: a string prompt
Returns: a string which will be freed by the Shell.

xmlBoolToText ()

const char *	xmlBoolToText		(int boolval)

Convenient way to turn bool into text

boolval: a bool to turn into text
Returns: a pointer to either "True" or "False"

xmlDebugCheckDocument ()

int	xmlDebugCheckDocument		(FILE * output, 
xmlDocPtr doc)

Check the document for potential content problems, and output the errors to @output

output: the FILE * for the output
doc: the document
Returns: the number of errors found

xmlDebugDumpAttr ()

void	xmlDebugDumpAttr		(FILE * output, 
xmlAttrPtr attr,
int depth)

Dumps debug information for the attribute

output: the FILE * for the output
attr: the attribute
depth: the indentation level.

xmlDebugDumpAttrList ()

void	xmlDebugDumpAttrList		(FILE * output, 
xmlAttrPtr attr,
int depth)

Dumps debug information for the attribute list

output: the FILE * for the output
attr: the attribute list
depth: the indentation level.

xmlDebugDumpDTD ()

void	xmlDebugDumpDTD			(FILE * output, 
xmlDtdPtr dtd)

Dumps debug information for the DTD

output: the FILE * for the output
dtd: the DTD

xmlDebugDumpDocument ()

void	xmlDebugDumpDocument		(FILE * output, 
xmlDocPtr doc)

Dumps debug information for the document, it's recursive

output: the FILE * for the output
doc: the document

xmlDebugDumpDocumentHead ()

void	xmlDebugDumpDocumentHead	(FILE * output, 
xmlDocPtr doc)

Dumps debug information concerning the document, not recursive

output: the FILE * for the output
doc: the document

xmlDebugDumpEntities ()

void	xmlDebugDumpEntities		(FILE * output, 
xmlDocPtr doc)

Dumps debug information for all the entities in use by the document

output: the FILE * for the output
doc: the document

xmlDebugDumpNode ()

void	xmlDebugDumpNode		(FILE * output, 
xmlNodePtr node,
int depth)

Dumps debug information for the element node, it is recursive

output: the FILE * for the output
node: the node
depth: the indentation level.

xmlDebugDumpNodeList ()

void	xmlDebugDumpNodeList		(FILE * output, 
xmlNodePtr node,
int depth)

Dumps debug information for the list of element node, it is recursive

output: the FILE * for the output
node: the node list
depth: the indentation level.

xmlDebugDumpOneNode ()

void	xmlDebugDumpOneNode		(FILE * output, 
xmlNodePtr node,
int depth)

Dumps debug information for the element node, it is not recursive

output: the FILE * for the output
node: the node
depth: the indentation level.

xmlDebugDumpString ()

void	xmlDebugDumpString		(FILE * output, 
const xmlChar * str)

Dumps information about the string, shorten it if necessary

output: the FILE * for the output
str: the string

xmlLsCountNode ()

int	xmlLsCountNode			(xmlNodePtr node)

Count the children of @node.

node: the node to count
Returns: the number of children of @node.

xmlLsOneNode ()

void	xmlLsOneNode			(FILE * output, 
xmlNodePtr node)

Dump to @output the type and name of @node.

output: the FILE * for the output
node: the node to dump

xmlShell ()

void	xmlShell			(xmlDocPtr doc, 
char * filename,
xmlShellReadlineFunc input,
FILE * output)

Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.

doc: the initial document
filename: the output buffer
input: the line reading function
output: the output FILE*, defaults to stdout if NULL

xmlShellBase ()

int	xmlShellBase			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "base" dumps the current XML base of the node

ctxt: the shell context
arg: unused
node: a node
node2: unused
Returns: 0

xmlShellCat ()

int	xmlShellCat			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "cat" dumps the serialization node content (XML or HTML).

ctxt: the shell context
arg: unused
node: a node
node2: unused
Returns: 0

xmlShellDir ()

int	xmlShellDir			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).

ctxt: the shell context
arg: unused
node: a node
node2: unused
Returns: 0

xmlShellDu ()

int	xmlShellDu			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr tree,
xmlNodePtr node2)

Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.

ctxt: the shell context
arg: unused
tree: a node defining a subtree
node2: unused
Returns: 0 or -1 in case of error

xmlShellList ()

int	xmlShellList			(xmlShellCtxtPtr ctxt, 
char * arg,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "ls" Does an Unix like listing of the given node (like a directory)

ctxt: the shell context
arg: unused
node: a node
node2: unused
Returns: 0

xmlShellLoad ()

int	xmlShellLoad			(xmlShellCtxtPtr ctxt, 
char * filename,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "load" loads a new document specified by the filename

ctxt: the shell context
filename: the file name
node: unused
node2: unused
Returns: 0 or -1 if loading failed

xmlShellPrintNode ()

void	xmlShellPrintNode		(xmlNodePtr node)

Print node to the output FILE

node: a non-null node to print to the output FILE

xmlShellPrintXPathError ()

void	xmlShellPrintXPathError		(int errorType, 
const char * arg)

Print the xpath error to libxml default error channel

errorType: valid xpath error id
arg: the argument that cause xpath to fail

xmlShellPrintXPathResult ()

void	xmlShellPrintXPathResult	(xmlXPathObjectPtr list)

Prints result to the output FILE

list: a valid result generated by an xpath evaluation

xmlShellPwd ()

int	xmlShellPwd			(xmlShellCtxtPtr ctxt, 
char * buffer,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "pwd" Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.

ctxt: the shell context
buffer: the output buffer
node: a node
node2: unused
Returns: 0 or -1 in case of error

xmlShellSave ()

int	xmlShellSave			(xmlShellCtxtPtr ctxt, 
char * filename,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "save" Write the current document to the filename, or it's original name

ctxt: the shell context
filename: the file name (optional)
node: unused
node2: unused
Returns: 0 or -1 in case of error

xmlShellValidate ()

int	xmlShellValidate		(xmlShellCtxtPtr ctxt, 
char * dtd,
xmlNodePtr node,
xmlNodePtr node2)

Implements the XML shell function "validate" Validate the document, if a DTD path is provided, then the validation is done again