  
    
    
    
    
    
    
    
  
  
    
      
        
          
libxml2-chvalid.html            
Prev          
        
        
          
general.html            
Up          
        
        
          
index.html            
Home          
        
        
          
libxml2-dict.html            
Next          
        
        
libxml2 Reference Manual      
    
    
      
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 #xmlShellCtxtxmlShellCtxt ;
typedef 
libxml2-debugXML.html#xmlShellCtxtxmlShellCtxt  * #xmlShellCtxtPtrxmlShellCtxtPtr ;
void	
#xmlDebugDumpAttrListxmlDebugDumpAttrList 		(FILE * output, 					 libxml2-tree.html#xmlAttrPtrxmlAttrPtr  attr, 					 int depth);
void	
#xmlLsOneNodexmlLsOneNode 			(FILE * output, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node);
typedef char * 
#xmlShellReadlineFuncxmlShellReadlineFunc 		(char * prompt);
int	
#xmlShellSavexmlShellSave 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
const char *	
#xmlBoolToTextxmlBoolToText 		(int boolval);
int	
#xmlShellWritexmlShellWrite 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
int	
#xmlShellDuxmlShellDu 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  tree, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
int	
#xmlShellValidatexmlShellValidate 		( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * dtd, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
int	
#xmlDebugCheckDocumentxmlDebugCheckDocument 		(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc);
void	
#xmlShellPrintXPathResultxmlShellPrintXPathResult 	( libxml2-xpath.html#xmlXPathObjectPtrxmlXPathObjectPtr  list);
typedef int 
#xmlShellCmdxmlShellCmd 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
int	
#xmlShellLoadxmlShellLoad 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
void	
#xmlDebugDumpStringxmlDebugDumpString 		(FILE * output, 					 const libxml2-xmlstring.html#xmlCharxmlChar  * str);
int	
#xmlShellBasexmlShellBase 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
int	
#xmlShellCatxmlShellCat 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
void	
#xmlDebugDumpDTDxmlDebugDumpDTD 			(FILE * output, 					 libxml2-tree.html#xmlDtdPtrxmlDtdPtr  dtd);
void	
#xmlDebugDumpNodexmlDebugDumpNode 		(FILE * output, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 int depth);
void	
#xmlDebugDumpEntitiesxmlDebugDumpEntities 		(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc);
void	
#xmlShellPrintNodexmlShellPrintNode 		( libxml2-tree.html#xmlNodePtrxmlNodePtr  node);
int	
#xmlShellPwdxmlShellPwd 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * buffer, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
void	
#xmlDebugDumpNodeListxmlDebugDumpNodeList 		(FILE * output, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 int depth);
void	
#xmlDebugDumpAttrxmlDebugDumpAttr 		(FILE * output, 					 libxml2-tree.html#xmlAttrPtrxmlAttrPtr  attr, 					 int depth);
void	
#xmlDebugDumpDocumentxmlDebugDumpDocument 		(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc);
int	
#xmlLsCountNodexmlLsCountNode 			( libxml2-tree.html#xmlNodePtrxmlNodePtr  node);
void	
#xmlShellPrintXPathErrorxmlShellPrintXPathError 		(int errorType, 					 const char * arg);
int	
#xmlShellDirxmlShellDir 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
void	
#xmlDebugDumpOneNodexmlDebugDumpOneNode 		(FILE * output, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 int depth);
int	
#xmlShellListxmlShellList 			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2);
void	
#xmlDebugDumpDocumentHeadxmlDebugDumpDocumentHead 	(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc);
void	
#xmlShellxmlShell 			( libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 char * filename, 					 libxml2-debugXML.html#xmlShellReadlineFuncxmlShellReadlineFunc  input, 					 FILE * output);
    
    
      
Description
    
    
      
