<commit_before>// +----------------------------------------------------------------------+
// | Bitflux Editor                                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 Bitflux GmbH                                      |
// +----------------------------------------------------------------------+
// | This software is published under the terms of the Apache Software    |
// | License a copy of which has been included with this distribution in  |
// | the LICENSE file and is available through the web at                 |
// | http://bitflux.ch/editor/license.html                                |
// +----------------------------------------------------------------------+
// | Author: <NAME> <<EMAIL>>                        |
// +----------------------------------------------------------------------+
//
// $Id$


XMLDocument.prototype.init = function (startNode) {
	if (!startNode) {
		startNode = this.documentElement;
	}
	
	var nsResolver = new bxe_nsResolver(this);
	// Add text nodes to td elements, when not existent
	//FIXME: Make this configurable
	var xmlresult = this.evaluate("//xhtml:td[not(*|text())]", this.documentElement, nsResolver, 0, null);
	var tdnode;
	var nodes = new Array();
	while (tdnode = xmlresult.iterateNext()) {
		nodes.push(tdnode);
	}
	
	for (var j = 0; j < nodes.length; j++) {
		nodes[j].appendChild(this.createTextNode(String.fromCharCode(160)));
	}
	
	
	this.XMLNode = new XMLNodeDocument();
	this.XMLNode._node = this;
	this.XMLNode.nodeType = 9;
	
	return startNode.init();
}

XMLDocument.prototype.insertIntoHTMLDocument = function(htmlnode) {

	var nsResolver = new bxe_nsResolver(this.documentElement);

	var nodes = bxe_getAllEditableAreas();<commit_msg>fix uni bug 1713<commit_after>// +----------------------------------------------------------------------+
// | Bitflux Editor                                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2003 Bitflux GmbH                                      |
// +----------------------------------------------------------------------+
// | This software is published under the terms of the Apache Software    |
// | License a copy of which has been included with this distribution in  |
// | the LICENSE file and is available through the web at                 |
// | http://bitflux.ch/editor/license.html                                |
// +----------------------------------------------------------------------+
// | Author: <NAME> <<EMAIL>>                        |
// +----------------------------------------------------------------------+
//
// $Id$


XMLDocument.prototype.init = function (startNode) {
	if (!startNode) {
		startNode = this.documentElement;
	}
	
	var nsResolver = new bxe_nsResolver(this);
	// Add text nodes to td elements, when not existent (or when whitespace only...)
	//FIXME: Make this configurable
	var xmlresult = this.evaluate("//xhtml:td[not(*|text()) or normalize-space(text()) = '']", this.documentElement, nsResolver, 0, null);
	var tdnode;
	var nodes = new Array();
	while (tdnode = xmlresult.iterateNext()) {
		nodes.push(tdnode);
	}
	
	for (var j = 0; j < nodes.length; j++) {
		nodes[j].appendChild(this.createTextNode(String.fromCharCode(160)));
	}
	
	
	this.XMLNode = new XMLNodeDocument();
	this.XMLNode._node = this;
	this.XMLNode.nodeType = 9;
	
	return startNode.init();
}

XMLDocument.prototype.insertIntoHTMLDocument = function(htmlnode) {

	var nsResolver = new bxe_nsResolver(this.documentElement);

	var nodes = bxe_getAllEditableAreas();
{'fraction_non_alphanumeric': 0.29961832061068705, 'fraction_numerical': 0.006543075245365322, 'mean_word_length': 1.3221518987341772, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '193615', 'n_tokens_mistral': 953, 'n_tokens_neox': 877, 'n_words': 234}