text
stringlengths
81
112k
Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically. def isID(self, doc, attr): """Determine whether an attrib...
Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase). def isRef(self, doc, attr): """Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, other...
Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequen...
Implement the XInclude substitution for the given subtree def xincludeProcessTreeFlags(self, flags): """Implement the XInclude substitution for the given subtree """ ret = libxml2mod.xmlXIncludeProcessTreeFlags(self._o, flags) return ret
Validate a branch of a tree, starting with the given @elem. def schemaValidateOneElement(self, ctxt): """Validate a branch of a tree, starting with the given @elem. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlSchemaValidateOneElement(ctxt__o, self._o)...
Compare two nodes w.r.t document order def xpathCmpNodes(self, node2): """Compare two nodes w.r.t document order """ if node2 is None: node2__o = None else: node2__o = node2._o ret = libxml2mod.xmlXPathCmpNodes(self._o, node2__o) return ret
Evaluate the XPath Location Path in the given context. The node 'node' is set as the context node. The context node is not restored. def xpathNodeEval(self, str, ctx): """Evaluate the XPath Location Path in the given context. The node 'node' is set as the context node. The contex...
Create a new xmlXPathObjectPtr of type NodeSet and initialize it with the single Node @val def xpathNewNodeSet(self): """Create a new xmlXPathObjectPtr of type NodeSet and initialize it with the single Node @val """ ret = libxml2mod.xmlXPathNewNodeSet(self._o) if ret is No...
Create a new xmlXPathObjectPtr of type Value Tree (XSLT) and initialize it with the tree root @val def xpathNewValueTree(self): """Create a new xmlXPathObjectPtr of type Value Tree (XSLT) and initialize it with the tree root @val """ ret = libxml2mod.xmlXPathNewValueTree(self._o) ...
Traversal function for the "ancestor" direction the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; the nodes are ordered in reverse document order; thus the paren...
Traversal function for the "ancestor-or-self" direction he ancestor-or-self axis contains the context node and ancestors of the context node in reverse document order; thus the context node is the first node on the axis, and the context node's parent the second; parent here is ...
Traversal function for the "attribute" direction TODO: support DTD inherited default attributes def xpathNextAttribute(self, ctxt): """Traversal function for the "attribute" direction TODO: support DTD inherited default attributes """ if ctxt is None: ctxt__o = None else: ...
Traversal function for the "child" direction The child axis contains the children of the context node in document order. def xpathNextChild(self, ctxt): """Traversal function for the "child" direction The child axis contains the children of the context node in document order. """ if...
Traversal function for the "descendant" direction the descendant axis contains the descendants of the context node in document order; a descendant is a child or a child of a child and so on. def xpathNextDescendant(self, ctxt): """Traversal function for the "descendant" direction...
Traversal function for the "descendant-or-self" direction the descendant-or-self axis contains the context node and the descendants of the context node in document order; thus the context node is the first node on the axis, and the first child of the context node is the second no...
Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered ...
Traversal function for the "following-sibling" direction The following-sibling axis contains the following siblings of the context node in document order. def xpathNextFollowingSibling(self, ctxt): """Traversal function for the "following-sibling" direction The following-sibling ...
Traversal function for the "namespace" direction the namespace axis contains the namespace nodes of the context node; the order of nodes on this axis is implementation-defined; the axis will be empty unless the context node is an element We keep the XML namespace node ...
Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is one. def xpathNextParent(self, ctxt): """Traversal function for the "parent" direction The parent axis contains the parent of the context node, if there is ...
Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered ...
Traversal function for the "preceding-sibling" direction The preceding-sibling axis contains the preceding siblings of the context node in reverse document order; the first preceding sibling is first on the axis; the sibling preceding that node is the second on the axis and so o...
Traversal function for the "self" direction The self axis contains just the context node itself def xpathNextSelf(self, ctxt): """Traversal function for the "self" direction The self axis contains just the context node itself """ if ctxt is None: ctxt__o = None else: ctxt_...
Create a new xmlXPathObjectPtr of type range using a single nodes def xpointerNewCollapsedRange(self): """Create a new xmlXPathObjectPtr of type range using a single nodes """ ret = libxml2mod.xmlXPtrNewCollapsedRange(self._o) if ret is None:raise treeError('xmlXPtrNewColl...
Create a new XPointer context def xpointerNewContext(self, doc, origin): """Create a new XPointer context """ if doc is None: doc__o = None else: doc__o = doc._o if origin is None: origin__o = None else: origin__o = origin._o ret = libxml2mod.xmlXPtrNewContext(doc__o, se...
Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes @start and @end def xpointerNewLocationSetNodes(self, end): """Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the t...
Create a new xmlXPathObjectPtr of type range def xpointerNewRange(self, startindex, end, endindex): """Create a new xmlXPathObjectPtr of type range """ if end is None: end__o = None else: end__o = end._o ret = libxml2mod.xmlXPtrNewRange(self._o, startindex, end__o, endindex) if ...
Create a new xmlXPathObjectPtr of type range using 2 nodes def xpointerNewRangeNodes(self, end): """Create a new xmlXPathObjectPtr of type range using 2 nodes """ if end is None: end__o = None else: end__o = end._o ret = libxml2mod.xmlXPtrNewRangeNodes(self._o, end__o) if ret is...
The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it's children would autoclose the given tag. def htmlAutoCloseTag(self, name, elem): """The HTML DTD allows a tag to implicitly close ...
The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it's child def htmlIsAutoClosed(self, elem): """The HTML DTD allows a tag to implicitly close other tags. The list is kept in ...
Dump an HTML document. def htmlDocContentDumpFormatOutput(self, buf, encoding, format): """Dump an HTML document. """ if buf is None: buf__o = None else: buf__o = buf._o libxml2mod.htmlDocContentDumpFormatOutput(buf__o, self._o, encoding, format)
Dump an HTML document. Formating return/spaces are added. def htmlDocContentDumpOutput(self, buf, encoding): """Dump an HTML document. Formating return/spaces are added. """ if buf is None: buf__o = None else: buf__o = buf._o libxml2mod.htmlDocContentDumpOutput(buf__o, self._o, encoding...
Dump an HTML document to an open FILE. def htmlDocDump(self, f): """Dump an HTML document to an open FILE. """ ret = libxml2mod.htmlDocDump(f, self._o) return ret
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added. def htmlNodeDumpFile(self, out, cur): """Dump an HTML node, recursive behaviour,children are printed too, and formatting returns are added. """ if cur is None: cur__o = None ...
Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == None try to save in the doc encoding def htmlNodeDumpFileFormat(self, out, cur, encoding, format): """Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == None...
Dump an HTML node, recursive behaviour,children are printed too. def htmlNodeDumpFormatOutput(self, buf, cur, encoding, format): """Dump an HTML node, recursive behaviour,children are printed too. """ if buf is None: buf__o = None else: buf__o = buf._o if cur is No...
Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added. def htmlNodeDumpOutput(self, buf, cur, encoding): """Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added. """ if buf is No...
Dump an HTML document to a file. If @filename is "-" the stdout file is used. def htmlSaveFile(self, filename): """Dump an HTML document to a file. If @filename is "-" the stdout file is used. """ ret = libxml2mod.htmlSaveFile(filename, self._o) return ret
Dump an HTML document to a file using a given encoding and formatting returns/spaces are added. def htmlSaveFileEnc(self, filename, encoding): """Dump an HTML document to a file using a given encoding and formatting returns/spaces are added. """ ret = libxml2mod.htmlSaveFileEnc(fi...
Dump an HTML document to a file using a given encoding. def htmlSaveFileFormat(self, filename, encoding, format): """Dump an HTML document to a file using a given encoding. """ ret = libxml2mod.htmlSaveFileFormat(filename, self._o, encoding, format) return ret
Sets the current encoding in the Meta tags NOTE: this will not change the document content encoding, just the META flag associated. def htmlSetMetaEncoding(self, encoding): """Sets the current encoding in the Meta tags NOTE: this will not change the document content encoding, jus...
Check the document for potential content problems, and output the errors to @output def debugCheckDocument(self, output): """Check the document for potential content problems, and output the errors to @output """ ret = libxml2mod.xmlDebugCheckDocument(output, self._o) retu...
Register a new entity for this document. def addDocEntity(self, name, type, ExternalID, SystemID, content): """Register a new entity for this document. """ ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content) if ret is None:raise treeError('xmlAddDocEntity() fail...
Register a new entity for this document DTD external subset. def addDtdEntity(self, name, type, ExternalID, SystemID, content): """Register a new entity for this document DTD external subset. """ ret = libxml2mod.xmlAddDtdEntity(self._o, name, type, ExternalID, SystemID, content) if ret is None...
Do an entity lookup in the document entity hash table and def docEntity(self, name): """Do an entity lookup in the document entity hash table and """ ret = libxml2mod.xmlGetDocEntity(self._o, name) if ret is None:raise treeError('xmlGetDocEntity() failed') __tmp = xmlEntity(_obj=ret) ...
Do an entity lookup in the DTD entity hash table and def dtdEntity(self, name): """Do an entity lookup in the DTD entity hash table and """ ret = libxml2mod.xmlGetDtdEntity(self._o, name) if ret is None:raise treeError('xmlGetDtdEntity() failed') __tmp = xmlEntity(_obj=ret) retu...
TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered. def encodeEntities(self, input): """TODO: remove xmlEncodeEntities, once we ...
Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated. def encodeEntitiesReentrant(self, input): """Do a globa...
Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated. def encodeSpecialChars(self, input): """Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be...
Create a new entity, this differs from xmlAddDocEntity() that if the document is None or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed ...
Do an entity lookup in the internal and external subsets and def parameterEntity(self, name): """Do an entity lookup in the internal and external subsets and """ ret = libxml2mod.xmlGetParameterEntity(self._o, name) if ret is None:raise treeError('xmlGetParameterEntity() failed') __tmp ...
Create an XML RelaxNGs parser context for that document. Note: since the process of compiling a RelaxNG schemas modifies the document, the @doc parameter is duplicated internally. def relaxNGNewDocParserCtxt(self): """Create an XML RelaxNGs parser context for that document. ...
Validate a document tree in memory. def relaxNGValidateDoc(self, ctxt): """Validate a document tree in memory. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o ret = libxml2mod.xmlRelaxNGValidateDoc(ctxt__o, self._o) return ret
Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded. def relaxNGValidateFullElement(self, ctxt, elem): """Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the no...
Pop the element end from the RelaxNG validation stack. def relaxNGValidatePopElement(self, ctxt, elem): """Pop the element end from the RelaxNG validation stack. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o if elem is None: elem__o = None else: elem__o = elem._o ...
Push a new element start on the RelaxNG validation stack. def relaxNGValidatePushElement(self, ctxt, elem): """Push a new element start on the RelaxNG validation stack. """ if ctxt is None: ctxt__o = None else: ctxt__o = ctxt._o if elem is None: elem__o = None else: elem__o = el...
Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and entities. def copyDoc(self, recursive): """Do a copy of the document info. If recursive, the content tree will be copied too as well as DTD, namespaces and ...
Do a copy of the node to a given document. def copyNode(self, node, extended): """Do a copy of the node to a given document. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlDocCopyNode(node__o, self._o, extended) if ret is None:raise treeError('xm...
Do a recursive copy of the node list. def copyNodeList(self, node): """Do a recursive copy of the node list. """ if node is None: node__o = None else: node__o = node._o ret = libxml2mod.xmlDocCopyNodeList(self._o, node__o) if ret is None:raise treeError('xmlDocCopyNodeList() fai...
Create the internal subset of a document def createIntSubset(self, name, ExternalID, SystemID): """Create the internal subset of a document """ ret = libxml2mod.xmlCreateIntSubset(self._o, name, ExternalID, SystemID) if ret is None:raise treeError('xmlCreateIntSubset() failed') __tmp = ...
Dump an XML document to an open FILE. def dump(self, f): """Dump an XML document to an open FILE. """ ret = libxml2mod.xmlDocDump(f, self._o) return ret
Dump an XML/HTML node, recursive behaviour, children are printed too. def elemDump(self, f, cur): """Dump an XML/HTML node, recursive behaviour, children are printed too. """ if cur is None: cur__o = None else: cur__o = cur._o libxml2mod.xmlElemDump(f, self._o, cur...
Dump an XML document to an open FILE. def formatDump(self, f, format): """Dump an XML document to an open FILE. """ ret = libxml2mod.xmlDocFormatDump(f, self._o, format) return ret
Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). def getRootElement(self): """Get the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). """ ret = libxml2mod.xmlDocGetRootElem...
Get the internal subset of a document def intSubset(self): """Get the internal subset of a document """ ret = libxml2mod.xmlGetIntSubset(self._o) if ret is None:raise treeError('xmlGetIntSubset() failed') __tmp = xmlDtd(_obj=ret) return __tmp
Creation of a new node containing a CDATA block. def newCDataBlock(self, content, len): """Creation of a new node containing a CDATA block. """ ret = libxml2mod.xmlNewCDataBlock(self._o, content, len) if ret is None:raise treeError('xmlNewCDataBlock() failed') __tmp = xmlNode(_obj=ret) ...
Creation of a new character reference node. def newCharRef(self, name): """Creation of a new character reference node. """ ret = libxml2mod.xmlNewCharRef(self._o, name) if ret is None:raise treeError('xmlNewCharRef() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new node containing a comment within a document. def newDocComment(self, content): """Creation of a new node containing a comment within a document. """ ret = libxml2mod.xmlNewDocComment(self._o, content) if ret is None:raise treeError('xmlNewDocComment() fai...
Creation of a new Fragment node. def newDocFragment(self): """Creation of a new Fragment node. """ ret = libxml2mod.xmlNewDocFragment(self._o) if ret is None:raise treeError('xmlNewDocFragment() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNo...
Creation of a new node element within a document. @ns and @content are optional (None). NOTE: @content is supposed to be a piece of XML CDATA, so it allow entities references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewDocRawNo...
Creation of a processing instruction element. def newDocPI(self, name, content): """Creation of a processing instruction element. """ ret = libxml2mod.xmlNewDocPI(self._o, name, content) if ret is None:raise treeError('xmlNewDocPI() failed') __tmp = xmlNode(_obj=ret) return __tm...
Create a new property carried by a document. def newDocProp(self, name, value): """Create a new property carried by a document. """ ret = libxml2mod.xmlNewDocProp(self._o, name, value) if ret is None:raise treeError('xmlNewDocProp() failed') __tmp = xmlAttr(_obj=ret) return __tm...
Creation of a new node element within a document. @ns and @content are optional (None). def newDocRawNode(self, ns, name, content): """Creation of a new node element within a document. @ns and @content are optional (None). """ if ns is None: ns__o = None else: ns__o = ns._...
Creation of a new text node within a document. def newDocText(self, content): """Creation of a new text node within a document. """ ret = libxml2mod.xmlNewDocText(self._o, content) if ret is None:raise treeError('xmlNewDocText() failed') __tmp = xmlNode(_obj=ret) return __tmp
Creation of a new text node with an extra content length parameter. The text node pertain to a given document. def newDocTextLen(self, content, len): """Creation of a new text node with an extra content length parameter. The text node pertain to a given document. """ ret = libxml2...
Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset(). def newDtd(self, name, ExternalID, SystemID): """Creation of a new DTD for the external subset. To create an internal subset, use xmlCreateIntSubset(). """ ret = libxml2mod.xmlNe...
Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! def newGlobalNs(self, href, prefix): """Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! """ ret = libxml2mod.xmlNewGlobalNs(self._o, href, prefix) if ret is No...
Creation of a new reference node. def newReference(self, name): """Creation of a new reference node. """ ret = libxml2mod.xmlNewReference(self._o, name) if ret is None:raise treeError('xmlNewReference() failed') __tmp = xmlNode(_obj=ret) return __tmp
Dump an XML node, recursive behaviour, children are printed too. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or xmlKeepBlanksDefault(0) was called def nodeDumpOutput(self, buf, cur, level, format, encoding): """Dump an XML node, recursive behaviou...
Searches for the BASE URL. The code should work on both XML and HTML document even if base mechanisms are completely different. It returns the base as defined in RFC 2396 sections 5.1.1. Base URI within Document Content and 5.1.2. Base URI from the Encapsulating Entity However it...
Builds the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs, contrary to xmlNodeListGetString() this function doesn't do any character encoding handling. def nodeListGetRawString(self, list, inLine): """Builds the string equivalent to the tex...
Build the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs def nodeListGetString(self, list, inLine): """Build the string equivalent to the text contained in the Node list made of TEXTs and ENTITY_REFs """ if list is None: list__o = None ...
This function checks that all the namespaces declared within the given tree are properly declared. This is needed for example after Copy or Cut and then paste operations. The subtree may still hold pointers to namespace declarations outside the subtree or invalid/masked. As much ...
Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. def saveFile(self, filename): """Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout ...
Dump an XML document, converting it to the given encoding def saveFileEnc(self, filename, encoding): """Dump an XML document, converting it to the given encoding """ ret = libxml2mod.xmlSaveFileEnc(filename, self._o, encoding) return ret
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. def saveFileTo(self, buf, encoding): """Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available...
Dump an XML document to a file. Will use compression if compiled in and enabled. If @filename is "-" the stdout file is used. If @format is set then the document will be indented on output. Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1 or ...
Dump an XML document to a file or an URL. def saveFormatFileEnc(self, filename, encoding, format): """Dump an XML document to a file or an URL. """ ret = libxml2mod.xmlSaveFormatFileEnc(filename, self._o, encoding, format) return ret
Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is not available after this call. def saveFormatFileTo(self, buf, encoding, format): """Dump an XML document to an I/O buffer. Warning ! This call xmlOutputBufferClose() on buf which is...
Search a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return None otherwise. @nameSpace can be None, this is a search for the default namespace. We don't allow to cross entities boundaries. If you don't decl...
Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None otherwise. def searchNsByHref(self, node, href): """Search a Ns aliasing a given URI. Recurse on the parents until it finds the defined namespace or return None ...
update all nodes in the list to point to the right document def setListDoc(self, list): """update all nodes in the list to point to the right document """ if list is None: list__o = None else: list__o = list._o libxml2mod.xmlSetListDoc(list__o, self._o)
Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). def setRootElement(self, root): """Set the root element of the document (doc->children is a list containing possibly comments, PIs, etc ...). """ if root is None: root__o = N...
update all nodes under the tree to point to the right document def setTreeDoc(self, tree): """update all nodes under the tree to point to the right document """ if tree is None: tree__o = None else: tree__o = tree._o libxml2mod.xmlSetTreeDoc(tree__o, self._o)
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. def stringGetNodeList(self, value): """Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. """ ...
Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. def stringLenGetNodeList(self, value, len): """Parse the value string and build the node list associated. Should produce a flat tree with only TEXTs and ENTITY_REFs. """ ...
Search the attribute declaring the given ID def ID(self, ID): """Search the attribute declaring the given ID """ ret = libxml2mod.xmlGetID(self._o, ID) if ret is None:raise treeError('xmlGetID() failed') __tmp = xmlAttr(_obj=ret) return __tmp
Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically. def isID(self, elem, attr): """Determine whether an attri...
Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs def isMixedElement(self, name): """Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs """ ret = ...
Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase). def isRef(self, elem, attr): """Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, othe...