Details
      
        
Structure xmlShellCtxt
struct _xmlShellCtxt {
    char *	filename
    
libxml2-tree.html#xmlDocPtrxmlDocPtr 	doc
    
libxml2-tree.html#xmlNodePtrxmlNodePtr 	node
    
libxml2-xpath.html#xmlXPathContextPtrxmlXPathContextPtr 	pctxt
    int	loaded
    FILE *	output
    
libxml2-debugXML.html#xmlShellReadlineFuncxmlShellReadlineFunc 	input
} xmlShellCtxt;
        
        
Typedef xmlShellCtxtPtr
libxml2-debugXML.html#xmlShellCtxtxmlShellCtxt  * xmlShellCtxtPtr;
        
        
Function type xmlShellCmd
int	xmlShellCmd			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  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, 					 libxml2-tree.html#xmlAttrPtrxmlAttrPtr  attr, 					 int depth)Dumps debug information for the libxml2-SAX.html#attributeattribute 
output: the FILE * for the output attr: the libxml2-SAX.html#attributeattribute depth: the indentation level.         
        
xmlDebugDumpAttrList ()
void	xmlDebugDumpAttrList		(FILE * output, 					 libxml2-tree.html#xmlAttrPtrxmlAttrPtr  attr, 					 int depth)Dumps debug information for the libxml2-SAX.html#attributeattribute  list
output: the FILE * for the output attr: the libxml2-SAX.html#attributeattribute  list depth: the indentation level.         
        
xmlDebugDumpDTD ()
void	xmlDebugDumpDTD			(FILE * output, 					 libxml2-tree.html#xmlDtdPtrxmlDtdPtr  dtd)Dumps debug information for the DTD
output: the FILE * for the output dtd: the DTD         
        
xmlDebugDumpDocument ()
void	xmlDebugDumpDocument		(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc)Dumps debug information for the document, it's recursive
output: the FILE * for the output doc: the document         
        
xmlDebugDumpDocumentHead ()
void	xmlDebugDumpDocumentHead	(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  doc)Dumps debug information cncerning the document, not recursive
output: the FILE * for the output doc: the document         
        
xmlDebugDumpEntities ()
void	xmlDebugDumpEntities		(FILE * output, 					 libxml2-tree.html#xmlDocPtrxmlDocPtr  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, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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 libxml2-xmlstring.html#xmlCharxmlChar  * str)Dumps informations about the string, shorten it if necessary
output: the FILE * for the output str: the string         
        
xmlLsCountNode ()
int	xmlLsCountNode			( libxml2-tree.html#xmlNodePtrxmlNodePtr  node)Count the children of @node.
node: the node to count Returns: the number of children of @node.         
        
xmlLsOneNode ()
void	xmlLsOneNode			(FILE * output, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node)Dump to @output the type and name of @node.
output: the FILE * for the output node: the node to dump         
        
xmlShell ()
void	xmlShell			( libxml2-tree.html#xmlDocPtrxmlDocPtr  doc, 					 char * filename, 					 libxml2-debugXML.html#xmlShellReadlineFuncxmlShellReadlineFunc  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2)Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).
ctxt: the shell context arg: unused node: a node node2: unused Returns: 0         
        
xmlShellDu ()
int	xmlShellDu			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  tree, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * arg, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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		( libxml2-tree.html#xmlNodePtrxmlNodePtr  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	( libxml2-xpath.html#xmlXPathObjectPtrxmlXPathObjectPtr  list)Prints result to the output FILE
list: a valid result generated by an xpath evaluation         
        
xmlShellPwd ()
int	xmlShellPwd			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * buffer, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  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		( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * dtd, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2)Implements the XML shell function "validate" Validate the document, if a DTD path is provided, then the validation is done against the given DTD.
ctxt: the shell context dtd: the DTD URI (optional) node: unused node2: unused Returns: 0 or -1 in case of error         
        
xmlShellWrite ()
int	xmlShellWrite			( libxml2-debugXML.html#xmlShellCtxtPtrxmlShellCtxtPtr  ctxt, 					 char * filename, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node, 					 libxml2-tree.html#xmlNodePtrxmlNodePtr  node2)Implements the XML shell function "write" Write the current node to the filename, it saves the serialization of the subtree under the @node specified
ctxt: the shell context filename: the file name node: a node in the tree node2: unused Returns: 0 or -1 in case of error         
      
    
  
