mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-06-30 15:03:05 +08:00
Compare commits
36 Commits
feature/li
...
fix/rtf-bu
| Author | SHA1 | Date | |
|---|---|---|---|
| da34674edc | |||
| 377d66307e | |||
| e6c9415a26 | |||
| cb3daf1b6a | |||
| 29bb590151 | |||
| 7fe4efbb54 | |||
| f7e17d0080 | |||
| ea7f362d99 | |||
| de49ae5f32 | |||
| b607249544 | |||
| bd62388d81 | |||
| 40bd21caac | |||
| f1ab3e4bf7 | |||
| aa43506bf9 | |||
| 544b0c54bc | |||
| 4a15aaab0d | |||
| 5d862891ca | |||
| 6a7aedaeb2 | |||
| 97900e0c6e | |||
| ac06652662 | |||
| 175028396e | |||
| 35ba9d7445 | |||
| 67d31207e5 | |||
| 75e095abb9 | |||
| d8133b7cb2 | |||
| 11c9900a5e | |||
| a5f4e04550 | |||
| e0141264a7 | |||
| bc9e8637ef | |||
| f531e480ff | |||
| 8d2331b097 | |||
| 61fca43920 | |||
| 2cceef7386 | |||
| 37f8c52e43 | |||
| 3bb03cb735 | |||
| c057c8eb24 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -46,6 +46,5 @@ DesktopEditor/fontengine/js/common/freetype-2.10.4
|
||||
|
||||
.qtc_clangd
|
||||
Common/3dParty/openssl/openssl/
|
||||
Common/3dParty/libxml/libxml2/
|
||||
|
||||
msvc_make.bat
|
||||
|
||||
@ -10,14 +10,14 @@ base_directory = os.getcwd()
|
||||
|
||||
if not base.is_dir("gumbo-parser"):
|
||||
base.cmd("git", ["clone", "https://github.com/google/gumbo-parser.git"])
|
||||
base.cmd_in_dir("gumbo-parser", "git", ["checkout", "aa91b27b02c0c80c482e24348a457ed7c3c088e0", "--quiet"])
|
||||
base.cmd_in_dir("gumbo-parser", "git", ["checkout", "aa91b27b02c0c80c482e24348a457ed7c3c088e0"])
|
||||
|
||||
# fix gumbo
|
||||
base.replaceInFile(base_directory + "/gumbo-parser/src/tag.c", "isspace(*c)", "isspace((unsigned char)*c)")
|
||||
|
||||
if not base.is_dir("katana-parser"):
|
||||
base.cmd("git", ["clone", "https://github.com/jasenhuang/katana-parser.git"])
|
||||
base.cmd_in_dir("katana-parser", "git", ["checkout", "be6df458d4540eee375c513958dcb862a391cdd1", "--quiet"])
|
||||
base.cmd_in_dir("katana-parser", "git", ["checkout", "be6df458d4540eee375c513958dcb862a391cdd1"])
|
||||
|
||||
# fix katana
|
||||
base.replaceInFileUtf8(base_directory + "/katana-parser/src/tokenizer.c", "static inline bool katana_is_html_space(char c);", "static inline bool2 katana_is_html_space(char c);")
|
||||
|
||||
@ -1,327 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('../../../../build_tools/scripts')
|
||||
import base
|
||||
|
||||
# suppresses status output when set via --quiet/-q; errors are still shown
|
||||
QUIET = False
|
||||
|
||||
def log(msg):
|
||||
if not QUIET:
|
||||
print(msg)
|
||||
return
|
||||
|
||||
def log_info(msg):
|
||||
if not QUIET:
|
||||
base.print_info(msg)
|
||||
return
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Per-target defaults (mirror LIBXML2_WITH_* options from CMakeLists.txt
|
||||
# and the platform branches inside configure.ac)
|
||||
# ---------------------------------------------------------------------------
|
||||
COMMON_FEATURES = {
|
||||
"WITH_C14N": 0,
|
||||
"WITH_CATALOG": 0,
|
||||
"WITH_DEBUG": 0,
|
||||
"WITH_HTML": 1,
|
||||
"WITH_HTTP": 0,
|
||||
"WITH_ICONV": 0,
|
||||
"WITH_ICU": 0,
|
||||
"WITH_ISO8859X": 0,
|
||||
"WITH_MODULES": 0,
|
||||
"WITH_OUTPUT": 1,
|
||||
"WITH_PATTERN": 0,
|
||||
"WITH_PUSH": 1,
|
||||
"WITH_READER": 1,
|
||||
"WITH_REGEXPS": 0,
|
||||
"WITH_RELAXNG": 0,
|
||||
"WITH_SAX1": 1,
|
||||
"WITH_SCHEMAS": 0,
|
||||
"WITH_SCHEMATRON": 0,
|
||||
"WITH_THREADS": 0,
|
||||
"WITH_THREAD_ALLOC": 0,
|
||||
"WITH_VALID": 0,
|
||||
"WITH_WRITER": 0,
|
||||
"WITH_XINCLUDE": 0,
|
||||
"WITH_XPATH": 0,
|
||||
"WITH_XPTR": 1,
|
||||
"WITH_ZLIB": 0
|
||||
}
|
||||
|
||||
TARGETS = {
|
||||
"windows": {
|
||||
"WITH_WINPATH": 1,
|
||||
"HAVE_DECL_GETENTROPY": 0,
|
||||
"HAVE_DECL_GLOB": 0,
|
||||
"HAVE_DECL_MMAP": 0,
|
||||
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 0,
|
||||
"HAVE_DLOPEN": 0,
|
||||
"HAVE_SHLLOAD": 0,
|
||||
"HAVE_LIBHISTORY": 0,
|
||||
"HAVE_LIBREADLINE": 0,
|
||||
"HAVE_STDINT_H": 1,
|
||||
"XML_SYSCONFDIR": "/etc",
|
||||
"MODULE_EXTENSION": ".dll",
|
||||
"XML_THREAD_LOCAL": "__declspec(thread)"
|
||||
},
|
||||
"linux": {
|
||||
"WITH_WINPATH": 0,
|
||||
"HAVE_DECL_GETENTROPY": 0,
|
||||
"HAVE_DECL_GLOB": 1,
|
||||
"HAVE_DECL_MMAP": 1,
|
||||
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 1,
|
||||
"HAVE_DLOPEN": 1,
|
||||
"HAVE_SHLLOAD": 0,
|
||||
"HAVE_LIBHISTORY": 0,
|
||||
"HAVE_LIBREADLINE": 0,
|
||||
"HAVE_STDINT_H": 1,
|
||||
"XML_SYSCONFDIR": "/etc",
|
||||
"MODULE_EXTENSION": ".so",
|
||||
"XML_THREAD_LOCAL": "__thread"
|
||||
},
|
||||
"mac": {
|
||||
"WITH_WINPATH": 0,
|
||||
"HAVE_DECL_GETENTROPY": 0,
|
||||
"HAVE_DECL_GLOB": 1,
|
||||
"HAVE_DECL_MMAP": 1,
|
||||
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 1,
|
||||
"HAVE_DLOPEN": 1,
|
||||
"HAVE_SHLLOAD": 0,
|
||||
"HAVE_LIBHISTORY": 0,
|
||||
"HAVE_LIBREADLINE": 0,
|
||||
"HAVE_STDINT_H": 1,
|
||||
"XML_SYSCONFDIR": "/etc",
|
||||
"MODULE_EXTENSION": ".dylib",
|
||||
"XML_THREAD_LOCAL": "__thread"
|
||||
}
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
def build_defaults(target):
|
||||
if target not in TARGETS:
|
||||
base.print_error("unknown target: " + target)
|
||||
sys.exit(1)
|
||||
cfg = {}
|
||||
for k in COMMON_FEATURES:
|
||||
cfg[k] = COMMON_FEATURES[k]
|
||||
for k in TARGETS[target]:
|
||||
cfg[k] = TARGETS[target][k]
|
||||
return cfg
|
||||
|
||||
def derive(cfg):
|
||||
parts = cfg["VERSION"].split(".")
|
||||
major = int(parts[0])
|
||||
minor = int(parts[1])
|
||||
micro = int(parts[2])
|
||||
cfg["LIBXML_MAJOR_VERSION"] = major
|
||||
cfg["LIBXML_MINOR_VERSION"] = minor
|
||||
cfg["LIBXML_MICRO_VERSION"] = micro
|
||||
cfg["LIBXML_VERSION_NUMBER"] = major * 10000 + minor * 100 + micro
|
||||
if "LIBXML_VERSION_EXTRA" not in cfg:
|
||||
cfg["LIBXML_VERSION_EXTRA"] = ""
|
||||
return
|
||||
|
||||
def subst_atvars(text, cfg):
|
||||
for key in cfg:
|
||||
text = text.replace("@" + key + "@", str(cfg[key]))
|
||||
# warn about leftover placeholders (helps catch typos in xmlversion.h.in)
|
||||
i = text.find("@")
|
||||
while i != -1:
|
||||
j = text.find("@", i + 1)
|
||||
if j == -1:
|
||||
break
|
||||
token = text[i + 1:j]
|
||||
is_name = (len(token) > 0)
|
||||
for ch in token:
|
||||
if not (ch.isalnum() or ch == "_"):
|
||||
is_name = False
|
||||
break
|
||||
if is_name:
|
||||
base.print_error("undefined template variable: @" + token + "@")
|
||||
i = text.find("@", j + 1)
|
||||
return text
|
||||
|
||||
def process_cmakedefine_line(line, cfg):
|
||||
stripped = line.lstrip()
|
||||
if not stripped.startswith("#"):
|
||||
return None
|
||||
indent = line[:len(line) - len(stripped)]
|
||||
body = stripped[1:].lstrip() # skip '#' and any whitespace after it
|
||||
|
||||
if body.startswith("cmakedefine01"):
|
||||
rest = body[len("cmakedefine01"):].strip()
|
||||
if rest == "":
|
||||
return None
|
||||
name = rest.split()[0]
|
||||
value = 1 if int(cfg.get(name, 0)) else 0
|
||||
return indent + "#define " + name + " " + str(value)
|
||||
|
||||
if body.startswith("cmakedefine"):
|
||||
rest = body[len("cmakedefine"):]
|
||||
if rest == "" or not rest[0].isspace():
|
||||
return None
|
||||
rest = rest.lstrip()
|
||||
sp = -1
|
||||
for k in range(len(rest)):
|
||||
if rest[k].isspace():
|
||||
sp = k
|
||||
break
|
||||
if sp == -1:
|
||||
name = rest
|
||||
tail = ""
|
||||
else:
|
||||
name = rest[:sp]
|
||||
tail = rest[sp:]
|
||||
if cfg.get(name):
|
||||
return indent + "#define " + name + subst_atvars(tail, cfg)
|
||||
return indent + "/* #undef " + name + " */"
|
||||
|
||||
return None
|
||||
|
||||
def process_template(text, cfg, cmake_style):
|
||||
out_lines = []
|
||||
for line in text.splitlines():
|
||||
if cmake_style:
|
||||
replaced = process_cmakedefine_line(line, cfg)
|
||||
if replaced is not None:
|
||||
out_lines.append(replaced)
|
||||
continue
|
||||
out_lines.append(subst_atvars(line, cfg))
|
||||
return "\n".join(out_lines) + "\n"
|
||||
|
||||
def configure_file(src, dst, cfg, cmake_style):
|
||||
if not base.is_file(src):
|
||||
base.print_error("template not found: " + src)
|
||||
sys.exit(1)
|
||||
text = base.readFile(src)
|
||||
dst_dir = os.path.dirname(base.get_path(dst))
|
||||
if dst_dir != "":
|
||||
base.create_dir(dst_dir)
|
||||
base.writeFile(dst, process_template(text, cfg, cmake_style))
|
||||
log(" wrote " + dst)
|
||||
return
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# CLI
|
||||
# ---------------------------------------------------------------------------
|
||||
def print_help():
|
||||
print("Usage: python configure_libxml2.py [options]")
|
||||
print("")
|
||||
print("Generates config.h and include/libxml/xmlversion.h from the")
|
||||
print("libxml2 *.in templates, mirroring the logic of configure.ac /")
|
||||
print("CMakeLists.txt without invoking autoconf or cmake.")
|
||||
print("")
|
||||
print("Paths:")
|
||||
print(" --source DIR libxml2 source root (default: cwd)")
|
||||
print(" --config-h PATH explicit path for config.h")
|
||||
print(" (default: <script-dir>/config.h)")
|
||||
print(" --xmlversion-h PATH explicit path for xmlversion.h")
|
||||
print(" (default: <script-dir>/xmlversion.h)")
|
||||
print("")
|
||||
print("Build options:")
|
||||
print(" --target NAME windows | linux | mac (default: host)")
|
||||
print(" --with-FEATURE 0|1 toggle any LIBXML2_WITH_* feature")
|
||||
print(" e.g. --with-zlib 1 --with-iconv 1")
|
||||
print(" --have-NAME 0|1 set any HAVE_* probe value")
|
||||
print(" e.g. --have-dlopen 1")
|
||||
print(" --xml-sysconfdir DIR override XML_SYSCONFDIR")
|
||||
print(" --xml-thread-local S override TLS specifier")
|
||||
print(" --module-extension S override dynamic-module suffix")
|
||||
print(" --version-extra S set LIBXML_VERSION_EXTRA")
|
||||
print("")
|
||||
print(" -q, --quiet suppress status output (errors still shown)")
|
||||
print(" -h, --help show this message")
|
||||
return
|
||||
|
||||
def parse_args(argv):
|
||||
args = {}
|
||||
i = 1
|
||||
while i < len(argv):
|
||||
arg = argv[i]
|
||||
if arg == "-h" or arg == "--help":
|
||||
args["help"] = "1"
|
||||
i += 1
|
||||
continue
|
||||
if arg == "-q" or arg == "--quiet":
|
||||
args["quiet"] = "1"
|
||||
i += 1
|
||||
continue
|
||||
if not arg.startswith("--"):
|
||||
base.print_error("unexpected positional argument: " + arg)
|
||||
sys.exit(1)
|
||||
key = arg[2:]
|
||||
if i + 1 >= len(argv):
|
||||
base.print_error("missing value for --" + key)
|
||||
sys.exit(1)
|
||||
args[key] = argv[i + 1]
|
||||
i += 2
|
||||
return args
|
||||
|
||||
def apply_overrides(cfg, args):
|
||||
reserved = ("source", "target", "config-h", "xmlversion-h",
|
||||
"version-extra", "help", "quiet")
|
||||
for key in args:
|
||||
if key in reserved:
|
||||
continue
|
||||
cfg_key = key.upper().replace("-", "_")
|
||||
value = args[key]
|
||||
if cfg_key not in cfg:
|
||||
base.print_error("unknown option: --" + key + " "
|
||||
"(maps to " + cfg_key + ")")
|
||||
sys.exit(1)
|
||||
# keep type stable: numeric keys stay numeric
|
||||
if isinstance(cfg[cfg_key], int):
|
||||
try:
|
||||
cfg[cfg_key] = int(value)
|
||||
except ValueError:
|
||||
base.print_error("--" + key + " expects 0 or 1, got: " + value)
|
||||
sys.exit(1)
|
||||
else:
|
||||
cfg[cfg_key] = value
|
||||
return
|
||||
|
||||
def main(argv):
|
||||
global QUIET
|
||||
args = parse_args(argv)
|
||||
if "help" in args:
|
||||
print_help()
|
||||
return 0
|
||||
QUIET = ("quiet" in args)
|
||||
|
||||
source = args.get("source", os.getcwd())
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
target = args.get("target", base.host_platform())
|
||||
|
||||
cfg = build_defaults(target)
|
||||
|
||||
version_file = source + "/VERSION"
|
||||
if not base.is_file(version_file):
|
||||
base.print_error("VERSION file not found in: " + source)
|
||||
return 1
|
||||
cfg["VERSION"] = base.readFile(version_file).strip()
|
||||
|
||||
apply_overrides(cfg, args)
|
||||
if "version-extra" in args:
|
||||
cfg["LIBXML_VERSION_EXTRA"] = args["version-extra"]
|
||||
|
||||
derive(cfg)
|
||||
|
||||
config_h_out = args.get("config-h", script_dir + "/config.h")
|
||||
xmlversion_h_out = args.get("xmlversion-h", script_dir + "/xmlversion.h")
|
||||
|
||||
log_info("libxml2 " + cfg["VERSION"] + " target=" + target)
|
||||
log(" source = " + source)
|
||||
|
||||
configure_file(source + "/config.h.cmake.in",
|
||||
config_h_out, cfg, True)
|
||||
configure_file(source + "/include/libxml/xmlversion.h.in",
|
||||
xmlversion_h_out, cfg, False)
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append('../../../../build_tools/scripts')
|
||||
import base
|
||||
import configure_libxml2
|
||||
|
||||
if not base.is_dir("libxml2"):
|
||||
base.cmd("git", ["clone", "https://github.com/GNOME/libxml2.git"])
|
||||
base.cmd_in_dir("libxml2", "git", ["checkout", "39b66eb2089f491eacf8e22a7965a235f7f5735e", "--quiet"])
|
||||
|
||||
configure_libxml2.main(["", "--source", "./libxml2",
|
||||
"--config-h", "../../../DesktopEditor/xml/build/qt/config.h",
|
||||
"--xmlversion-h", "./libxml2/include/libxml/xmlversion.h",
|
||||
"--quiet"])
|
||||
|
||||
#fix parserInternals.h
|
||||
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_TEXT_LENGTH 10000000", "#define XML_MAX_TEXT_LENGTH 15000000")
|
||||
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_DICTIONARY_LIMIT 10000000", "#define XML_MAX_DICTIONARY_LIMIT 15000000")
|
||||
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_LOOKUP_LIMIT 10000000", "#define XML_MAX_LOOKUP_LIMIT 15000000")
|
||||
|
||||
#Logging has been removed
|
||||
target = "void\nxmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {\n va_list args;\n\n if (xmlGenericErrorContext == NULL)\n xmlGenericErrorContext = (void *) stderr;\n\n va_start(args, msg);\n vfprintf((FILE *)xmlGenericErrorContext, msg, args);\n va_end(args);\n}"
|
||||
replacement = "#ifndef XML_ERROR_DISABLE_MODE\n" + target + "\n#else\nvoid\nxmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {\n // NONE\n}\n#endif"
|
||||
base.replaceInFile("libxml2/error.c", target, replacement)
|
||||
|
||||
@ -1,32 +1,35 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2023
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
@ -152,7 +152,7 @@ public:
|
||||
Link = 1,
|
||||
DocInfo = 2,
|
||||
FormField = 3, // Backward compatibility for docxf
|
||||
Annotaion = 4,
|
||||
Annotation = 4,
|
||||
DeleteAnnot = 5,
|
||||
WidgetsInfo = 6,
|
||||
ShapeStart = 7,
|
||||
@ -161,6 +161,7 @@ public:
|
||||
PageRotate = 10,
|
||||
Headings = 11,
|
||||
Redact = 12,
|
||||
RedactAnnot = 13,
|
||||
|
||||
Undefined = 255
|
||||
};
|
||||
|
||||
@ -1067,7 +1067,7 @@ namespace NSOnlineOfficeBinToPdf
|
||||
switch (eCommand)
|
||||
{
|
||||
case ctFormField: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::FormField; break;
|
||||
case ctAnnotField: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::Annotaion; break;
|
||||
case ctAnnotField: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::Annotation; break;
|
||||
case ctAnnotFieldDelete: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::DeleteAnnot; break;
|
||||
case ctWidgetsInfo: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::WidgetsInfo; break;
|
||||
case ctShapeStart: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::ShapeStart; break;
|
||||
|
||||
@ -135,7 +135,7 @@ CAnnotFieldInfo::CActionFieldPr* ReadAction(NSOnlineOfficeBinToPdf::CBufferReade
|
||||
return pRes;
|
||||
}
|
||||
|
||||
CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annotaion)
|
||||
CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annotation)
|
||||
{
|
||||
m_nType = EAnnotType::Unknown;
|
||||
|
||||
@ -1487,3 +1487,11 @@ bool CRedact::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRe
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CRedactAnnot::CRedactAnnot() : IAdvancedCommand(AdvancedCommandType::RedactAnnot) {}
|
||||
int CRedactAnnot::GetID() { return m_nID; }
|
||||
bool CRedactAnnot::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
|
||||
{
|
||||
m_nID = pReader->ReadInt();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -761,4 +761,17 @@ private:
|
||||
std::vector<SRedact*> m_arrRedact;
|
||||
};
|
||||
|
||||
class GRAPHICS_DECL CRedactAnnot : public IAdvancedCommand
|
||||
{
|
||||
public:
|
||||
CRedactAnnot();
|
||||
|
||||
int GetID();
|
||||
|
||||
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector);
|
||||
|
||||
private:
|
||||
int m_nID;
|
||||
};
|
||||
|
||||
#endif // _BUILD_ANNOTFIELD_H_
|
||||
|
||||
@ -201,5 +201,4 @@ private:
|
||||
std::vector<CHeading*> m_arrHeading;
|
||||
};
|
||||
|
||||
|
||||
#endif // _BUILD_DOCINFO_H_
|
||||
|
||||
174
DesktopEditor/xml/build/qt/config.h
Normal file
174
DesktopEditor/xml/build/qt/config.h
Normal file
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* Copyright (C) Ascensio System SIA, 2009-2026
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation, together with the
|
||||
* additional terms provided in the LICENSE file.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA by email at info@onlyoffice.com
|
||||
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
|
||||
* LV-1050, Latvia, European Union.
|
||||
*
|
||||
* The interactive user interfaces in modified versions of the Program
|
||||
* are required to display Appropriate Legal Notices in accordance with
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* No trademark rights are granted under this License.
|
||||
*
|
||||
* All non-code elements of the Product, including illustrations,
|
||||
* icon sets, and technical writing content, are licensed under the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International License:
|
||||
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
* This license applies only to such non-code elements and does not
|
||||
* modify or replace the licensing terms applicable to the Program's
|
||||
* source code, which remains licensed under the GNU Affero General
|
||||
* Public License v3.
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
#ifndef __LIBXML_WIN32_CONFIG__
|
||||
#define __LIBXML_WIN32_CONFIG__
|
||||
|
||||
#define HAVE_CTYPE_H
|
||||
#define HAVE_STDARG_H
|
||||
#define HAVE_MALLOC_H
|
||||
#define HAVE_ERRNO_H
|
||||
#define HAVE_STDINT_H
|
||||
|
||||
#if defined(_WIN32_WCE)
|
||||
#undef HAVE_ERRNO_H
|
||||
#include <windows.h>
|
||||
#include "wincecompat.h"
|
||||
#else
|
||||
#define HAVE_SYS_STAT_H
|
||||
#define HAVE__STAT
|
||||
#define HAVE_STAT
|
||||
#define HAVE_STDLIB_H
|
||||
#define HAVE_TIME_H
|
||||
#define HAVE_FCNTL_H
|
||||
//#include <io.h>
|
||||
//#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifndef ICONV_CONST
|
||||
#define ICONV_CONST const
|
||||
#endif
|
||||
|
||||
//#ifdef NEED_SOCKETS
|
||||
//#include <wsockcompat.h>
|
||||
//#endif
|
||||
|
||||
/*
|
||||
* Windows platforms may define except
|
||||
*/
|
||||
#undef except
|
||||
|
||||
#define HAVE_ISINF
|
||||
#define HAVE_ISNAN
|
||||
#include <math.h>
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
/* MS C-runtime has functions which can be used in order to determine if
|
||||
a given floating-point variable contains NaN, (+-)INF. These are
|
||||
preferred, because floating-point technology is considered propriatary
|
||||
by MS and we can assume that their functions know more about their
|
||||
oddities than we do. */
|
||||
#include <float.h>
|
||||
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
|
||||
function. */
|
||||
#ifndef isinf
|
||||
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
|
||||
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
|
||||
#endif
|
||||
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
|
||||
#ifndef isnan
|
||||
#define isnan(d) (_isnan(d))
|
||||
#endif
|
||||
#else /* _MSC_VER */
|
||||
#ifdef WIN32
|
||||
#ifndef isinf
|
||||
int isinf (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 1;
|
||||
} else if (val == -0.5) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef isnan
|
||||
int isnan (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 0;
|
||||
} else if (val == -0.5) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define mkdir(p,m) _mkdir(p)
|
||||
#if _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#if _MSC_VER < 1500
|
||||
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
||||
#endif
|
||||
#elif defined(__MINGW32__)
|
||||
#define mkdir(p,m) _mkdir(p)
|
||||
#endif
|
||||
|
||||
/* Threading API to use should be specified here for compatibility reasons.
|
||||
This is however best specified on the compiler's command-line. */
|
||||
#if defined(LIBXML_THREAD_ENABLED)
|
||||
#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
|
||||
#define HAVE_WIN32_THREADS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBXML_READER_ENABLED
|
||||
#define LIBXML_READER_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef LIBXML_PUSH_ENABLED
|
||||
#define LIBXML_PUSH_ENABLED
|
||||
#endif
|
||||
|
||||
#ifndef LIBXML_HTML_ENABLED
|
||||
#define LIBXML_HTML_ENABLED
|
||||
#endif
|
||||
|
||||
/* Some third-party libraries far from our control assume the following
|
||||
is defined, which it is not if we don't include windows.h. */
|
||||
#if !defined(FALSE)
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#if !defined(TRUE)
|
||||
#define TRUE (!(FALSE))
|
||||
#endif
|
||||
|
||||
#endif /* __LIBXML_WIN32_CONFIG__ */
|
||||
@ -48,11 +48,9 @@ DEFINES += \
|
||||
LIBXML_STATIC
|
||||
}
|
||||
|
||||
LIBXML2_ROOT_DIR = $$PWD/../../../../Common/3dParty/libxml/libxml2
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$LIBXML2_ROOT_DIR/include \
|
||||
$$LIBXML2_ROOT_DIR/include/libxml \
|
||||
$$PWD/../../libxml2/include \
|
||||
$$PWD/../../libxml2/include/libxml \
|
||||
$$PWD
|
||||
|
||||
core_release {
|
||||
@ -64,47 +62,50 @@ core_release {
|
||||
|
||||
core_debug {
|
||||
SOURCES += \
|
||||
$$LIBXML2_ROOT_DIR/buf.c \
|
||||
$$LIBXML2_ROOT_DIR/c14n.c \
|
||||
$$LIBXML2_ROOT_DIR/catalog.c \
|
||||
$$LIBXML2_ROOT_DIR/chvalid.c \
|
||||
$$LIBXML2_ROOT_DIR/debugXML.c \
|
||||
$$LIBXML2_ROOT_DIR/dict.c \
|
||||
$$LIBXML2_ROOT_DIR/encoding.c \
|
||||
$$LIBXML2_ROOT_DIR/entities.c \
|
||||
$$LIBXML2_ROOT_DIR/error.c \
|
||||
$$LIBXML2_ROOT_DIR/globals.c \
|
||||
$$LIBXML2_ROOT_DIR/hash.c \
|
||||
$$LIBXML2_ROOT_DIR/HTMLparser.c \
|
||||
$$LIBXML2_ROOT_DIR/HTMLtree.c \
|
||||
$$LIBXML2_ROOT_DIR/list.c \
|
||||
$$LIBXML2_ROOT_DIR/nanohttp.c \
|
||||
$$LIBXML2_ROOT_DIR/parserInternals.c \
|
||||
$$LIBXML2_ROOT_DIR/pattern.c \
|
||||
$$LIBXML2_ROOT_DIR/relaxng.c \
|
||||
$$LIBXML2_ROOT_DIR/SAX2.c \
|
||||
$$LIBXML2_ROOT_DIR/schematron.c \
|
||||
$$LIBXML2_ROOT_DIR/shell.c \
|
||||
$$LIBXML2_ROOT_DIR/threads.c \
|
||||
$$LIBXML2_ROOT_DIR/tree.c \
|
||||
$$LIBXML2_ROOT_DIR/uri.c \
|
||||
$$LIBXML2_ROOT_DIR/xinclude.c \
|
||||
$$LIBXML2_ROOT_DIR/xlink.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlIO.c \
|
||||
$$LIBXML2_ROOT_DIR/xmllint.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlmemory.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlmodule.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlreader.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlregexp.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlsave.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlschemas.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlschemastypes.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlstring.c \
|
||||
$$LIBXML2_ROOT_DIR/xmlwriter.c \
|
||||
$$LIBXML2_ROOT_DIR/xpath.c \
|
||||
$$LIBXML2_ROOT_DIR/xpointer.c \
|
||||
$$LIBXML2_ROOT_DIR/valid.c \
|
||||
$$LIBXML2_ROOT_DIR/parser.c
|
||||
$$PWD/../../libxml2/buf.c \
|
||||
$$PWD/../../libxml2/c14n.c \
|
||||
$$PWD/../../libxml2/catalog.c \
|
||||
$$PWD/../../libxml2/chvalid.c \
|
||||
$$PWD/../../libxml2/debugXML.c \
|
||||
$$PWD/../../libxml2/dict.c \
|
||||
$$PWD/../../libxml2/DOCBparser.c \
|
||||
$$PWD/../../libxml2/encoding.c \
|
||||
$$PWD/../../libxml2/entities.c \
|
||||
$$PWD/../../libxml2/error.c \
|
||||
$$PWD/../../libxml2/globals.c \
|
||||
$$PWD/../../libxml2/hash.c \
|
||||
$$PWD/../../libxml2/HTMLparser.c \
|
||||
$$PWD/../../libxml2/HTMLtree.c \
|
||||
$$PWD/../../libxml2/legacy.c \
|
||||
$$PWD/../../libxml2/list.c \
|
||||
$$PWD/../../libxml2/nanoftp.c \
|
||||
$$PWD/../../libxml2/nanohttp.c \
|
||||
$$PWD/../../libxml2/parserInternals.c \
|
||||
$$PWD/../../libxml2/pattern.c \
|
||||
$$PWD/../../libxml2/relaxng.c \
|
||||
$$PWD/../../libxml2/SAX.c \
|
||||
$$PWD/../../libxml2/SAX2.c \
|
||||
$$PWD/../../libxml2/schematron.c \
|
||||
$$PWD/../../libxml2/threads.c \
|
||||
$$PWD/../../libxml2/tree.c \
|
||||
$$PWD/../../libxml2/uri.c \
|
||||
$$PWD/../../libxml2/xinclude.c \
|
||||
$$PWD/../../libxml2/xlink.c \
|
||||
$$PWD/../../libxml2/xmlIO.c \
|
||||
$$PWD/../../libxml2/xmlmemory.c \
|
||||
$$PWD/../../libxml2/xmlmodule.c \
|
||||
$$PWD/../../libxml2/xmlreader.c \
|
||||
$$PWD/../../libxml2/xmlregexp.c \
|
||||
$$PWD/../../libxml2/xmlsave.c \
|
||||
$$PWD/../../libxml2/xmlschemas.c \
|
||||
$$PWD/../../libxml2/xmlschemastypes.c \
|
||||
$$PWD/../../libxml2/xmlstring.c \
|
||||
$$PWD/../../libxml2/xmlunicode.c \
|
||||
$$PWD/../../libxml2/xmlwriter.c \
|
||||
$$PWD/../../libxml2/xpath.c \
|
||||
$$PWD/../../libxml2/xpointer.c \
|
||||
$$PWD/../../libxml2/valid.c \
|
||||
$$PWD/../../libxml2/parser.c
|
||||
}
|
||||
|
||||
!core_only_libxml {
|
||||
@ -120,7 +121,3 @@ HEADERS += \
|
||||
$$PWD/../../include/xmlutils.h \
|
||||
$$PWD/../../include/xmlwriter.h
|
||||
}
|
||||
|
||||
core_windows {
|
||||
LIBS += -lbcrypt
|
||||
}
|
||||
|
||||
@ -1,39 +1,44 @@
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/buf.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/c14n.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/catalog.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/chvalid.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/debugXML.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/dict.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/encoding.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/entities.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/error.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/globals.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/hash.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/HTMLparser.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/HTMLtree.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/list.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/nanohttp.c"
|
||||
//#include "../../../../Common/3dParty/libxml/libxml2/parser.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/parserInternals.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/pattern.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/relaxng.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/SAX2.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/schematron.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/threads.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/tree.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/uri.c"
|
||||
//#include "../../../../Common/3dParty/libxml/libxml2/valid.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xinclude.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xlink.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlIO.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlmemory.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlmodule.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlreader.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlregexp.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlsave.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlschemas.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlschemastypes.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlstring.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xmlwriter.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xpath.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/xpointer.c"
|
||||
#include "../../libxml2/buf.c"
|
||||
#include "../../libxml2/c14n.c"
|
||||
#include "../../libxml2/catalog.c"
|
||||
#include "../../libxml2/chvalid.c"
|
||||
#include "../../libxml2/debugXML.c"
|
||||
#include "../../libxml2/dict.c"
|
||||
#include "../../libxml2/DOCBparser.c"
|
||||
#include "../../libxml2/encoding.c"
|
||||
#include "../../libxml2/entities.c"
|
||||
#include "../../libxml2/error.c"
|
||||
#include "../../libxml2/globals.c"
|
||||
#include "../../libxml2/hash.c"
|
||||
#include "../../libxml2/HTMLparser.c"
|
||||
#include "../../libxml2/HTMLtree.c"
|
||||
#include "../../libxml2/legacy.c"
|
||||
#include "../../libxml2/list.c"
|
||||
#include "../../libxml2/nanoftp.c"
|
||||
#include "../../libxml2/nanohttp.c"
|
||||
//#include "../../libxml2/parser.c"
|
||||
#include "../../libxml2/parserInternals.c"
|
||||
#include "../../libxml2/pattern.c"
|
||||
#include "../../libxml2/relaxng.c"
|
||||
#include "../../libxml2/SAX.c"
|
||||
#include "../../libxml2/SAX2.c"
|
||||
#include "../../libxml2/schematron.c"
|
||||
#include "../../libxml2/threads.c"
|
||||
#include "../../libxml2/tree.c"
|
||||
#include "../../libxml2/uri.c"
|
||||
//#include "../../libxml2/valid.c"
|
||||
#include "../../libxml2/xinclude.c"
|
||||
#include "../../libxml2/xlink.c"
|
||||
#include "../../libxml2/xmlIO.c"
|
||||
#include "../../libxml2/xmlmemory.c"
|
||||
#include "../../libxml2/xmlmodule.c"
|
||||
#include "../../libxml2/xmlreader.c"
|
||||
#include "../../libxml2/xmlregexp.c"
|
||||
#include "../../libxml2/xmlsave.c"
|
||||
#include "../../libxml2/xmlschemas.c"
|
||||
#include "../../libxml2/xmlschemastypes.c"
|
||||
#include "../../libxml2/xmlstring.c"
|
||||
#include "../../libxml2/xmlunicode.c"
|
||||
#include "../../libxml2/xmlwriter.c"
|
||||
#include "../../libxml2/xpath.c"
|
||||
#include "../../libxml2/xpointer.c"
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/valid.c"
|
||||
#include "../../../../Common/3dParty/libxml/libxml2/parser.c"
|
||||
#include "../../libxml2/valid.c"
|
||||
#include "../../libxml2/parser.c"
|
||||
|
||||
5
DesktopEditor/xml/libxml2/AUTHORS
Normal file
5
DesktopEditor/xml/libxml2/AUTHORS
Normal file
@ -0,0 +1,5 @@
|
||||
Daniel Veillard <daniel@veillard.com>
|
||||
Bjorn Reese <breese@users.sourceforge.net>
|
||||
William Brack <wbrack@mmm.com.hk>
|
||||
Igor Zlatkovic <igor@zlatkovic.com> for the Windows port
|
||||
Aleksey Sanin <aleksey@aleksey.com>
|
||||
19678
DesktopEditor/xml/libxml2/ChangeLog
Normal file
19678
DesktopEditor/xml/libxml2/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
23
DesktopEditor/xml/libxml2/Copyright
Normal file
23
DesktopEditor/xml/libxml2/Copyright
Normal file
@ -0,0 +1,23 @@
|
||||
Except where otherwise noted in the source code (e.g. the files hash.c,
|
||||
list.c and the trio files, which are covered by a similar licence but
|
||||
with different Copyright notices) all the files are:
|
||||
|
||||
Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is fur-
|
||||
nished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
|
||||
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
305
DesktopEditor/xml/libxml2/DOCBparser.c
Normal file
305
DesktopEditor/xml/libxml2/DOCBparser.c
Normal file
@ -0,0 +1,305 @@
|
||||
/*
|
||||
* DOCBparser.c : an attempt to parse SGML Docbook documents
|
||||
*
|
||||
* This is deprecated !!!
|
||||
* Code removed with release 2.6.0 it was broken.
|
||||
* The doc are expect to be migrated to XML DocBook
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/DOCBparser.h>
|
||||
|
||||
/**
|
||||
* docbEncodeEntities:
|
||||
* @out: a pointer to an array of bytes to store the result
|
||||
* @outlen: the length of @out
|
||||
* @in: a pointer to an array of UTF-8 chars
|
||||
* @inlen: the length of @in
|
||||
* @quoteChar: the quote character to escape (' or ") or zero.
|
||||
*
|
||||
* Take a block of UTF-8 chars in and try to convert it to an ASCII
|
||||
* plus SGML entities block of chars out.
|
||||
*
|
||||
* Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
|
||||
* The value of @inlen after return is the number of octets consumed
|
||||
* as the return value is positive, else unpredictable.
|
||||
* The value of @outlen after return is the number of octets consumed.
|
||||
*/
|
||||
int
|
||||
docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED,
|
||||
int *outlen ATTRIBUTE_UNUSED,
|
||||
const unsigned char *in ATTRIBUTE_UNUSED,
|
||||
int *inlen ATTRIBUTE_UNUSED,
|
||||
int quoteChar ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbEncodeEntities() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseDocument:
|
||||
* @ctxt: an SGML parser context
|
||||
*
|
||||
* parse an SGML document (and build a tree if using the standard SAX
|
||||
* interface).
|
||||
*
|
||||
* Returns 0, -1 in case of error. the parser context is augmented
|
||||
* as a result of the parsing.
|
||||
*/
|
||||
|
||||
int
|
||||
docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseDocument() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
return (xmlParseDocument(ctxt));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbFreeParserCtxt:
|
||||
* @ctxt: an SGML parser context
|
||||
*
|
||||
* Free all the memory used by a parser context. However the parsed
|
||||
* document in ctxt->myDoc is not freed.
|
||||
*/
|
||||
|
||||
void
|
||||
docbFreeParserCtxt(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbFreeParserCtxt() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseChunk:
|
||||
* @ctxt: an XML parser context
|
||||
* @chunk: an char array
|
||||
* @size: the size in byte of the chunk
|
||||
* @terminate: last chunk indicator
|
||||
*
|
||||
* Parse a Chunk of memory
|
||||
*
|
||||
* Returns zero if no error, the xmlParserErrors otherwise.
|
||||
*/
|
||||
int
|
||||
docbParseChunk(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
||||
const char *chunk ATTRIBUTE_UNUSED,
|
||||
int size ATTRIBUTE_UNUSED,
|
||||
int terminate ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseChunk(ctxt, chunk, size, terminate));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbCreatePushParserCtxt:
|
||||
* @sax: a SAX handler
|
||||
* @user_data: The user data returned on SAX callbacks
|
||||
* @chunk: a pointer to an array of chars
|
||||
* @size: number of chars in the array
|
||||
* @filename: an optional file name or URI
|
||||
* @enc: an optional encoding
|
||||
*
|
||||
* Create a parser context for using the DocBook SGML parser in push mode
|
||||
* To allow content encoding detection, @size should be >= 4
|
||||
* The value of @filename is used for fetching external entities
|
||||
* and error/warning reports.
|
||||
*
|
||||
* Returns the new parser context or NULL
|
||||
*/
|
||||
docbParserCtxtPtr
|
||||
docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *user_data ATTRIBUTE_UNUSED,
|
||||
const char *chunk ATTRIBUTE_UNUSED,
|
||||
int size ATTRIBUTE_UNUSED,
|
||||
const char *filename ATTRIBUTE_UNUSED,
|
||||
xmlCharEncoding enc ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbSAXParseDoc:
|
||||
* @cur: a pointer to an array of xmlChar
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
* @sax: the SAX handler block
|
||||
* @userData: if using SAX, this pointer will be provided on callbacks.
|
||||
*
|
||||
* parse an SGML in-memory document and build a tree.
|
||||
* It use the given SAX function block to handle the parsing callback.
|
||||
* If sax is NULL, fallback to the default DOM tree building routines.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED,
|
||||
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *userData ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlSAXParseMemoryWithData(sax, (const char *)cur,
|
||||
xmlStrlen((const xmlChar *) cur), 0, userData));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseDoc:
|
||||
* @cur: a pointer to an array of xmlChar
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
*
|
||||
* parse an SGML in-memory document and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseDoc(cur));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* docbCreateFileParserCtxt:
|
||||
* @filename: the filename
|
||||
* @encoding: the SGML document encoding, or NULL
|
||||
*
|
||||
* Create a parser context for a file content.
|
||||
* Automatic support for ZLIB/Compress compressed document is provided
|
||||
* by default if found at compile-time.
|
||||
*
|
||||
* Returns the new parser context or NULL
|
||||
*/
|
||||
docbParserCtxtPtr
|
||||
docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbCreateFileParserCtxt() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlCreateFileParserCtxt(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbSAXParseFile:
|
||||
* @filename: the filename
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
* @sax: the SAX handler block
|
||||
* @userData: if using SAX, this pointer will be provided on callbacks.
|
||||
*
|
||||
* parse an SGML file and build a tree. Automatic support for ZLIB/Compress
|
||||
* compressed document is provided by default if found at compile-time.
|
||||
* It use the given SAX function block to handle the parsing callback.
|
||||
* If sax is NULL, fallback to the default DOM tree building routines.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbSAXParseFile(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED,
|
||||
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *userData ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbSAXParseFile() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlSAXParseFileWithData(sax, filename, 0, userData));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseFile:
|
||||
* @filename: the filename
|
||||
* @encoding: a free form C string describing document encoding, or NULL
|
||||
*
|
||||
* parse a Docbook SGML file and build a tree. Automatic support for
|
||||
* ZLIB/Compress compressed document is provided by default if found
|
||||
* at compile-time.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbParseFile(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseFile() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseFile(filename));
|
||||
}
|
||||
#define bottom_DOCBparser
|
||||
#include "elfgcchack.h"
|
||||
#endif /* LIBXML_DOCB_ENABLED */
|
||||
37
DesktopEditor/xml/libxml2/HACKING
Normal file
37
DesktopEditor/xml/libxml2/HACKING
Normal file
@ -0,0 +1,37 @@
|
||||
NOTE:
|
||||
- the head of this module is package libxml-2 . There is incompatibilities
|
||||
with the old libxml-1 headers. I posted on gnome-hackers a recipe to
|
||||
change your code to compile with both, check it out ! Also read
|
||||
http://xmlsoft.org/upgrade.html
|
||||
- in the meantime the old 1.x code has been tagged with LIB_XML_1_BRANCH
|
||||
extract this version and drop me a mail if you want me to take care of
|
||||
the update of your module to libxml-2 <daniel@veillard.com>
|
||||
- the 1.x branch has a separate commit policy, please check the HACKING
|
||||
file for this branch
|
||||
|
||||
Rules for commits on the gnome-xml module
|
||||
=========================================
|
||||
|
||||
BEFORE READING FURTHER: DO NOT COMMIT DIRECTLY !
|
||||
|
||||
In the exceptional case where a serious breakage in this module
|
||||
prevents other core projects from making progress, then feel free
|
||||
to patch first and send mail afterward as long as the changes are limited.
|
||||
Please keep in mind that a large part of my user base is on Windows, so
|
||||
be careful with potential portability problems there.
|
||||
|
||||
Otherwise, send me (veillard@redhat.com) a mail and if it's a bug
|
||||
issue, register it at bugzilla.gnome.org (module libxml). I check both
|
||||
my mail and the bug database on a regular basis. If you don't get an
|
||||
answer within a week (which is highly unprobable) then commit your changes.
|
||||
This simply mean that I'm on holliday or on the road.
|
||||
|
||||
thanks in advance for following the rule,
|
||||
|
||||
Daniel
|
||||
|
||||
P.S.: Bjorn Reese, William Brack, Thomas Broyer, Igor Zlatkovic and
|
||||
Aleksey Sanin get an exception for the send before commit rule
|
||||
as well as John Fleck for the doc maintenance Send them mail if
|
||||
I don't answer to request in a timely fashion
|
||||
|
||||
7165
DesktopEditor/xml/libxml2/HTMLparser.c
Normal file
7165
DesktopEditor/xml/libxml2/HTMLparser.c
Normal file
File diff suppressed because it is too large
Load Diff
1281
DesktopEditor/xml/libxml2/HTMLtree.c
Normal file
1281
DesktopEditor/xml/libxml2/HTMLtree.c
Normal file
File diff suppressed because it is too large
Load Diff
61
DesktopEditor/xml/libxml2/INSTALL.libxml2
Normal file
61
DesktopEditor/xml/libxml2/INSTALL.libxml2
Normal file
@ -0,0 +1,61 @@
|
||||
Extracted from the documentation:
|
||||
http://xmlsoft.org/FAQ.html#Compilatio
|
||||
|
||||
See also the generic INSTALL file for configure options
|
||||
|
||||
Compilation
|
||||
|
||||
1.What is the process to compile libxml ?
|
||||
|
||||
As most UNIX libraries libxml follows the "standard":
|
||||
|
||||
gunzip -c xxx.tar.gz | tar xvf -
|
||||
|
||||
cd libxml-xxxx
|
||||
|
||||
./configure --help
|
||||
|
||||
to see the options, then the compilation/installation proper
|
||||
|
||||
./configure [possible options]
|
||||
|
||||
make
|
||||
|
||||
make install
|
||||
|
||||
At that point you may have to rerun ldconfig or similar utility to
|
||||
update your list of installed shared libs.
|
||||
|
||||
At this point you can check that the library is properly functionning
|
||||
by running
|
||||
|
||||
make tests
|
||||
|
||||
2.What other libraries are needed to compile/install libxml ?
|
||||
|
||||
Libxml does not requires any other library, the normal C ANSI API
|
||||
should be sufficient (please report any violation to this rule you
|
||||
may find).
|
||||
|
||||
However if found at configuration time libxml will detect and use
|
||||
the following libs:
|
||||
|
||||
libz: a highly portable and available widely compression library
|
||||
http://www.info-zip.org/pub/infozip/zlib/
|
||||
iconv: a powerful character encoding conversion library. It's
|
||||
included by default on recent glibc libraries, so it doesn't
|
||||
need to be installed specifically on linux. It seems it's
|
||||
now part of the official UNIX specification. Here is one
|
||||
implementation of the library which source can be found here.
|
||||
http://clisp.cons.org/~haible/packages-libiconv.html
|
||||
ftp://ftp.ilog.fr/pub/Users/haible/gnu/
|
||||
|
||||
3.make tests may fail on some platforms
|
||||
|
||||
Sometime the regression tests results don't completely match the
|
||||
value produced by the parser, and the makefile uses diff to print
|
||||
the delta. On some platforms the diff return breaks the compilation
|
||||
process, if the diff is small this is probably not a serious problem
|
||||
|
||||
Daniel
|
||||
veillard@redhat.com
|
||||
9
DesktopEditor/xml/libxml2/MAINTAINERS
Normal file
9
DesktopEditor/xml/libxml2/MAINTAINERS
Normal file
@ -0,0 +1,9 @@
|
||||
See first http://xmlsoft.org/bugs.html and use the list please.
|
||||
|
||||
Daniel Veillard
|
||||
E-mail: veillard@redhat.com
|
||||
Userid: veillard
|
||||
|
||||
Co-maintainer: William Brack <wbrack@mmm.com.hk>
|
||||
Windows port: Igor Zlatkovic <igor@zlatkovic.com>
|
||||
Rob Richards <rrichards@ctindustries.net>
|
||||
1283
DesktopEditor/xml/libxml2/Makefile.am
Normal file
1283
DesktopEditor/xml/libxml2/Makefile.am
Normal file
File diff suppressed because it is too large
Load Diff
41
DesktopEditor/xml/libxml2/Makefile.tests
Normal file
41
DesktopEditor/xml/libxml2/Makefile.tests
Normal file
@ -0,0 +1,41 @@
|
||||
#
|
||||
# You may have to ajust to call the right compiler, or other oprions
|
||||
# for compiling and linking
|
||||
#
|
||||
|
||||
CFLAGS=`xml2-config --cflags`
|
||||
LIBS=`xml2-config --libs`
|
||||
THREADLIB= -lpthread
|
||||
EXEEXT=
|
||||
|
||||
all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) testchar$(EXEEXT)
|
||||
|
||||
clean:
|
||||
$(RM) runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT)
|
||||
|
||||
check: do_runtest do_testchar do_testapi do_runsuite
|
||||
|
||||
runtest$(EXEEXT): runtest.c
|
||||
$(CC) -o runtest$(EXEEXT) $(CFLAGS) runtest.c $(LIBS) $(THREADLIB)
|
||||
|
||||
do_runtest: runtest$(EXEEXT)
|
||||
./runtest
|
||||
|
||||
runsuite$(EXEEXT): runsuite.c
|
||||
$(CC) -o runsuite$(EXEEXT) $(CFLAGS) runsuite.c $(LIBS)
|
||||
|
||||
do_runsuite: runsuite$(EXEEXT)
|
||||
./runsuite
|
||||
|
||||
testapi$(EXEEXT): testapi.c
|
||||
$(CC) -o testapi$(EXEEXT) $(CFLAGS) testapi.c $(LIBS)
|
||||
|
||||
do_testapi: testapi$(EXEEXT)
|
||||
./testapi
|
||||
|
||||
testchar$(EXEEXT): testchar.c
|
||||
$(CC) -o testchar$(EXEEXT) $(CFLAGS) testchar.c $(LIBS)
|
||||
|
||||
do_testchar: testchar$(EXEEXT)
|
||||
./testchar
|
||||
|
||||
34
DesktopEditor/xml/libxml2/Makefile.win
Normal file
34
DesktopEditor/xml/libxml2/Makefile.win
Normal file
@ -0,0 +1,34 @@
|
||||
# This is a makefile for win32 systems (VC 5.0).
|
||||
# Christopher Blizzard
|
||||
# http://odin.appliedtheory.com/
|
||||
|
||||
CC = cl
|
||||
CFLAGS = /c /GB /Gi /nologo /I. /DWIN32 /MT /Zi
|
||||
|
||||
LD = link
|
||||
LDFLAGS = /DEBUG /NODEFAULTLIB:libc
|
||||
|
||||
AR = lib
|
||||
|
||||
all: xml.lib
|
||||
|
||||
test: tester.exe
|
||||
|
||||
SHARED_OBJS = entities.obj parser.obj tree.obj SAX.obj
|
||||
|
||||
xml.lib: $(SHARED_OBJS)
|
||||
$(AR) /out:xml.lib $(SHARED_OBJS)
|
||||
|
||||
tester.obj: $(SHARED_OBJS)
|
||||
$(CC) $(CFLAGS) tester.c /out:tester.obj
|
||||
|
||||
tester.exe: tester.obj xml.lib
|
||||
$(LD) $(LDFLAGS) /out:tester.exe tester.obj xml.lib
|
||||
|
||||
clean:
|
||||
-del /f $(SHARED_OBJS) tester.obj
|
||||
-del /f tester.exe
|
||||
-del /f xml.lib
|
||||
-del /f *.pdb
|
||||
-del /f *.idb
|
||||
-del /f *.ilk
|
||||
2642
DesktopEditor/xml/libxml2/NEWS
Normal file
2642
DesktopEditor/xml/libxml2/NEWS
Normal file
File diff suppressed because it is too large
Load Diff
39
DesktopEditor/xml/libxml2/README
Normal file
39
DesktopEditor/xml/libxml2/README
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
XML toolkit from the GNOME project
|
||||
|
||||
Full documentation is available on-line at
|
||||
http://xmlsoft.org/
|
||||
|
||||
This code is released under the MIT Licence see the Copyright file.
|
||||
|
||||
To build on an Unixised setup:
|
||||
./configure ; make ; make install
|
||||
To build on Windows:
|
||||
see instructions on win32/Readme.txt
|
||||
|
||||
To assert build quality:
|
||||
on an Unixised setup:
|
||||
run make tests
|
||||
otherwise:
|
||||
There is 3 standalone tools runtest.c runsuite.c testapi.c, which
|
||||
should compile as part of the build or as any application would.
|
||||
Launch them from this directory to get results, runtest checks
|
||||
the proper functionning of libxml2 main APIs while testapi does
|
||||
a full coverage check. Report failures to the list.
|
||||
|
||||
To report bugs, follow the instructions at:
|
||||
http://xmlsoft.org/bugs.html
|
||||
|
||||
A mailing-list xml@gnome.org is available, to subscribe:
|
||||
http://mail.gnome.org/mailman/listinfo/xml
|
||||
|
||||
The list archive is at:
|
||||
http://mail.gnome.org/archives/xml/
|
||||
|
||||
All technical answers asked privately will be automatically answered on
|
||||
the list and archived for public access unless privacy is explicitly
|
||||
required and justified.
|
||||
|
||||
Daniel Veillard
|
||||
|
||||
$Id$
|
||||
5
DesktopEditor/xml/libxml2/README.cvs-commits
Normal file
5
DesktopEditor/xml/libxml2/README.cvs-commits
Normal file
@ -0,0 +1,5 @@
|
||||
Please read the HACKING file for instructions
|
||||
|
||||
Daniel
|
||||
|
||||
$Id$
|
||||
39
DesktopEditor/xml/libxml2/README.tests
Normal file
39
DesktopEditor/xml/libxml2/README.tests
Normal file
@ -0,0 +1,39 @@
|
||||
README.tests
|
||||
|
||||
Instructions for standalone test regressions of libxml2
|
||||
|
||||
libxml2-tests-$version.tar.gz contains 3 standalone C programs as well
|
||||
as a large amount of tests and results coming from libxml2 itself and
|
||||
from W3C, NIST, Sun Microsystems, Microsoft and James Clark. Each C
|
||||
program has a different testing purpose:
|
||||
|
||||
runtest.c : runs libxml2 basic internal regression tests
|
||||
runsuite.c: runs libxml2 against external regression tests
|
||||
testapi.c : exercises the library public entry points
|
||||
testchar.c: exercise the check of character ranges and UTF-8 validation
|
||||
|
||||
The command:
|
||||
|
||||
make check
|
||||
or
|
||||
make -f Makefile.tests check
|
||||
|
||||
should be sufficient on an Unix system to build and exercise the tests
|
||||
for the version of the library installed on the system. Note however
|
||||
that there isn't backward compatibility provided so if the installed
|
||||
version is older than the testsuite one, failing to compile or run the tests
|
||||
is likely. In any event this won't work with an installed libxml2 older
|
||||
than 2.6.20.
|
||||
|
||||
Building on other platforms should be a matter of compiling the C files
|
||||
like any other program using libxml2, running the test should be done
|
||||
simply by launching the resulting executables.
|
||||
|
||||
Also note the availability of a "make valgrind" target which will run the
|
||||
above tests under valgrind to check for memory errors (but this relies
|
||||
on the availability of the valgrind command and take far more time to
|
||||
complete).
|
||||
|
||||
Daniel Veillard
|
||||
Mon May 7 2012
|
||||
|
||||
180
DesktopEditor/xml/libxml2/SAX.c
Normal file
180
DesktopEditor/xml/libxml2/SAX.c
Normal file
@ -0,0 +1,180 @@
|
||||
/*
|
||||
* SAX.c : Old SAX v1 handlers to build a tree.
|
||||
* Deprecated except for compatibility
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* Daniel Veillard <daniel@veillard.com>
|
||||
*/
|
||||
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/valid.h>
|
||||
#include <libxml/entities.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/debugXML.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/uri.h>
|
||||
#include <libxml/valid.h>
|
||||
#include <libxml/HTMLtree.h>
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/SAX2.h>
|
||||
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
/**
|
||||
* initxmlDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
* @warning: flag if non-zero sets the handler warning procedure
|
||||
*
|
||||
* Initialize the default XML SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning)
|
||||
{
|
||||
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = xmlSAX2ExternalSubset;
|
||||
hdlr->isStandalone = xmlSAX2IsStandalone;
|
||||
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
|
||||
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
|
||||
hdlr->resolveEntity = xmlSAX2ResolveEntity;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
|
||||
hdlr->entityDecl = xmlSAX2EntityDecl;
|
||||
hdlr->attributeDecl = xmlSAX2AttributeDecl;
|
||||
hdlr->elementDecl = xmlSAX2ElementDecl;
|
||||
hdlr->notationDecl = xmlSAX2NotationDecl;
|
||||
hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = xmlSAX2Reference;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = xmlSAX2CDataBlock;
|
||||
hdlr->ignorableWhitespace = xmlSAX2Characters;
|
||||
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
|
||||
if (warning == 0)
|
||||
hdlr->warning = NULL;
|
||||
else
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
|
||||
/**
|
||||
* inithtmlDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
*
|
||||
* Initialize the default HTML SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
inithtmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
|
||||
{
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = NULL;
|
||||
hdlr->isStandalone = NULL;
|
||||
hdlr->hasInternalSubset = NULL;
|
||||
hdlr->hasExternalSubset = NULL;
|
||||
hdlr->resolveEntity = NULL;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = NULL;
|
||||
hdlr->entityDecl = NULL;
|
||||
hdlr->attributeDecl = NULL;
|
||||
hdlr->elementDecl = NULL;
|
||||
hdlr->notationDecl = NULL;
|
||||
hdlr->unparsedEntityDecl = NULL;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = NULL;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = xmlSAX2CDataBlock;
|
||||
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
|
||||
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
|
||||
hdlr->comment = xmlSAX2Comment;
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#endif /* LIBXML_HTML_ENABLED */
|
||||
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
/**
|
||||
* initdocbDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
*
|
||||
* Initialize the default DocBook SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitDocbDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
initdocbDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
|
||||
{
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = NULL;
|
||||
hdlr->isStandalone = xmlSAX2IsStandalone;
|
||||
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
|
||||
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
|
||||
hdlr->resolveEntity = xmlSAX2ResolveEntity;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = NULL;
|
||||
hdlr->entityDecl = xmlSAX2EntityDecl;
|
||||
hdlr->attributeDecl = NULL;
|
||||
hdlr->elementDecl = NULL;
|
||||
hdlr->notationDecl = NULL;
|
||||
hdlr->unparsedEntityDecl = NULL;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = xmlSAX2Reference;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = NULL;
|
||||
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
|
||||
hdlr->processingInstruction = NULL;
|
||||
hdlr->comment = xmlSAX2Comment;
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#endif /* LIBXML_DOCB_ENABLED */
|
||||
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
||||
#define bottom_SAX
|
||||
#include "elfgcchack.h"
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
3046
DesktopEditor/xml/libxml2/SAX2.c
Normal file
3046
DesktopEditor/xml/libxml2/SAX2.c
Normal file
File diff suppressed because it is too large
Load Diff
278
DesktopEditor/xml/libxml2/TODO
Normal file
278
DesktopEditor/xml/libxml2/TODO
Normal file
@ -0,0 +1,278 @@
|
||||
124907 HTML parse buffer problem when parsing larse in-memory docs
|
||||
124110 DTD validation && wrong namespace
|
||||
123564 xmllint --html --format
|
||||
|
||||
TODO for the XML parser and stuff:
|
||||
==================================
|
||||
|
||||
$Id$
|
||||
|
||||
this tend to be outdated :-\ ...
|
||||
|
||||
DOCS:
|
||||
=====
|
||||
|
||||
- use case of using XInclude to load for example a description.
|
||||
order document + product base -(XSLT)-> quote with XIncludes
|
||||
|
|
||||
HTML output with description of parts <---(XSLT)--
|
||||
|
||||
TODO:
|
||||
=====
|
||||
- XInclude at the SAX level (libSRVG)
|
||||
- fix the C code prototype to bring back doc/libxml-undocumented.txt
|
||||
to a reasonable level
|
||||
- Computation of base when HTTP redirect occurs, might affect HTTP
|
||||
interfaces.
|
||||
- Computation of base in XInclude. Relativization of URIs.
|
||||
- listing all attributes in a node.
|
||||
- Better checking of external parsed entities TAG 1234
|
||||
- Go through erratas and do the cleanup.
|
||||
http://www.w3.org/XML/xml-19980210-errata ... started ...
|
||||
- jamesh suggestion: SAX like functions to save a document ie. call a
|
||||
function to open a new element with given attributes, write character
|
||||
data, close last element, etc
|
||||
+ inversted SAX, initial patch in April 2002 archives.
|
||||
- htmlParseDoc has parameter encoding which is not used.
|
||||
Function htmlCreateDocParserCtxt ignore it.
|
||||
- fix realloc() usage.
|
||||
- Stricten the UTF8 conformance (Martin Duerst):
|
||||
http://www.w3.org/2001/06/utf-8-test/.
|
||||
The bad files are in http://www.w3.org/2001/06/utf-8-wrong/.
|
||||
- xml:id normalized value
|
||||
|
||||
TODO:
|
||||
=====
|
||||
|
||||
- move all string manipulation functions (xmlStrdup, xmlStrlen, etc.) to
|
||||
global.c. Bjorn noted that the following files depends on parser.o solely
|
||||
because of these string functions: entities.o, global.o, hash.o, tree.o,
|
||||
xmlIO.o, and xpath.o.
|
||||
|
||||
- Optimization of tag strings allocation ?
|
||||
|
||||
- maintain coherency of namespace when doing cut'n paste operations
|
||||
=> the functions are coded, but need testing
|
||||
|
||||
- function to rebuild the ID table
|
||||
- functions to rebuild the DTD hash tables (after DTD changes).
|
||||
|
||||
|
||||
EXTENSIONS:
|
||||
===========
|
||||
|
||||
- Tools to produce man pages from the SGML docs.
|
||||
|
||||
- Add Xpointer recognition/API
|
||||
|
||||
- Add Xlink recognition/API
|
||||
=> started adding an xlink.[ch] with a unified API for XML and HTML.
|
||||
it's crap :-(
|
||||
|
||||
- Implement XSchemas
|
||||
=> Really need to be done <grin/>
|
||||
- datatype are complete, but structure support is very limited.
|
||||
|
||||
- extend the shell with:
|
||||
- edit
|
||||
- load/save
|
||||
- mv (yum, yum, but it's harder because directories are ordered in
|
||||
our case, mvup and mvdown would be required)
|
||||
|
||||
|
||||
Done:
|
||||
=====
|
||||
|
||||
- Add HTML validation using the XHTML DTD
|
||||
- problem: do we want to keep and maintain the code for handling
|
||||
DTD/System ID cache directly in libxml ?
|
||||
=> not really done that way, but there are new APIs to check elements
|
||||
or attributes. Otherwise XHTML validation directly ...
|
||||
|
||||
- XML Schemas datatypes except Base64 and BinHex
|
||||
|
||||
- Relax NG validation
|
||||
|
||||
- XmlTextReader streaming API + validation
|
||||
|
||||
- Add a DTD cache prefilled with xhtml DTDs and entities and a program to
|
||||
manage them -> like the /usr/bin/install-catalog from SGML
|
||||
right place seems $datadir/xmldtds
|
||||
Maybe this is better left to user apps
|
||||
=> use a catalog instead , and xhtml1-dtd package
|
||||
|
||||
- Add output to XHTML
|
||||
=> XML serializer automatically recognize the DTd and apply the specific
|
||||
rules.
|
||||
|
||||
- Fix output of <tst val="x
y"/>
|
||||
|
||||
- compliance to XML-Namespace checking, see section 6 of
|
||||
http://www.w3.org/TR/REC-xml-names/
|
||||
|
||||
- Correct standalone checking/emitting (hard)
|
||||
2.9 Standalone Document Declaration
|
||||
|
||||
- Implement OASIS XML Catalog support
|
||||
http://www.oasis-open.org/committees/entity/
|
||||
|
||||
- Get OASIS testsuite to a more friendly result, check all the results
|
||||
once stable. the check-xml-test-suite.py script does this
|
||||
|
||||
- Implement XSLT
|
||||
=> libxslt
|
||||
|
||||
- Finish XPath
|
||||
=> attributes addressing troubles
|
||||
=> defaulted attributes handling
|
||||
=> namespace axis ?
|
||||
done as XSLT got debugged
|
||||
|
||||
- bug reported by Michael Meallin on validation problems
|
||||
=> Actually means I need to add support (and warn) for non-deterministic
|
||||
content model.
|
||||
- Handle undefined namespaces in entity contents better ... at least
|
||||
issue a warning
|
||||
- DOM needs
|
||||
int xmlPruneProp(xmlNodePtr node, xmlAtttrPtr attr);
|
||||
=> done it's actually xmlRemoveProp xmlUnsetProp xmlUnsetNsProp
|
||||
|
||||
- HTML: handling of Script and style data elements, need special code in
|
||||
the parser and saving functions (handling of < > " ' ...):
|
||||
http://www.w3.org/TR/html4/types.html#type-script
|
||||
Attributes are no problems since entities are accepted.
|
||||
- DOM needs
|
||||
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value)
|
||||
- problem when parsing hrefs with & with the HTML parser (IRC ac)
|
||||
- If the internal encoding is not UTF8 saving to a given encoding doesn't
|
||||
work => fix to force UTF8 encoding ...
|
||||
done, added documentation too
|
||||
- Add an ASCII I/O encoder (asciiToUTF8 and UTF8Toascii)
|
||||
- Issue warning when using non-absolute namespaces URI.
|
||||
- the html parser should add <head> and <body> if they don't exist
|
||||
started, not finished.
|
||||
Done, the automatic closing is added and 3 testcases were inserted
|
||||
- Command to force the parser to stop parsing and ignore the rest of the file.
|
||||
xmlStopParser() should allow this, mostly untested
|
||||
- support for HTML empty attributes like <hr noshade>
|
||||
- plugged iconv() in for support of a large set of encodings.
|
||||
- xmlSwitchToEncoding() rewrite done
|
||||
- URI checkings (no fragments) rfc2396.txt
|
||||
- Added a clean mechanism for overload or added input methods:
|
||||
xmlRegisterInputCallbacks()
|
||||
- dynamically adapt the alloc entry point to use g_alloc()/g_free()
|
||||
if the programmer wants it:
|
||||
- use xmlMemSetup() to reset the routines used.
|
||||
- Check attribute normalization especially xmlGetProp()
|
||||
- Validity checking problems for NOTATIONS attributes
|
||||
- Validity checking problems for ENTITY ENTITIES attributes
|
||||
- Parsing of a well balanced chunk xmlParseBalancedChunkMemory()
|
||||
- URI module: validation, base, etc ... see uri.[ch]
|
||||
- turn tester into a generic program xmllint installed with libxml
|
||||
- extend validity checks to go through entities content instead of
|
||||
just labelling them PCDATA
|
||||
- Save Dtds using the children list instead of dumping the tables,
|
||||
order is preserved as well as comments and PIs
|
||||
- Wrote a notice of changes requires to go from 1.x to 2.x
|
||||
- make sure that all SAX callbacks are disabled if a WF error is detected
|
||||
- checking/handling of newline normalization
|
||||
http://localhost/www.xml.com/axml/target.html#sec-line-ends
|
||||
- correct checking of '&' '%' on entities content.
|
||||
- checking of PE/Nesting on entities declaration
|
||||
- checking/handling of xml:space
|
||||
- checking done.
|
||||
- handling done, not well tested
|
||||
- Language identification code, productions [33] to [38]
|
||||
=> done, the check has been added and report WFness errors
|
||||
- Conditional sections in DTDs [61] to [65]
|
||||
=> should this crap be really implemented ???
|
||||
=> Yep OASIS testsuite uses them
|
||||
- Allow parsed entities defined in the internal subset to override
|
||||
the ones defined in the external subset (DtD customization).
|
||||
=> This mean that the entity content should be computed only at
|
||||
use time, i.e. keep the orig string only at parse time and expand
|
||||
only when referenced from the external subset :-(
|
||||
Needed for complete use of most DTD from Eve Maler
|
||||
- Add regression tests for all WFC errors
|
||||
=> did some in test/WFC
|
||||
=> added OASIS testsuite routines
|
||||
http://xmlsoft.org/conf/result.html
|
||||
|
||||
- I18N: http://wap.trondheim.com/vaer/index.phtml is not XML and accepted
|
||||
by the XML parser, UTF-8 should be checked when there is no "encoding"
|
||||
declared !
|
||||
- Support for UTF-8 and UTF-16 encoding
|
||||
=> added some convertion routines provided by Martin Durst
|
||||
patched them, got fixes from @@@
|
||||
I plan to keep everything internally as UTF-8 (or ISO-Latin-X)
|
||||
this is slightly more costly but more compact, and recent processors
|
||||
efficiency is cache related. The key for good performances is keeping
|
||||
the data set small, so will I.
|
||||
=> the new progressive reading routines call the detection code
|
||||
is enabled, tested the ISO->UTF-8 stuff
|
||||
- External entities loading:
|
||||
- allow override by client code
|
||||
- make sure it is alled for all external entities referenced
|
||||
Done, client code should use xmlSetExternalEntityLoader() to set
|
||||
the default loading routine. It will be called each time an external
|
||||
entity entity resolution is triggered.
|
||||
- maintain ID coherency when removing/changing attributes
|
||||
The function used to deallocate attributes now check for it being an
|
||||
ID and removes it from the table.
|
||||
- push mode parsing i.e. non-blocking state based parser
|
||||
done, both for XML and HTML parsers. Use xmlCreatePushParserCtxt()
|
||||
and xmlParseChunk() and html counterparts.
|
||||
The tester program now has a --push option to select that parser
|
||||
front-end. Douplicated tests to use both and check results are similar.
|
||||
|
||||
- Most of XPath, still see some troubles and occasionnal memleaks.
|
||||
- an XML shell, allowing to traverse/manipulate an XML document with
|
||||
a shell like interface, and using XPath for the anming syntax
|
||||
- use of readline and history added when available
|
||||
- the shell interface has been cleanly separated and moved to debugXML.c
|
||||
- HTML parser, should be fairly stable now
|
||||
- API to search the lang of an attribute
|
||||
- Collect IDs at parsing and maintain a table.
|
||||
PBM: maintain the table coherency
|
||||
PBM: how to detect ID types in absence of DtD !
|
||||
- Use it for XPath ID support
|
||||
- Add validity checking
|
||||
Should be finished now !
|
||||
- Add regression tests with entity substitutions
|
||||
|
||||
- External Parsed entities, either XML or external Subset [78] and [79]
|
||||
parsing the xmllang DtD now works, so it should be sufficient for
|
||||
most cases !
|
||||
|
||||
- progressive reading. The entity support is a first step toward
|
||||
asbtraction of an input stream. A large part of the context is still
|
||||
located on the stack, moving to a state machine and putting everyting
|
||||
in the parsing context should provide an adequate solution.
|
||||
=> Rather than progressive parsing, give more power to the SAX-like
|
||||
interface. Currently the DOM-like representation is built but
|
||||
=> it should be possible to define that only as a set of SAX callbacks
|
||||
and remove the tree creation from the parser code.
|
||||
DONE
|
||||
|
||||
- DOM support, instead of using a proprietary in memory
|
||||
format for the document representation, the parser should
|
||||
call a DOM API to actually build the resulting document.
|
||||
Then the parser becomes independent of the in-memory
|
||||
representation of the document. Even better using RPC's
|
||||
the parser can actually build the document in another
|
||||
program.
|
||||
=> Work started, now the internal representation is by default
|
||||
very near a direct DOM implementation. The DOM glue is implemented
|
||||
as a separate module. See the GNOME gdome module.
|
||||
|
||||
- C++ support : John Ehresman <jehresma@dsg.harvard.edu>
|
||||
- Updated code to follow more recent specs, added compatibility flag
|
||||
- Better error handling, use a dedicated, overridable error
|
||||
handling function.
|
||||
- Support for CDATA.
|
||||
- Keep track of line numbers for better error reporting.
|
||||
- Support for PI (SAX one).
|
||||
- Support for Comments (bad, should be in ASAP, they are parsed
|
||||
but not stored), should be configurable.
|
||||
- Improve the support of entities on save (+SAX).
|
||||
|
||||
31
DesktopEditor/xml/libxml2/TODO_SCHEMAS
Normal file
31
DesktopEditor/xml/libxml2/TODO_SCHEMAS
Normal file
@ -0,0 +1,31 @@
|
||||
- implement counted transitions at the automata level
|
||||
|
||||
- Unicode:
|
||||
+ upgrade to 3.2
|
||||
+ improve the python script to generate better test
|
||||
expressions to check the list of ranges.
|
||||
|
||||
- Implement the interface at the SAX level
|
||||
|
||||
- Implement the missing parts in the Structure part
|
||||
+ all content model
|
||||
+ enumerations
|
||||
+ countless others c.f. the TODO scattered in the code
|
||||
|
||||
- Complete the Built-In datatype collections and Facets implementations
|
||||
|
||||
- Regression tests based on
|
||||
+ the primer:
|
||||
http://www.w3.org/TR/xmlschema-0/
|
||||
+ the Schemas Test Collection:
|
||||
http://www.w3.org/2001/05/xmlschema-test-collection/
|
||||
+ archives of the schemas-dev list
|
||||
|
||||
- Integrity constraints:
|
||||
+ what's that ? How need to read about it
|
||||
|
||||
- "formal" checking, i.e. go through the full Structure spec and
|
||||
bind code and associated parts of the Schemas spec
|
||||
|
||||
- go though the erratas
|
||||
http://www.w3.org/2001/05/xmlschema-errata
|
||||
86
DesktopEditor/xml/libxml2/VxWorks/README
Normal file
86
DesktopEditor/xml/libxml2/VxWorks/README
Normal file
@ -0,0 +1,86 @@
|
||||
libxml2 on VxWorks 6.4+
|
||||
|
||||
Here are my instructions for building on VxWorks.... I am very ashamed of
|
||||
how I did this because it is a complete hack, but it works great, so I
|
||||
can't complain too much.
|
||||
|
||||
General Information
|
||||
|
||||
1. The only way to build for VxWorks is to cross compile from a windows or
|
||||
linux system. We use a RedHat 5.1 workstation system as our build
|
||||
environment.
|
||||
|
||||
2. VxWorks 6.X has two main types of executable, DKMs (dynamic kernel
|
||||
modules), and RTPs (real-time processes). Kernel modules are the bread
|
||||
and butter of VxWorks, but they look nothing like processes/threads in
|
||||
normal UNIX/Windows systems. RTPs are more like processes that have
|
||||
memory protection, threads, etc. VxWorks 6.X also introduces some level
|
||||
of POSIX conformance to their environment. The POSIX conformance was the
|
||||
key for us to be able to port libxml2. We support accessing libxml2 from
|
||||
both DKMs and RTPs.
|
||||
|
||||
3. There are 2 compilers for VxWorks, the WindRiver compiler, and a port
|
||||
of the GNU toolchain, we have only tested and built with the GNU
|
||||
toolchain.
|
||||
|
||||
How To Build
|
||||
|
||||
1. Run the configure on your native linux system (this is the cheesy
|
||||
hack). Since the VxWorks GNU toolchain is very close in version to the
|
||||
one in red hat, it generates a good config.h file. We configured libxml2
|
||||
with the following to keep the size down, (but we have done basic testing
|
||||
with everything compiled in).
|
||||
|
||||
./configure --with-minimum --with-reader --with-writer --with-regexps
|
||||
--with-threads --with-thread-alloc
|
||||
|
||||
2. Rename the libxml2 folder to "src". This step is required for our
|
||||
replacement makefile to work.
|
||||
|
||||
3. Run the replacement makefile. I wrote a new makefile that sets all the
|
||||
proper vxworks defines and uses the correct compilers. The two defines on
|
||||
the make command line are to tell it which VxWorks Target (SH3.2 little
|
||||
endian), and the executable type. We have tested this code on PENTIUM2gnu
|
||||
and SH32gnule.
|
||||
|
||||
This makefile creates a shared library that runs on VxWorks: (libxml2.so)
|
||||
make -f Makefile.vxworks clean all VXCPU=SH32gnule VXTYPE=RTP
|
||||
|
||||
This makefile creates a kernel module that runs on VxWorks: (xml2.out)
|
||||
make -f Makefile.vxworks clean all VXCPU=SH32gnule VXTYPE=DKM
|
||||
|
||||
Important Notes
|
||||
|
||||
1. There are several ways that this process could be improved, but at the
|
||||
end of the day, we make products, not port libraries, so we did a meets
|
||||
minimum for our needs.
|
||||
|
||||
2. VxWorks is the devil, give me embedded linux every day.
|
||||
|
||||
3. No matter what I tried, I couldn't get the configure to pick up the
|
||||
VxWorks toolchain, and in my investigation, it has something to do with
|
||||
automake/autoconf, not any individual package. VxWorks doesn't play by
|
||||
the normal rules for building toolchains.
|
||||
|
||||
4. The PIC flag in VxWorks (especially for SH processors) is very
|
||||
important, and very troublesome. On linux, you can liberally use the PIC
|
||||
flag when compiling and the compiler/linker will ignore it as needed, on
|
||||
VxWorks if must always be on for shared libraries, and always be off for
|
||||
static libraries and executables.
|
||||
|
||||
5. If anyone wants to work on a better way to do the build of libxml2 for
|
||||
VxWorks, I'm happy to help as much as I can, but I'm not looking to
|
||||
support it myself.
|
||||
|
||||
Attached Files
|
||||
|
||||
1. To use my Makefile for vxworks, you should enter the vxworks
|
||||
environment (/opt/windriver/wrenv.linux -p vxworks-6.4 for me).
|
||||
2. Run: build.sh libxml2-2.6.32 SH32gnule RTP (where you have
|
||||
libxml2-2.6.32.tar.gz and the Makefile in the same directory as the script
|
||||
file).
|
||||
|
||||
Thanks,
|
||||
|
||||
Jim Wert Jr.
|
||||
JWert@ILSTechnology.com
|
||||
85
DesktopEditor/xml/libxml2/VxWorks/build.sh
Normal file
85
DesktopEditor/xml/libxml2/VxWorks/build.sh
Normal file
@ -0,0 +1,85 @@
|
||||
LIBXML2=$1
|
||||
TARGETCPU=$2
|
||||
TARGETTYPE=$3
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
TARGETCPU=SIMPENTIUMgnu
|
||||
fi
|
||||
|
||||
if [ -z "$3" ]; then
|
||||
TARGETTYPE=RTP
|
||||
fi
|
||||
|
||||
echo "LIBXML2 Version: ${LIBXML2}"
|
||||
echo "LIBXML2 Target CPU: ${TARGETCPU}"
|
||||
echo "LIBXML2 Target Type: ${TARGETTYPE}"
|
||||
|
||||
rm -fR src
|
||||
tar xvzf ${LIBXML2}.tar.gz
|
||||
mv ${LIBXML2} src
|
||||
cd src
|
||||
|
||||
./configure --with-minimum --with-reader --with-writer --with-regexps --with-threads --with-thread-alloc
|
||||
|
||||
find . -name '*.in' -exec rm -fR {} +
|
||||
find . -name '*.am' -exec rm -fR {} +
|
||||
rm -fR *.m4
|
||||
rm -fR *.pc
|
||||
rm -fR *.pl
|
||||
rm -fR *.py
|
||||
rm -fR *.spec
|
||||
rm -fR .deps
|
||||
rm -fR AUTHORS
|
||||
rm -fR bakefile
|
||||
rm -fR ChangeLog
|
||||
rm -fR config.guess
|
||||
rm -fR config.log
|
||||
rm -fR config.status
|
||||
rm -fR config.stub
|
||||
rm -fR config.sub
|
||||
rm -fR configure
|
||||
rm -fR COPYING
|
||||
rm -fR Copyright
|
||||
rm -fR depcomp
|
||||
rm -fR doc
|
||||
rm -fR example
|
||||
rm -fR INSTALL
|
||||
rm -fR install-sh
|
||||
rm -fR libxml.3
|
||||
rm -fR ltmain.sh
|
||||
rm -fR Makefile
|
||||
rm -fR Makefile.tests
|
||||
rm -fR macos
|
||||
rm -fR mkinstalldirs
|
||||
rm -fR missing
|
||||
rm -fR nanoftp.c
|
||||
rm -fR nanohttp.c
|
||||
rm -fR NEWS
|
||||
rm -fR python
|
||||
rm -fR README
|
||||
rm -fR README.tests
|
||||
rm -fR regressions.xml
|
||||
rm -fR result
|
||||
rm -fR runsuite.c
|
||||
rm -fR runtest.c
|
||||
rm -fR test
|
||||
rm -fR test*.c
|
||||
rm -fR TODO*
|
||||
rm -fR trio*
|
||||
rm -fR vms
|
||||
rm -fR win32
|
||||
rm -fR xml2*
|
||||
rm -fR xmllint.c
|
||||
rm -fR xstc
|
||||
|
||||
cd ..
|
||||
|
||||
make clean all VXCPU=${TARGETCPU} VXTYPE=${TARGETTYPE}
|
||||
|
||||
if [ "${TARGETTYPE}" = "RTP" ]; then
|
||||
cp libxml2.so ../../lib/.
|
||||
else
|
||||
cp xml2.out ../../bin/.
|
||||
fi
|
||||
|
||||
cp -R src/include/libxml ../../include/.
|
||||
28
DesktopEditor/xml/libxml2/acinclude.m4
Normal file
28
DesktopEditor/xml/libxml2/acinclude.m4
Normal file
@ -0,0 +1,28 @@
|
||||
dnl Like AC_TRY_EVAL but also errors out if the compiler generates
|
||||
dnl _any_ output. Some compilers might issue warnings which we want
|
||||
dnl to catch.
|
||||
AC_DEFUN([AC_TRY_EVAL2],
|
||||
[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl
|
||||
(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
|
||||
|
||||
dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
|
||||
AC_DEFUN([AC_TRY_COMPILE2],
|
||||
[cat > conftest.$ac_ext <<EOF
|
||||
[#]line __oline__ "configure"
|
||||
#include "confdefs.h"
|
||||
[$1]
|
||||
int main(void) {
|
||||
[$2]
|
||||
; return 0; }
|
||||
EOF
|
||||
if AC_TRY_EVAL2(ac_compile); then
|
||||
ifelse([$3], , :, [rm -rf conftest*
|
||||
$3])
|
||||
else
|
||||
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
|
||||
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
|
||||
ifelse([$4], , , [ rm -rf conftest*
|
||||
$4
|
||||
])dnl
|
||||
fi
|
||||
rm -f conftest*])
|
||||
81
DesktopEditor/xml/libxml2/autogen.sh
Normal file
81
DesktopEditor/xml/libxml2/autogen.sh
Normal file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
THEDIR=`pwd`
|
||||
cd $srcdir
|
||||
DIE=0
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have autoconf installed to compile libxml."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or see http://www.gnu.org/software/autoconf"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(libtoolize --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have libtool installed to compile libxml."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or see http://www.gnu.org/software/libtool"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
(automake --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
DIE=1
|
||||
echo "You must have automake installed to compile libxml."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or see http://www.gnu.org/software/automake"
|
||||
}
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test -f entities.c || {
|
||||
echo "You must run this script in the top-level libxml directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
EXTRA_ARGS=
|
||||
if test "x$1" = "x--system"; then
|
||||
shift
|
||||
prefix=/usr
|
||||
libdir=$prefix/lib
|
||||
sysconfdir=/etc
|
||||
localstatedir=/var
|
||||
if [ -d /usr/lib64 ]; then
|
||||
libdir=$prefix/lib64
|
||||
fi
|
||||
EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
|
||||
echo "Running ./configure with $EXTRA_ARGS $@"
|
||||
else
|
||||
if test -z "$NOCONFIGURE" && test -z "$*"; then
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d $srcdir/m4 ]; then
|
||||
mkdir $srcdir/m4
|
||||
fi
|
||||
|
||||
# Replaced by autoreconf below
|
||||
autoreconf -if -Wall
|
||||
|
||||
cd $THEDIR
|
||||
|
||||
if test x$OBJ_DIR != x; then
|
||||
mkdir -p "$OBJ_DIR"
|
||||
cd "$OBJ_DIR"
|
||||
fi
|
||||
|
||||
if test -z "$NOCONFIGURE"; then
|
||||
$srcdir/configure $EXTRA_ARGS "$@"
|
||||
echo
|
||||
echo "Now type 'make' to compile libxml2."
|
||||
fi
|
||||
15
DesktopEditor/xml/libxml2/bakefile/Bakefiles.bkgen
Normal file
15
DesktopEditor/xml/libxml2/bakefile/Bakefiles.bkgen
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- $Id$ -->
|
||||
|
||||
<bakefile-gen>
|
||||
|
||||
<disable-formats>gnu,dmars,cbx_unix,cbuilderx</disable-formats>
|
||||
<input>libxml2.bkl</input>
|
||||
|
||||
<!-- List of output formats to generate: -->
|
||||
<add-formats>
|
||||
borland,dmars,mingw,msvc,msvc6prj,watcom,cbuilderx,cbx_unix,gnu
|
||||
</add-formats>
|
||||
|
||||
|
||||
</bakefile-gen>
|
||||
92
DesktopEditor/xml/libxml2/bakefile/Readme.txt
Normal file
92
DesktopEditor/xml/libxml2/bakefile/Readme.txt
Normal file
@ -0,0 +1,92 @@
|
||||
|
||||
LIBXML2 build system for Win32 README
|
||||
-------------------------------------
|
||||
|
||||
In this folder are stored all the files required to compile LIBXML2 with win32 compilers.
|
||||
Bakefile (http://bakefile.sourceforge.net) is used as makefile generator.
|
||||
|
||||
Supported makefiles:
|
||||
- makefile.vc for Microsoft NMAKE
|
||||
- makefile.bcc for Borland MAKE
|
||||
- makefile.wat for OpenWatcom MAKE
|
||||
- makefile.gcc for MinGW MINGW32-MAKE
|
||||
- all DSP & DSW for Microsoft VisualC++ 6.0 (can be used also with VS.NET AFAIK)
|
||||
|
||||
This readme is organized as:
|
||||
1.0 HOWTO compile LIBXML2 using makefiles <-- for users who want to build the library using *command-line*
|
||||
1.1 HOWTO compile LIBXML2 using an IDE <-- for users who want to build the library using an *IDE*
|
||||
1.2 HOWTO regenerate makefiles for LIBXML2 <-- for libxml2 mantainers/developers/advanced users
|
||||
|
||||
If you just want to compile the library (and the test programs) you should definitely avoid the
|
||||
section 1.1 and focus on the 1.0.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1.0 HOWTO compile LIBXML2 using makefiles
|
||||
-----------------------------------------
|
||||
|
||||
Choose your preferred compiler among those actually supported (see above) and then run
|
||||
|
||||
mycompilermake -fmakefile.makefileext [options]
|
||||
|
||||
for a full list of the available options you should open with a notepad (or something like that)
|
||||
the makefile you want to use; at the beginning you should see a section which starts as:
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# These are configurable options:
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
here you can find all the options actually used by that makefile.
|
||||
They can be customized when running the makefile writing something like:
|
||||
|
||||
nmake -fmakefile.vc BUILD=release
|
||||
mingw32-make -fmakefile.gcc BUILD=debug ICONV_DIR=c:\myiconv
|
||||
|
||||
or they can be permanently changed modifying the makefile.
|
||||
That's all: for any problem/compile-error/suggestion, write to
|
||||
frm@users.sourceforge.net with the word "libxml2" in the subject.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1.1 HOWTO compile LIBXML2 using an IDE
|
||||
--------------------------------------
|
||||
|
||||
Actually only the Microsoft VisualC++ 6.0 project files are generated.
|
||||
In future other Integrated Development Environments (IDEs) will be supported as well.
|
||||
|
||||
With MSVC++ 6.0, you should open the DSW file and then set as the active project the
|
||||
"libxml2" project, if you want to build the library or one of the test projects if you
|
||||
want to run them.
|
||||
Using the command "Build->Set Active Configuration" you can choose one of the predefined
|
||||
configuration.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1.2 HOWTO regenerate makefiles for LIBXML2
|
||||
------------------------------------------
|
||||
|
||||
Be sure to have installed Bakefile (http://bakefile.sourceforge.net).
|
||||
Just run the "bakefile_gen" command inside the folder containing the "libxml2.bkl" file.
|
||||
NOTE: if you want to remove all the makefiles, you can use the "bakefile_gen -c" command.
|
||||
|
||||
The template files used to generate all makefiles are only two:
|
||||
- libxml2.bkl (the main one)
|
||||
- Bakefiles.bkgen
|
||||
All the other files can be dinamically regenerated.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If you have problems with the compilation of LIBXML2 under windows (using one of the supported compiler)
|
||||
please write to:
|
||||
|
||||
Francesco Montorsi <frm@users.sourceforge.net>
|
||||
|
||||
749
DesktopEditor/xml/libxml2/bakefile/libxml2.bkl
Normal file
749
DesktopEditor/xml/libxml2/bakefile/libxml2.bkl
Normal file
@ -0,0 +1,749 @@
|
||||
<?xml version="1.0" ?>
|
||||
|
||||
<!-- Author: Francesco Montorsi <frm@users.sourceforge.net> -->
|
||||
<!-- Date: 30/8/2004 -->
|
||||
<!-- Last revision: 26/1/2005 -->
|
||||
|
||||
|
||||
<!-- LIBXML2 BAKEFILE -->
|
||||
<!-- -->
|
||||
<!-- The bakefile used to build the library and the test -->
|
||||
<!-- programs. The makefiles output is put: -->
|
||||
<!-- -->
|
||||
<!-- - in the ..\LIB folder -->
|
||||
<!-- - in the ..\BIN folder -->
|
||||
<!-- -->
|
||||
|
||||
<makefile>
|
||||
|
||||
<using module="datafiles"/>
|
||||
<requires version="0.1.5"/>
|
||||
|
||||
|
||||
<!-- This is a bakefile, that is, a generic template used to -->
|
||||
<!-- generate makefiles ALL supported compilers. -->
|
||||
<!-- To use this project file you need Bakefile installed. -->
|
||||
<!-- With the command "bakefile_gen" you can regen all the -->
|
||||
<!-- makefiles and project files. -->
|
||||
<!-- See http://bakefile.sourceforge.net for more info. -->
|
||||
|
||||
|
||||
<!--
|
||||
This file is divided in:
|
||||
- generic options
|
||||
- generic variables
|
||||
- libxml2 options
|
||||
- libxml2 variables
|
||||
- about config.h creation
|
||||
- templates
|
||||
- libxml2 library target
|
||||
- libxml2 test program targets
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- GENERIC OPTIONS -->
|
||||
<!-- -->
|
||||
|
||||
|
||||
<!-- This is a standard option that determines -->
|
||||
<!-- whether the user wants to build this library as -->
|
||||
<!-- a dll or as a static library. -->
|
||||
<option name="SHARED">
|
||||
<values>0,1</values>
|
||||
<values-description>,DLL</values-description>
|
||||
<default-value>0</default-value>
|
||||
<description>If set to zero a STATIC libxml library will be built</description>
|
||||
</option>
|
||||
|
||||
<!-- Configuration for building the bakefile with -->
|
||||
<!-- unicode strings or not (unicode or ansi). -->
|
||||
<option name="UNICODE">
|
||||
<values>0,1</values>
|
||||
<values-description>,Unicode</values-description>
|
||||
<default-value>0</default-value>
|
||||
<description>Compile Unicode build?</description>
|
||||
</option>
|
||||
|
||||
|
||||
<!-- There are several options that deal with build -->
|
||||
<!-- types. First, there's this one, BUILD. -->
|
||||
<!-- -->
|
||||
<!-- BUILD determines whether or not we want to build -->
|
||||
<!-- in release or debug mode. Note that in practice -->
|
||||
<!-- this means modifying the optimize tag, which by -->
|
||||
<!-- default is set to off. In this case debug means -->
|
||||
<!-- off (no optimizations), and release means speed -->
|
||||
<!-- (fast with inlining). There is also a size option -->
|
||||
<!-- that is not addressed in this example bakefile. -->
|
||||
<option name="BUILD">
|
||||
<values>debug,release</values>
|
||||
<values-description>Debug,Release</values-description>
|
||||
<default-value>release</default-value>
|
||||
<description>
|
||||
Type of compiled binaries
|
||||
</description>
|
||||
</option>
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- GENERIC VARIABLES -->
|
||||
<!-- -->
|
||||
|
||||
<!-- Set the ISDLL variable, so that we can use it -->
|
||||
<!-- inside an if statement later on (options not -->
|
||||
<!-- allowed in if statements). -->
|
||||
<set var="ISDLL" cond="SHARED=='1'">1</set>
|
||||
<set var="ISDLL" cond="SHARED=='0'">0</set>
|
||||
|
||||
<!-- The unicode define we want. By default bakefile -->
|
||||
<!-- makes variables an empty string, so if unicode -->
|
||||
<!-- is not defined $(UNICODE_DEFINE) would expand -->
|
||||
<!-- to nothing (literally). -->
|
||||
<set var="UNICODE_DEFINE">
|
||||
<if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
|
||||
</set>
|
||||
|
||||
<!-- The debug define we need with win32 compilers -->
|
||||
<!-- (on Linux, the wx-config program is used). -->
|
||||
<set var="DEBUG_DEFINE">
|
||||
<if cond="FORMAT!='autoconf' and BUILD=='debug'">
|
||||
__WXDEBUG__
|
||||
</if>
|
||||
</set>
|
||||
|
||||
<!-- Value we will use later on for the debug-info -->
|
||||
<!-- tag inside our templates. -->
|
||||
<set var="DEBUGINFO">
|
||||
<if cond="BUILD=='debug'">on</if>
|
||||
<if cond="BUILD=='release'">off</if>
|
||||
</set>
|
||||
|
||||
<!-- Value we will use later on for the debug-runtime -->
|
||||
<!-- tag inside our templates. -->
|
||||
<set var="DEBUGRUNTIME">
|
||||
<if cond="BUILD=='debug'">on</if>
|
||||
<if cond="BUILD=='release'">off</if>
|
||||
</set>
|
||||
|
||||
<!-- Value for optimize tag. -->
|
||||
<set var="OPTIMIZEFLAG">
|
||||
<if cond="BUILD=='debug'">off</if>
|
||||
<if cond="BUILD=='release'">speed</if>
|
||||
</set>
|
||||
|
||||
<!-- Level of warnings. Here we max it out in debug -->
|
||||
<!-- mode, and turn them off in release mode. -->
|
||||
<set var="WARNINGS">
|
||||
<if cond="BUILD=='debug'">max</if>
|
||||
<if cond="BUILD=='release'">no</if>
|
||||
</set>
|
||||
|
||||
<!-- Set MYCPPFLAGS as empty; maybe it will be filled later... -->
|
||||
<set var="MYCPPFLAGS"></set>
|
||||
<if cond="FORMAT=='mingw' or FORMAT=='autoconf'">
|
||||
|
||||
<!-- With GCC, settings warnings to MAX would force -->
|
||||
<!-- Bakefile to call GCC with "-W -Wall" which generates -->
|
||||
<!-- a *lot* of warnings about wxWidgets headers... -->
|
||||
<!-- this is why "-W -Wall" is here replaced by "-Wall". -->
|
||||
<set var="WARNINGS">default</set>
|
||||
<set var="MYCPPFLAGS">-Wall</set>
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- LIBXML2 OPTIONS -->
|
||||
<!-- -->
|
||||
<!-- Note #1: not all of them are used by win32 makefiles -->
|
||||
<!-- -->
|
||||
<!-- Note #2: since all combinations of non-path options are -->
|
||||
<!-- translated into different 'configurations' by -->
|
||||
<!-- Bakefile when using the MSVC6PRJ output, we must -->
|
||||
<!-- avoid to create a 10 MB libxml2.dsp file forcing -->
|
||||
<!-- some options to their default values... this -->
|
||||
<!-- behaviour can be overridden by the -->
|
||||
<!-- FULL_OPTIONS_SUPPORT -->
|
||||
<!-- variable defined below... -->
|
||||
|
||||
<set var="FULL_OPTIONS_SUPPORT">
|
||||
<if cond="FORMAT=='msvc6prj'">0</if>
|
||||
<if cond="FORMAT!='msvc6prj'">1</if>
|
||||
</set>
|
||||
|
||||
<option name="ICONV_DIR" category="path">
|
||||
<default-value>c:\iconv</default-value>
|
||||
<description>The iconv library main folder</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_TRIO">
|
||||
<values>0,1</values>
|
||||
<default-value>0</default-value>
|
||||
<description>Enable TRIO string manipulator</description>
|
||||
</option>
|
||||
|
||||
<!-- see the note #2 -->
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='0'">
|
||||
<set var="WITH_THREADS">native</set>
|
||||
</if>
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='1'">
|
||||
<option name="WITH_THREADS">
|
||||
<values>no,ctls,native,posix</values>
|
||||
<default-value>native</default-value>
|
||||
<description>Enable thread safety</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<option name="WITH_FTP">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable FTP client</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_HTTP">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable HTTP client</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_C14N">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable C14N support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_CATALOG">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable catalog support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_DOCB">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable DocBook support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_XPATH">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable XPath support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_XPTR">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable XPointer support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_XINCLUDE">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable XInclude support</description>
|
||||
</option>
|
||||
|
||||
<!-- see the note #2 -->
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='0'">
|
||||
<set var="WITH_ICONV">1</set>
|
||||
</if>
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='1'">
|
||||
<option name="WITH_ICONV">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable iconv support</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<option name="WITH_ISO8859X">
|
||||
<values>0,1</values>
|
||||
<default-value>0</default-value>
|
||||
<description>Enable iso8859x support</description>
|
||||
</option>
|
||||
|
||||
<!-- see the note #2 -->
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='0'">
|
||||
<set var="WITH_ZLIB">0</set>
|
||||
</if>
|
||||
<if cond="FULL_OPTIONS_SUPPORT=='1'">
|
||||
<option name="WITH_ZLIB">
|
||||
<values>0,1</values>
|
||||
<default-value>0</default-value>
|
||||
<description>Enable ZLIB support</description>
|
||||
</option>
|
||||
</if>
|
||||
|
||||
<option name="WITH_REGEXPS">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable regular expressions</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_TREE">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable tree api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_READER">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable xmlReader api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_WRITER">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable xmlWriter api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_WALKER">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable xmlDocWalker api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_PATTERN">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable xmlPattern api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_PUSH">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable push api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_VALID">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable DTD validation support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_SAX1">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable SAX1 api</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_SCHEMAS">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable XML Schema support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_LEGACY">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable deprecated APIs</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_OUTPUT">
|
||||
<values>0,1</values>
|
||||
<default-value>1</default-value>
|
||||
<description>Enable serialization support</description>
|
||||
</option>
|
||||
|
||||
<option name="WITH_PYTHON">
|
||||
<values>0,1</values>
|
||||
<default-value>0</default-value>
|
||||
<description>Build Python bindings</description>
|
||||
</option>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- LIBXML2 VARIABLES -->
|
||||
<!-- -->
|
||||
|
||||
<!-- Put all the objects files generated by -->
|
||||
<!-- the compilation in a subfolder of BUILD -->
|
||||
<set var="BUILDDIR">$(FORMAT)</set>
|
||||
|
||||
<!-- This variable is set to 1 when the current output writer supports -->
|
||||
<!-- the __DEFINE_ARG variable. Otherwise it's set to zero. -->
|
||||
<set var="HAS_DEFINE_ARG">
|
||||
<if cond="FORMAT!='msvc6prj'">1</if>
|
||||
<if cond="FORMAT=='msvc6prj'">0</if>
|
||||
</set>
|
||||
|
||||
<!-- The root directory of libxml2 -->
|
||||
<set var="XMLBASEDIR">..</set>
|
||||
|
||||
<!-- The directory where libxml2' tests will be put -->
|
||||
<set var="XMLTESTDIR">$(XMLBASEDIR)$(DIRSEP)bin</set>
|
||||
|
||||
<set var="LIBXML_MAJOR_VERSION">2</set>
|
||||
<set var="LIBXML_MINOR_VERSION">6</set>
|
||||
<set var="LIBXML_MICRO_VERSION">16</set>
|
||||
|
||||
<!-- some defines related to threads -->
|
||||
<set var="THREADS_DEF">
|
||||
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='native'">
|
||||
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS
|
||||
</if>
|
||||
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='ctls'">
|
||||
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_WIN32_THREADS $(__DEFINE_ARG)HAVE_COMPILER_TLS
|
||||
</if>
|
||||
<if cond="HAS_DEFINE_ARG=='1' and WITH_THREADS=='posix'">
|
||||
$(__DEFINE_ARG)_REENTRANT $(__DEFINE_ARG)HAVE_PTHREAD_H
|
||||
</if>
|
||||
</set>
|
||||
<if cond="FORMAT=='borland'">
|
||||
<set var="THREADS_DEF">
|
||||
<if cond="WITH_THREADS=='native'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
|
||||
<if cond="WITH_THREADS=='ctls'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
|
||||
<if cond="WITH_THREADS=='posix'">$(THREADS_DEF) $(__DEFINE_ARG)__MT__</if>
|
||||
</set>
|
||||
</if>
|
||||
|
||||
|
||||
<!-- some other conditional defines -->
|
||||
<set var="ZLIB_DEF"><if cond="WITH_ZLIB=='1'">HAVE_ZLIB_H</if></set>
|
||||
<set var="DEBUG_DEF"><if cond="BUILD=='debug'">_DEBUG</if></set>
|
||||
<set var="DEBUG_DEF"><if cond="BUILD=='release'">NDEBUG</if></set>
|
||||
|
||||
<!-- this is very very important when compiling with MINGW: without this line,
|
||||
the test programs (and all the programs built with libxml2 which use xmlFree)
|
||||
won't build because of "undefined references to __xmlFree" -->
|
||||
<set var="STATIC_DEF"><if cond="SHARED=='0'">LIBXML_STATIC</if></set>
|
||||
|
||||
<!-- some conditional libraries dependencies -->
|
||||
<set var="ICONV_LIB"><if cond="WITH_ICONV=='1'">iconv</if></set>
|
||||
<set var="WSOCK32_LIB"><if cond="WITH_THREADS=='native'">wsock32</if></set>
|
||||
<set var="ZLIB_LIB"><if cond="WITH_ZLIB=='1'">zdll</if></set>
|
||||
<set var="POSIX_LIB"><if cond="WITH_THREADS=='posix'">pthreadVC</if></set>
|
||||
|
||||
<set var="XMLINCLUDEDIR">$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)libxml$(DIRSEP)</set>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- ABOUT CONFIG.H HEADER CREATION -->
|
||||
<!-- -->
|
||||
|
||||
<set var="CONFIG_SRCNAME">win32config.h</set>
|
||||
<set var="CONFIG_DSTNAME">config.h</set>
|
||||
|
||||
<if cond="FORMAT!='msvc6prj' and FORMAT!='autoconf' and FORMAT!='gnu'">
|
||||
<copy-file-to-file id="setup">
|
||||
<!-- On win32 we need to manually copy a default config.h file -->
|
||||
<!-- from the include/mc/msw folder to include/mc -->
|
||||
<src>../include/$(CONFIG_SRCNAME)</src>
|
||||
<dst>../$(CONFIG_DSTNAME)</dst>
|
||||
<dependency-of>all</dependency-of>
|
||||
|
||||
<!-- With autoconf, we will use the configure script to translate -->
|
||||
<!-- include/mc/config.h.in to include/mc/config.h and thus we do -->
|
||||
<!-- not need to do anything here... -->
|
||||
</copy-file-to-file>
|
||||
</if>
|
||||
|
||||
<if cond="FORMAT!='msvc6prj'">
|
||||
|
||||
<mkdir id="setuplibdir"><dir>$(XMLBASEDIR)$(DIRSEP)lib</dir></mkdir>
|
||||
<mkdir id="setupbindir"><dir>$(XMLBASEDIR)$(DIRSEP)bin</dir></mkdir>
|
||||
|
||||
<!-- Creates all output folders -->
|
||||
<phony id="setupdirs">
|
||||
<dependency-of>all</dependency-of>
|
||||
<depends>setuplibdir</depends>
|
||||
<depends>setupbindir</depends>
|
||||
</phony>
|
||||
</if>
|
||||
|
||||
<!-- This defines a tag which includes headers on MSVC -->
|
||||
<!-- Note that $(value) is stuck in there by bakefile, -->
|
||||
<!-- and is the value between the beginning and end tag. -->
|
||||
<define-tag name="headers" rules="dll,lib,exe">
|
||||
<if cond="FORMAT=='msvc6prj'">
|
||||
<msvc-project-files>
|
||||
$(value)
|
||||
</msvc-project-files>
|
||||
</if>
|
||||
</define-tag>
|
||||
|
||||
<!-- Creates the following custom build rule for MSVC6PRJ file:
|
||||
copies ..\include\win32config.h into ..\config.h
|
||||
NOTE: this tag must be used before the <sources> tag if you want that the configuration
|
||||
file will be created before any other source file is compiled... -->
|
||||
<define-tag name="msvc-copy-setup-h" rules="dll,lib,action">
|
||||
<if cond="FORMAT=='msvc6prj'">
|
||||
<headers>$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</headers>
|
||||
<set var="__subdir">$(value)</set>
|
||||
<set var="_custom_build_files" append="1">$(XMLBASEDIR)\include\$(CONFIG_SRCNAME)</set>
|
||||
<set var="_custom_build____include_win32config_h">
|
||||
Creating the configuration file ..\$(CONFIG_DSTNAME) from ..\include\$(CONFIG_SRCNAME)
|
||||
InputPath=..\include\$(CONFIG_SRCNAME)
|
||||
|
||||
"..\$(CONFIG_DSTNAME)" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
|
||||
$(TAB)copy "$(DOLLAR)(InputPath)" ..\$(CONFIG_DSTNAME)
|
||||
</set>
|
||||
</if>
|
||||
</define-tag>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- TEMPLATES -->
|
||||
<!-- -->
|
||||
|
||||
<!-- The basic template: used by all the targets -->
|
||||
<template id="base">
|
||||
<if cond="FORMAT=='mingw'">
|
||||
<define>HAVE_W32API_H</define>
|
||||
<ldflags>-mthreads</ldflags>
|
||||
</if>
|
||||
|
||||
<cxxflags>$(MYCPPFLAGS)</cxxflags>
|
||||
<warnings>$(WARNINGS)</warnings>
|
||||
<define>$(UNICODE_DEFINE)</define>
|
||||
<optimize>$(OPTIMIZEFLAG)</optimize>
|
||||
<debug-info>$(DEBUGINFO)</debug-info>
|
||||
<debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
|
||||
</template>
|
||||
|
||||
<!-- The template used both by the library and by the test programs -->
|
||||
<template id="xml2" template="base">
|
||||
|
||||
<!-- -I & -L equivalents -->
|
||||
<include>$(XMLBASEDIR)$(DIRSEP)include</include>
|
||||
<include>$(ICONV_DIR)$(DIRSEP)include</include>
|
||||
<lib-path>$(ICONV_DIR)$(DIRSEP)lib</lib-path>
|
||||
|
||||
<!-- some conditional define flags -->
|
||||
<cflags>$(THREADS_DEF)</cflags>
|
||||
<define>$(ZLIB_DEF)</define>
|
||||
<define>$(DEBUG_DEF)</define>
|
||||
<define>$(STATIC_DEF)</define>
|
||||
|
||||
<if cond="HAS_DEFINE_ARG=='0'">
|
||||
|
||||
<!-- we are probably using an IDE output: defaults to WITH_THREADS=='native' -->
|
||||
<define>_REENTRANT</define>
|
||||
<define>HAVE_WIN32_THREADS</define>
|
||||
</if>
|
||||
|
||||
|
||||
<!-- these must always be defined on win32 -->
|
||||
<define>WIN32</define>
|
||||
<define>_WINDOWS</define>
|
||||
<define>_MBCS</define>
|
||||
|
||||
<if cond="FORMAT=='borland'">
|
||||
<define>_NO_VCL</define>
|
||||
<define>EILSEQ=2</define>
|
||||
</if>
|
||||
</template>
|
||||
|
||||
<!-- The template used by libxml2 test programs -->
|
||||
<template id="xml2test" template="xml2">
|
||||
<dirname>$(XMLTESTDIR)</dirname>
|
||||
<app-type>console</app-type>
|
||||
|
||||
<library>libxml2</library>
|
||||
|
||||
<sys-lib>$(ICONV_LIB)</sys-lib>
|
||||
<sys-lib>$(WSOCK32_LIB)</sys-lib>
|
||||
<sys-lib>$(ZLIB_LIB)</sys-lib>
|
||||
<sys-lib>$(POSIX_LIB)</sys-lib>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- LIBXML2 LIBRARY TARGET -->
|
||||
<!-- -->
|
||||
|
||||
<lib id="libxml2" template="xml2">
|
||||
|
||||
<!-- this is useful only when using MSVC6PRJ -->
|
||||
<if cond="FORMAT=='msvc6prj'">
|
||||
<msvc-copy-setup-h/>
|
||||
<msvc-file-group>Config headers:*config.h</msvc-file-group>
|
||||
</if>
|
||||
<if cond="FORMAT!='msvc6prj'">
|
||||
<depends>setup</depends>
|
||||
<depends>setuplibdir</depends>
|
||||
</if>
|
||||
|
||||
<!-- output folder -->
|
||||
<dirname>$(XMLBASEDIR)$(DIRSEP)lib</dirname>
|
||||
|
||||
<!-- The output name must be "libxml2.lib" with all compilers.
|
||||
Since mingw format autoadds the "lib" prefix to the library
|
||||
name, we must intercept that case to avoid to get "liblibxml2.a" -->
|
||||
<if cond="FORMAT!='mingw'">
|
||||
<libname>libxml2</libname>
|
||||
</if>
|
||||
<if cond="FORMAT=='mingw'">
|
||||
<libname>xml2</libname>
|
||||
</if>
|
||||
|
||||
<!-- the list of source files to compile -->
|
||||
<sources>
|
||||
$(XMLBASEDIR)$(DIRSEP)c14n.c
|
||||
$(XMLBASEDIR)$(DIRSEP)catalog.c
|
||||
$(XMLBASEDIR)$(DIRSEP)chvalid.c
|
||||
$(XMLBASEDIR)$(DIRSEP)debugXML.c
|
||||
$(XMLBASEDIR)$(DIRSEP)dict.c
|
||||
$(XMLBASEDIR)$(DIRSEP)DOCBparser.c
|
||||
$(XMLBASEDIR)$(DIRSEP)encoding.c
|
||||
$(XMLBASEDIR)$(DIRSEP)entities.c
|
||||
$(XMLBASEDIR)$(DIRSEP)error.c
|
||||
$(XMLBASEDIR)$(DIRSEP)globals.c
|
||||
$(XMLBASEDIR)$(DIRSEP)hash.c
|
||||
$(XMLBASEDIR)$(DIRSEP)HTMLparser.c
|
||||
$(XMLBASEDIR)$(DIRSEP)HTMLtree.c
|
||||
$(XMLBASEDIR)$(DIRSEP)legacy.c
|
||||
$(XMLBASEDIR)$(DIRSEP)list.c
|
||||
$(XMLBASEDIR)$(DIRSEP)nanoftp.c
|
||||
$(XMLBASEDIR)$(DIRSEP)nanohttp.c
|
||||
$(XMLBASEDIR)$(DIRSEP)parser.c
|
||||
$(XMLBASEDIR)$(DIRSEP)parserInternals.c
|
||||
$(XMLBASEDIR)$(DIRSEP)pattern.c
|
||||
$(XMLBASEDIR)$(DIRSEP)relaxng.c
|
||||
$(XMLBASEDIR)$(DIRSEP)SAX2.c
|
||||
$(XMLBASEDIR)$(DIRSEP)SAX.c
|
||||
$(XMLBASEDIR)$(DIRSEP)threads.c
|
||||
$(XMLBASEDIR)$(DIRSEP)tree.c
|
||||
$(XMLBASEDIR)$(DIRSEP)uri.c
|
||||
$(XMLBASEDIR)$(DIRSEP)valid.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xinclude.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xlink.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlIO.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlmemory.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlreader.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlregexp.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlsave.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlschemas.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlschemastypes.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlunicode.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlwriter.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xpath.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xpointer.c
|
||||
$(XMLBASEDIR)$(DIRSEP)xmlstring.c
|
||||
</sources>
|
||||
|
||||
<!-- the list of header files (for IDE projects) -->
|
||||
<headers>
|
||||
$(XMLINCLUDEDIR)c14n.h
|
||||
$(XMLINCLUDEDIR)catalog.h
|
||||
$(XMLINCLUDEDIR)chvalid.h
|
||||
$(XMLINCLUDEDIR)debugXML.h
|
||||
$(XMLINCLUDEDIR)dict.h
|
||||
$(XMLINCLUDEDIR)DOCBparser.h
|
||||
$(XMLINCLUDEDIR)encoding.h
|
||||
$(XMLINCLUDEDIR)entities.h
|
||||
$(XMLINCLUDEDIR)globals.h
|
||||
$(XMLINCLUDEDIR)hash.h
|
||||
$(XMLINCLUDEDIR)HTMLparser.h
|
||||
$(XMLINCLUDEDIR)HTMLtree.h
|
||||
$(XMLINCLUDEDIR)list.h
|
||||
$(XMLINCLUDEDIR)nanoftp.h
|
||||
$(XMLINCLUDEDIR)nanohttp.h
|
||||
$(XMLINCLUDEDIR)parser.h
|
||||
$(XMLINCLUDEDIR)parserInternals.h
|
||||
$(XMLINCLUDEDIR)pattern.h
|
||||
$(XMLINCLUDEDIR)relaxng.h
|
||||
$(XMLINCLUDEDIR)SAX.h
|
||||
$(XMLINCLUDEDIR)SAX2.h
|
||||
$(XMLINCLUDEDIR)schemasInternals.h
|
||||
$(XMLINCLUDEDIR)threads.h
|
||||
$(XMLINCLUDEDIR)tree.h
|
||||
$(XMLINCLUDEDIR)uri.h
|
||||
$(XMLINCLUDEDIR)valid.h
|
||||
$(XMLINCLUDEDIR)xinclude.h
|
||||
$(XMLINCLUDEDIR)xlink.h
|
||||
$(XMLINCLUDEDIR)xmlautomata.h
|
||||
$(XMLINCLUDEDIR)xmlerror.h
|
||||
$(XMLINCLUDEDIR)xmlexports.h
|
||||
$(XMLINCLUDEDIR)xmlIO.h
|
||||
$(XMLINCLUDEDIR)xmlmemory.h
|
||||
$(XMLINCLUDEDIR)xmlmodule.h
|
||||
$(XMLINCLUDEDIR)xmlreader.h
|
||||
$(XMLINCLUDEDIR)xmlregexp.h
|
||||
$(XMLINCLUDEDIR)xmlsave.h
|
||||
$(XMLINCLUDEDIR)xmlschemas.h
|
||||
$(XMLINCLUDEDIR)xmlschemastypes.h
|
||||
$(XMLINCLUDEDIR)xmlstring.h
|
||||
$(XMLINCLUDEDIR)xmlunicode.h
|
||||
$(XMLINCLUDEDIR)xmlversion.h
|
||||
$(XMLINCLUDEDIR)xmlwriter.h
|
||||
$(XMLINCLUDEDIR)xpath.h
|
||||
$(XMLINCLUDEDIR)xpathInternals.h
|
||||
$(XMLINCLUDEDIR)xpointer.h
|
||||
</headers>
|
||||
|
||||
<!-- these ones are not inside the include/libxml folder -->
|
||||
<headers>
|
||||
$(XMLBASEDIR)$(DIRSEP)libxml.h
|
||||
$(XMLBASEDIR)$(DIRSEP)triodef.h
|
||||
$(XMLBASEDIR)$(DIRSEP)trionan.h
|
||||
$(XMLBASEDIR)$(DIRSEP)include$(DIRSEP)wsockcompat.h
|
||||
</headers>
|
||||
</lib>
|
||||
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- LIBXML2 test programs -->
|
||||
<!-- -->
|
||||
|
||||
<set var="BUILD_ALL_TESTS">
|
||||
|
||||
<!-- when using full options support with MSVC6PRJ we should
|
||||
avoid to create all the DSP files required for the test
|
||||
programs: they would take a _lot_ of space !! -->
|
||||
<if cond="FORMAT=='msvc6prj' and FULL_OPTIONS_SUPPORT=='1'">0</if>
|
||||
|
||||
<!-- when creating a makefile or using MSVC6PRJ with limited
|
||||
options support, then we can build all the tests safely -->
|
||||
<if cond="FORMAT!='msvc6prj' or FULL_OPTIONS_SUPPORT=='0'">1</if>
|
||||
|
||||
</set>
|
||||
|
||||
<if cond="BUILD_ALL_TESTS=='1'">
|
||||
|
||||
<exe id="testAutomata" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testAutomata.c</sources></exe>
|
||||
<exe id="testC14N" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testC14N.c</sources></exe>
|
||||
<exe id="testHTML" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testHTML.c</sources></exe>
|
||||
<exe id="testReader" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testReader.c</sources></exe>
|
||||
<exe id="testRegexp" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRegexp.c</sources></exe>
|
||||
<exe id="testRelax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testRelax.c</sources></exe>
|
||||
<exe id="testSax" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSax.c</sources></exe>
|
||||
<exe id="testSchemas" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testSchemas.c</sources></exe>
|
||||
<exe id="testURI" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testURI.c</sources></exe>
|
||||
<exe id="testXPath" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testXPath.c</sources></exe>
|
||||
<exe id="xmllint" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)xmllint.c</sources></exe>
|
||||
|
||||
<if cond="FORMAT=='autoconf'">
|
||||
<exe id="testdso" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testdso.c</sources></exe>
|
||||
</if>
|
||||
|
||||
<!-- FIXME:
|
||||
<exe id="testModule" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testModule.c</sources></exe>
|
||||
|
||||
<if cond="WITH_THREADS=='posix'">
|
||||
<exe id="testThreads" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreads.c</sources></exe>
|
||||
</if>
|
||||
<if cond="WITH_THREADS=='ctls' or WITH_THREADS=='native'">
|
||||
<exe id="testThreadsWin32" template="xml2test"><sources>$(XMLBASEDIR)$(DIRSEP)testThreadsWin32.c</sources></exe>
|
||||
</if>
|
||||
-->
|
||||
</if>
|
||||
|
||||
</makefile>
|
||||
1345
DesktopEditor/xml/libxml2/buf.c
Normal file
1345
DesktopEditor/xml/libxml2/buf.c
Normal file
File diff suppressed because it is too large
Load Diff
72
DesktopEditor/xml/libxml2/buf.h
Normal file
72
DesktopEditor/xml/libxml2/buf.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Summary: Internal Interfaces for memory buffers in libxml2
|
||||
* Description: this module describes most of the new xmlBuf buffer
|
||||
* entry points, those are private routines, with a
|
||||
* few exceptions exported in tree.h. This was added
|
||||
* in 2.9.0.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_BUF_H__
|
||||
#define __XML_BUF_H__
|
||||
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
xmlBufPtr xmlBufCreate(void);
|
||||
xmlBufPtr xmlBufCreateSize(size_t size);
|
||||
xmlBufPtr xmlBufCreateStatic(void *mem, size_t size);
|
||||
|
||||
int xmlBufSetAllocationScheme(xmlBufPtr buf,
|
||||
xmlBufferAllocationScheme scheme);
|
||||
int xmlBufGetAllocationScheme(xmlBufPtr buf);
|
||||
|
||||
void xmlBufFree(xmlBufPtr buf);
|
||||
void xmlBufEmpty(xmlBufPtr buf);
|
||||
|
||||
/* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */
|
||||
int xmlBufGrow(xmlBufPtr buf, int len);
|
||||
int xmlBufInflate(xmlBufPtr buf, size_t len);
|
||||
int xmlBufResize(xmlBufPtr buf, size_t len);
|
||||
|
||||
int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
|
||||
int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len);
|
||||
int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
|
||||
int xmlBufCCat(xmlBufPtr buf, const char *str);
|
||||
int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string);
|
||||
int xmlBufWriteChar(xmlBufPtr buf, const char *string);
|
||||
int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
|
||||
|
||||
size_t xmlBufAvail(const xmlBufPtr buf);
|
||||
size_t xmlBufLength(const xmlBufPtr buf);
|
||||
/* size_t xmlBufUse(const xmlBufPtr buf); */
|
||||
int xmlBufIsEmpty(const xmlBufPtr buf);
|
||||
int xmlBufAddLen(xmlBufPtr buf, size_t len);
|
||||
int xmlBufErase(xmlBufPtr buf, size_t len);
|
||||
|
||||
/* const xmlChar * xmlBufContent(const xmlBuf *buf); */
|
||||
/* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
|
||||
|
||||
xmlChar * xmlBufDetach(xmlBufPtr buf);
|
||||
|
||||
size_t xmlBufDump(FILE *file, xmlBufPtr buf);
|
||||
|
||||
xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
|
||||
xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
|
||||
int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
|
||||
|
||||
int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
|
||||
size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input);
|
||||
int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
|
||||
size_t base, size_t cur);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_BUF_H__ */
|
||||
|
||||
122
DesktopEditor/xml/libxml2/build_glob.py
Normal file
122
DesktopEditor/xml/libxml2/build_glob.py
Normal file
@ -0,0 +1,122 @@
|
||||
#! /usr/bin/env python
|
||||
###
|
||||
#
|
||||
# build_glob.py : Build the global_functions.h and global_functions.c
|
||||
# files which are required to implement the user
|
||||
# interface to global variables now that thread specific
|
||||
# data (TSD) is used to emulate global state.
|
||||
#
|
||||
# See Copyright for the status of this software.
|
||||
# Gary.Pennington@sun.com
|
||||
###
|
||||
import os, string
|
||||
|
||||
class globvar:
|
||||
def __init__(self, type, name):
|
||||
self.type=type
|
||||
self.name=name
|
||||
|
||||
def striplinesep(line):
|
||||
while line and line[-1] in ('\r','\n'):
|
||||
line = line[:-1]
|
||||
return line
|
||||
|
||||
def writeline(file, line=None):
|
||||
if line:
|
||||
file.write(line)
|
||||
file.write("\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
globals={}
|
||||
global_data=open("global.data").readlines()
|
||||
global_code=open("globals.c").readlines()
|
||||
global_hdr=open("include/libxml/globals.h").readlines()
|
||||
global_functions_hdr=open("include/libxml/globals.h", "w+")
|
||||
global_functions_impl=open("globals.c", "w+")
|
||||
|
||||
#
|
||||
# Rebuild the beginning of the file up to the
|
||||
# Automatically generated string
|
||||
#
|
||||
for line in global_hdr:
|
||||
line = striplinesep(line)
|
||||
if line == " * Automatically generated by build_glob.py.":
|
||||
break
|
||||
writeline(global_functions_hdr, line)
|
||||
|
||||
writeline(global_functions_hdr, " * Automatically generated by build_glob.py.")
|
||||
writeline(global_functions_hdr, " * Do not modify the previous line.")
|
||||
writeline(global_functions_hdr, " */")
|
||||
writeline(global_functions_hdr)
|
||||
|
||||
for line in global_code:
|
||||
line = striplinesep(line)
|
||||
if line == " * Automatically generated by build_glob.py.":
|
||||
break
|
||||
writeline(global_functions_impl, line)
|
||||
|
||||
writeline(global_functions_impl, " * Automatically generated by build_glob.py.")
|
||||
writeline(global_functions_impl, " * Do not modify the previous line.")
|
||||
writeline(global_functions_impl, " */")
|
||||
writeline(global_functions_impl)
|
||||
|
||||
# Now process the data and write it to the appropriate output file
|
||||
for line in global_data:
|
||||
if line[0]=='#':
|
||||
continue
|
||||
line = striplinesep(line)
|
||||
fields = string.split(line, ",")
|
||||
# Update the header file
|
||||
writeline(global_functions_hdr)
|
||||
global_functions_hdr.write("extern "+fields[0]+" *")
|
||||
if fields[2]:
|
||||
global_functions_hdr.write("(*")
|
||||
global_functions_hdr.write("__"+fields[1]+"(void)")
|
||||
if fields[2]:
|
||||
global_functions_hdr.write(")"+fields[2])
|
||||
writeline(global_functions_hdr,";")
|
||||
writeline(global_functions_hdr, "#ifdef LIBXML_THREAD_ENABLED")
|
||||
writeline(global_functions_hdr,"#define "+fields[1]+" \\")
|
||||
writeline(global_functions_hdr,"(*(__"+fields[1]+"()))")
|
||||
writeline(global_functions_hdr,"#else")
|
||||
if fields[2]:
|
||||
writeline(global_functions_hdr,"LIBXML_DLL_IMPORT extern "+fields[0]+" "+fields[1]+fields[2]+";")
|
||||
else:
|
||||
writeline(global_functions_hdr,"LIBXML_DLL_IMPORT extern "+fields[0]+" "+fields[1]+";")
|
||||
writeline(global_functions_hdr,"#endif")
|
||||
# set/get for per-thread global defaults
|
||||
if fields[3]:
|
||||
writeline(global_functions_hdr,fields[0]+" "+fields[1][:3]+"ThrDef"+fields[1][3:]+"("+fields[0]+" v);")
|
||||
# Update the implementation file
|
||||
writeline(global_functions_impl)
|
||||
# writeline(global_functions_impl, "extern "+fields[0]+" "+fields[1]+";")
|
||||
writeline(global_functions_impl, "#undef\t"+fields[1])
|
||||
writeline(global_functions_impl, fields[0]+" *")
|
||||
if fields[2]:
|
||||
global_functions_impl.write("(*")
|
||||
global_functions_impl.write("__"+fields[1]+"(void)")
|
||||
if fields[2]:
|
||||
writeline(global_functions_impl, ")[]")
|
||||
writeline(global_functions_impl, " {")
|
||||
writeline(global_functions_impl, " if (IS_MAIN_THREAD)")
|
||||
writeline(global_functions_impl, "\treturn (&"+fields[1]+");")
|
||||
writeline(global_functions_impl, " else")
|
||||
writeline(global_functions_impl, "\treturn (&xmlGetGlobalState()->"+fields[1]+");")
|
||||
writeline(global_functions_impl, "}")
|
||||
# set/get for per-thread global defaults
|
||||
if fields[3]:
|
||||
writeline(global_functions_impl,fields[0]+" "+fields[1][:3]+"ThrDef"+fields[1][3:]+"("+fields[0]+" v) {")
|
||||
writeline(global_functions_impl," "+fields[0]+" ret;");
|
||||
writeline(global_functions_impl," xmlMutexLock(xmlThrDefMutex);")
|
||||
writeline(global_functions_impl," ret = "+fields[1][:3]+fields[1][3:]+"ThrDef;")
|
||||
writeline(global_functions_impl," "+fields[1][:3]+fields[1][3:]+"ThrDef = v;")
|
||||
writeline(global_functions_impl," xmlMutexUnlock(xmlThrDefMutex);")
|
||||
writeline(global_functions_impl," return ret;")
|
||||
writeline(global_functions_impl,"}")
|
||||
# Terminate the header file with appropriate boilerplate
|
||||
writeline(global_functions_hdr)
|
||||
writeline(global_functions_hdr, "#ifdef __cplusplus")
|
||||
writeline(global_functions_hdr, "}")
|
||||
writeline(global_functions_hdr, "#endif")
|
||||
writeline(global_functions_hdr)
|
||||
writeline(global_functions_hdr, "#endif /* __XML_GLOBALS_H */")
|
||||
2238
DesktopEditor/xml/libxml2/c14n.c
Normal file
2238
DesktopEditor/xml/libxml2/c14n.c
Normal file
File diff suppressed because it is too large
Load Diff
3825
DesktopEditor/xml/libxml2/catalog.c
Normal file
3825
DesktopEditor/xml/libxml2/catalog.c
Normal file
File diff suppressed because it is too large
Load Diff
394
DesktopEditor/xml/libxml2/check-relaxng-test-suite.py
Normal file
394
DesktopEditor/xml/libxml2/check-relaxng-test-suite.py
Normal file
@ -0,0 +1,394 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
import string
|
||||
import StringIO
|
||||
sys.path.insert(0, "python")
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.debugMemory(1)
|
||||
debug = 0
|
||||
verbose = 0
|
||||
quiet = 1
|
||||
|
||||
#
|
||||
# the testsuite description
|
||||
#
|
||||
CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/OASIS/spectest.xml")
|
||||
LOG="check-relaxng-test-suite.log"
|
||||
RES="relaxng-test-results.xml"
|
||||
|
||||
log = open(LOG, "w")
|
||||
nb_schemas_tests = 0
|
||||
nb_schemas_success = 0
|
||||
nb_schemas_failed = 0
|
||||
nb_instances_tests = 0
|
||||
nb_instances_success = 0
|
||||
nb_instances_failed = 0
|
||||
|
||||
libxml2.lineNumbersDefault(1)
|
||||
#
|
||||
# Error and warnng callbacks
|
||||
#
|
||||
def callback(ctx, str):
|
||||
global log
|
||||
log.write("%s%s" % (ctx, str))
|
||||
|
||||
libxml2.registerErrorHandler(callback, "")
|
||||
|
||||
#
|
||||
# Resolver callback
|
||||
#
|
||||
resources = {}
|
||||
def resolver(URL, ID, ctxt):
|
||||
global resources
|
||||
|
||||
if string.find(URL, '#') != -1:
|
||||
URL = URL[0:string.find(URL, '#')]
|
||||
if resources.has_key(URL):
|
||||
return(StringIO.StringIO(resources[URL]))
|
||||
log.write("Resolver failure: asked %s\n" % (URL))
|
||||
log.write("resources: %s\n" % (resources))
|
||||
return None
|
||||
|
||||
#
|
||||
# Load the previous results
|
||||
#
|
||||
#results = {}
|
||||
#previous = {}
|
||||
#
|
||||
#try:
|
||||
# res = libxml2.parseFile(RES)
|
||||
#except:
|
||||
# log.write("Could not parse %s" % (RES))
|
||||
|
||||
#
|
||||
# handle a valid instance
|
||||
#
|
||||
def handle_valid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nFailed to parse correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
return
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
except:
|
||||
ret = -1
|
||||
if ret != 0:
|
||||
log.write("\nFailed to validate correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
doc.freeDoc()
|
||||
|
||||
#
|
||||
# handle an invalid instance
|
||||
#
|
||||
def handle_invalid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
return
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
except:
|
||||
ret = -1
|
||||
if ret == 0:
|
||||
log.write("\nFailed to detect validation problem in instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
doc.freeDoc()
|
||||
|
||||
#
|
||||
# handle an incorrect test
|
||||
#
|
||||
def handle_correct(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs == None:
|
||||
log.write("\nFailed to compile correct schema:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return rngs
|
||||
|
||||
def handle_incorrect(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs != None:
|
||||
log.write("\nFailed to detect schema error in:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
# log.write("\nSuccess detecting schema error in:\n-----\n")
|
||||
# log.write(schema)
|
||||
# log.write("\n-----\n")
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return None
|
||||
|
||||
#
|
||||
# resource handling: keep a dictionary of URL->string mappings
|
||||
#
|
||||
def handle_resource(node, dir):
|
||||
global resources
|
||||
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
res = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
res = res + child.serialize()
|
||||
child = child.next
|
||||
resources[name] = res
|
||||
|
||||
#
|
||||
# dir handling: pseudo directory resources
|
||||
#
|
||||
def handle_dir(node, dir):
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, name)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, name)
|
||||
|
||||
#
|
||||
# handle a testCase element
|
||||
#
|
||||
def handle_testCase(node):
|
||||
global nb_schemas_tests
|
||||
global nb_instances_tests
|
||||
global resources
|
||||
|
||||
sections = node.xpathEval('string(section)')
|
||||
log.write("\n ======== test %d line %d section %s ==========\n" % (
|
||||
|
||||
nb_schemas_tests, node.lineNo(), sections))
|
||||
resources = {}
|
||||
if debug:
|
||||
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, None)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, None)
|
||||
|
||||
tsts = node.xpathEval('incorrect')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
|
||||
schema = handle_incorrect(tsts[0])
|
||||
else:
|
||||
tsts = node.xpathEval('correct')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <correct> example"% (node.lineNo())
|
||||
schema = handle_correct(tsts[0])
|
||||
else:
|
||||
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
|
||||
|
||||
nb_schemas_tests = nb_schemas_tests + 1;
|
||||
|
||||
valids = node.xpathEval('valid')
|
||||
invalids = node.xpathEval('invalid')
|
||||
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
|
||||
if schema != None:
|
||||
for valid in valids:
|
||||
handle_valid(valid, schema)
|
||||
for invalid in invalids:
|
||||
handle_invalid(invalid, schema)
|
||||
|
||||
|
||||
#
|
||||
# handle a testSuite element
|
||||
#
|
||||
def handle_testSuite(node, level = 0):
|
||||
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
|
||||
global nb_instances_tests, nb_instances_success, nb_instances_failed
|
||||
global quiet
|
||||
if level >= 1:
|
||||
old_schemas_tests = nb_schemas_tests
|
||||
old_schemas_success = nb_schemas_success
|
||||
old_schemas_failed = nb_schemas_failed
|
||||
old_instances_tests = nb_instances_tests
|
||||
old_instances_success = nb_instances_success
|
||||
old_instances_failed = nb_instances_failed
|
||||
|
||||
docs = node.xpathEval('documentation')
|
||||
authors = node.xpathEval('author')
|
||||
if docs != []:
|
||||
msg = ""
|
||||
for doc in docs:
|
||||
msg = msg + doc.content + " "
|
||||
if authors != []:
|
||||
msg = msg + "written by "
|
||||
for author in authors:
|
||||
msg = msg + author.content + " "
|
||||
if quiet == 0:
|
||||
print msg
|
||||
sections = node.xpathEval('section')
|
||||
if sections != [] and level <= 0:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
if quiet == 0:
|
||||
print "Tests for section %s" % (msg)
|
||||
for test in node.xpathEval('testCase'):
|
||||
handle_testCase(test)
|
||||
for test in node.xpathEval('testSuite'):
|
||||
handle_testSuite(test, level + 1)
|
||||
|
||||
|
||||
if verbose and level >= 1 and sections != []:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
print "Result of tests for section %s" % (msg)
|
||||
if nb_schemas_tests != old_schemas_tests:
|
||||
print "found %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests - old_schemas_tests,
|
||||
nb_schemas_success - old_schemas_success,
|
||||
nb_schemas_failed - old_schemas_failed)
|
||||
if nb_instances_tests != old_instances_tests:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests - old_instances_tests,
|
||||
nb_instances_success - old_instances_success,
|
||||
nb_instances_failed - old_instances_failed)
|
||||
#
|
||||
# Parse the conf file
|
||||
#
|
||||
libxml2.substituteEntitiesDefault(1);
|
||||
testsuite = libxml2.parseFile(CONF)
|
||||
libxml2.setEntityLoader(resolver)
|
||||
root = testsuite.getRootElement()
|
||||
if root.name != 'testSuite':
|
||||
print "%s doesn't start with a testSuite element, aborting" % (CONF)
|
||||
sys.exit(1)
|
||||
if quiet == 0:
|
||||
print "Running Relax NG testsuite"
|
||||
handle_testSuite(root)
|
||||
|
||||
if quiet == 0:
|
||||
print "\nTOTAL:\n"
|
||||
if quiet == 0 or nb_schemas_failed != 0:
|
||||
print "found %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
|
||||
if quiet == 0 or nb_instances_failed != 0:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests, nb_instances_success, nb_instances_failed)
|
||||
|
||||
testsuite.freeDoc()
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.relaxNGCleanupTypes()
|
||||
libxml2.cleanupParser()
|
||||
if libxml2.debugMemory(1) == 0:
|
||||
if quiet == 0:
|
||||
print "OK"
|
||||
else:
|
||||
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
|
||||
libxml2.dumpMemory()
|
||||
418
DesktopEditor/xml/libxml2/check-relaxng-test-suite2.py
Normal file
418
DesktopEditor/xml/libxml2/check-relaxng-test-suite2.py
Normal file
@ -0,0 +1,418 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
import string
|
||||
import StringIO
|
||||
sys.path.insert(0, "python")
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.debugMemory(1)
|
||||
debug = 0
|
||||
quiet = 1
|
||||
|
||||
#
|
||||
# the testsuite description
|
||||
#
|
||||
CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml")
|
||||
LOG="check-relaxng-test-suite2.log"
|
||||
|
||||
log = open(LOG, "w")
|
||||
nb_schemas_tests = 0
|
||||
nb_schemas_success = 0
|
||||
nb_schemas_failed = 0
|
||||
nb_instances_tests = 0
|
||||
nb_instances_success = 0
|
||||
nb_instances_failed = 0
|
||||
|
||||
libxml2.lineNumbersDefault(1)
|
||||
#
|
||||
# Resolver callback
|
||||
#
|
||||
resources = {}
|
||||
def resolver(URL, ID, ctxt):
|
||||
global resources
|
||||
|
||||
if resources.has_key(URL):
|
||||
return(StringIO.StringIO(resources[URL]))
|
||||
log.write("Resolver failure: asked %s\n" % (URL))
|
||||
log.write("resources: %s\n" % (resources))
|
||||
return None
|
||||
|
||||
#
|
||||
# Load the previous results
|
||||
#
|
||||
#results = {}
|
||||
#previous = {}
|
||||
#
|
||||
#try:
|
||||
# res = libxml2.parseFile(RES)
|
||||
#except:
|
||||
# log.write("Could not parse %s" % (RES))
|
||||
|
||||
#
|
||||
# handle a valid instance
|
||||
#
|
||||
def handle_valid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = node.prop("dtd")
|
||||
if instance == None:
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
# mem = libxml2.debugMemory(1);
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nFailed to parse correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
return
|
||||
|
||||
if debug:
|
||||
print "instance line %d" % (node.lineNo())
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
del ctxt
|
||||
except:
|
||||
ret = -1
|
||||
|
||||
doc.freeDoc()
|
||||
# if mem != libxml2.debugMemory(1):
|
||||
# print "validating instance %d line %d leaks" % (
|
||||
# nb_instances_tests, node.lineNo())
|
||||
|
||||
if ret != 0:
|
||||
log.write("\nFailed to validate correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
|
||||
#
|
||||
# handle an invalid instance
|
||||
#
|
||||
def handle_invalid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = node.prop("dtd")
|
||||
if instance == None:
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
# mem = libxml2.debugMemory(1);
|
||||
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
return
|
||||
|
||||
if debug:
|
||||
print "instance line %d" % (node.lineNo())
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
del ctxt
|
||||
|
||||
except:
|
||||
ret = -1
|
||||
|
||||
doc.freeDoc()
|
||||
# mem2 = libxml2.debugMemory(1)
|
||||
# if mem != mem2:
|
||||
# print "validating instance %d line %d leaks %d bytes" % (
|
||||
# nb_instances_tests, node.lineNo(), mem2 - mem)
|
||||
|
||||
if ret == 0:
|
||||
log.write("\nFailed to detect validation problem in instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
|
||||
#
|
||||
# handle an incorrect test
|
||||
#
|
||||
def handle_correct(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs == None:
|
||||
log.write("\nFailed to compile correct schema:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return rngs
|
||||
|
||||
def handle_incorrect(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs != None:
|
||||
log.write("\nFailed to detect schema error in:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
# log.write("\nSuccess detecting schema error in:\n-----\n")
|
||||
# log.write(schema)
|
||||
# log.write("\n-----\n")
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return None
|
||||
|
||||
#
|
||||
# resource handling: keep a dictionary of URL->string mappings
|
||||
#
|
||||
def handle_resource(node, dir):
|
||||
global resources
|
||||
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
res = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
res = res + child.serialize()
|
||||
child = child.next
|
||||
resources[name] = res
|
||||
|
||||
#
|
||||
# dir handling: pseudo directory resources
|
||||
#
|
||||
def handle_dir(node, dir):
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, name)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, name)
|
||||
|
||||
#
|
||||
# handle a testCase element
|
||||
#
|
||||
def handle_testCase(node):
|
||||
global nb_schemas_tests
|
||||
global nb_instances_tests
|
||||
global resources
|
||||
|
||||
sections = node.xpathEval('string(section)')
|
||||
log.write("\n ======== test %d line %d section %s ==========\n" % (
|
||||
|
||||
nb_schemas_tests, node.lineNo(), sections))
|
||||
resources = {}
|
||||
if debug:
|
||||
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, None)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, None)
|
||||
|
||||
tsts = node.xpathEval('incorrect')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
|
||||
schema = handle_incorrect(tsts[0])
|
||||
else:
|
||||
tsts = node.xpathEval('correct')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <correct> example"% (node.lineNo())
|
||||
schema = handle_correct(tsts[0])
|
||||
else:
|
||||
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
|
||||
|
||||
nb_schemas_tests = nb_schemas_tests + 1;
|
||||
|
||||
valids = node.xpathEval('valid')
|
||||
invalids = node.xpathEval('invalid')
|
||||
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
|
||||
if schema != None:
|
||||
for valid in valids:
|
||||
handle_valid(valid, schema)
|
||||
for invalid in invalids:
|
||||
handle_invalid(invalid, schema)
|
||||
|
||||
|
||||
#
|
||||
# handle a testSuite element
|
||||
#
|
||||
def handle_testSuite(node, level = 0):
|
||||
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
|
||||
global nb_instances_tests, nb_instances_success, nb_instances_failed
|
||||
if level >= 1:
|
||||
old_schemas_tests = nb_schemas_tests
|
||||
old_schemas_success = nb_schemas_success
|
||||
old_schemas_failed = nb_schemas_failed
|
||||
old_instances_tests = nb_instances_tests
|
||||
old_instances_success = nb_instances_success
|
||||
old_instances_failed = nb_instances_failed
|
||||
|
||||
docs = node.xpathEval('documentation')
|
||||
authors = node.xpathEval('author')
|
||||
if docs != []:
|
||||
msg = ""
|
||||
for doc in docs:
|
||||
msg = msg + doc.content + " "
|
||||
if authors != []:
|
||||
msg = msg + "written by "
|
||||
for author in authors:
|
||||
msg = msg + author.content + " "
|
||||
if quiet == 0:
|
||||
print msg
|
||||
sections = node.xpathEval('section')
|
||||
if sections != [] and level <= 0:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
if quiet == 0:
|
||||
print "Tests for section %s" % (msg)
|
||||
for test in node.xpathEval('testCase'):
|
||||
handle_testCase(test)
|
||||
for test in node.xpathEval('testSuite'):
|
||||
handle_testSuite(test, level + 1)
|
||||
|
||||
|
||||
if level >= 1 and sections != []:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
print "Result of tests for section %s" % (msg)
|
||||
if nb_schemas_tests != old_schemas_tests:
|
||||
print "found %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests - old_schemas_tests,
|
||||
nb_schemas_success - old_schemas_success,
|
||||
nb_schemas_failed - old_schemas_failed)
|
||||
if nb_instances_tests != old_instances_tests:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests - old_instances_tests,
|
||||
nb_instances_success - old_instances_success,
|
||||
nb_instances_failed - old_instances_failed)
|
||||
#
|
||||
# Parse the conf file
|
||||
#
|
||||
libxml2.substituteEntitiesDefault(1);
|
||||
testsuite = libxml2.parseFile(CONF)
|
||||
|
||||
#
|
||||
# Error and warnng callbacks
|
||||
#
|
||||
def callback(ctx, str):
|
||||
global log
|
||||
log.write("%s%s" % (ctx, str))
|
||||
|
||||
libxml2.registerErrorHandler(callback, "")
|
||||
|
||||
libxml2.setEntityLoader(resolver)
|
||||
root = testsuite.getRootElement()
|
||||
if root.name != 'testSuite':
|
||||
print "%s doesn't start with a testSuite element, aborting" % (CONF)
|
||||
sys.exit(1)
|
||||
if quiet == 0:
|
||||
print "Running Relax NG testsuite"
|
||||
handle_testSuite(root)
|
||||
|
||||
if quiet == 0:
|
||||
print "\nTOTAL:\n"
|
||||
if quiet == 0 or nb_schemas_failed != 0:
|
||||
print "found %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
|
||||
if quiet == 0 or nb_instances_failed != 0:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests, nb_instances_success, nb_instances_failed)
|
||||
|
||||
|
||||
testsuite.freeDoc()
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.relaxNGCleanupTypes()
|
||||
libxml2.cleanupParser()
|
||||
if libxml2.debugMemory(1) == 0:
|
||||
if quiet == 0:
|
||||
print "OK"
|
||||
else:
|
||||
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
|
||||
libxml2.dumpMemory()
|
||||
221
DesktopEditor/xml/libxml2/check-xinclude-test-suite.py
Normal file
221
DesktopEditor/xml/libxml2/check-xinclude-test-suite.py
Normal file
@ -0,0 +1,221 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
import string
|
||||
sys.path.insert(0, "python")
|
||||
import libxml2
|
||||
|
||||
#
|
||||
# the testsuite description
|
||||
#
|
||||
DIR="xinclude-test-suite"
|
||||
CONF="testdescr.xml"
|
||||
LOG="check-xinclude-test-suite.log"
|
||||
|
||||
log = open(LOG, "w")
|
||||
|
||||
os.chdir(DIR)
|
||||
|
||||
test_nr = 0
|
||||
test_succeed = 0
|
||||
test_failed = 0
|
||||
test_error = 0
|
||||
#
|
||||
# Error and warning handlers
|
||||
#
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
def errorHandler(ctx, str):
|
||||
global error_nr
|
||||
global error_msg
|
||||
|
||||
if string.find(str, "error:") >= 0:
|
||||
error_nr = error_nr + 1
|
||||
if len(error_msg) < 300:
|
||||
if len(error_msg) == 0 or error_msg[-1] == '\n':
|
||||
error_msg = error_msg + " >>" + str
|
||||
else:
|
||||
error_msg = error_msg + str
|
||||
|
||||
libxml2.registerErrorHandler(errorHandler, None)
|
||||
|
||||
def testXInclude(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
print "testXInclude(%s, %s)" % (filename, id)
|
||||
return 1
|
||||
|
||||
def runTest(test, basedir):
|
||||
global test_nr
|
||||
global test_failed
|
||||
global test_error
|
||||
global test_succeed
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
fatal_error = 0
|
||||
uri = test.prop('href')
|
||||
id = test.prop('id')
|
||||
type = test.prop('type')
|
||||
if uri == None:
|
||||
print "Test without ID:", uri
|
||||
return -1
|
||||
if id == None:
|
||||
print "Test without URI:", id
|
||||
return -1
|
||||
if type == None:
|
||||
print "Test without URI:", id
|
||||
return -1
|
||||
if basedir != None:
|
||||
URI = basedir + "/" + uri
|
||||
else:
|
||||
URI = uri
|
||||
if os.access(URI, os.R_OK) == 0:
|
||||
print "Test %s missing: base %s uri %s" % (URI, basedir, uri)
|
||||
return -1
|
||||
|
||||
expected = None
|
||||
outputfile = None
|
||||
diff = None
|
||||
if type != 'error':
|
||||
output = test.xpathEval('string(output)')
|
||||
if output == 'No output file.':
|
||||
output = None
|
||||
if output == '':
|
||||
output = None
|
||||
if output != None:
|
||||
if basedir != None:
|
||||
output = basedir + "/" + output
|
||||
if os.access(output, os.R_OK) == 0:
|
||||
print "Result for %s missing: %s" % (id, output)
|
||||
output = None
|
||||
else:
|
||||
try:
|
||||
f = open(output)
|
||||
expected = f.read()
|
||||
outputfile = output
|
||||
except:
|
||||
print "Result for %s unreadable: %s" % (id, output)
|
||||
|
||||
try:
|
||||
# print "testing %s" % (URI)
|
||||
doc = libxml2.parseFile(URI)
|
||||
except:
|
||||
doc = None
|
||||
if doc != None:
|
||||
res = doc.xincludeProcess()
|
||||
if res >= 0 and expected != None:
|
||||
result = doc.serialize()
|
||||
if result != expected:
|
||||
print "Result for %s differs" % (id)
|
||||
open("xinclude.res", "w").write(result)
|
||||
diff = os.popen("diff %s xinclude.res" % outputfile).read()
|
||||
|
||||
doc.freeDoc()
|
||||
else:
|
||||
print "Failed to parse %s" % (URI)
|
||||
res = -1
|
||||
|
||||
|
||||
|
||||
test_nr = test_nr + 1
|
||||
if type == 'success':
|
||||
if res > 0:
|
||||
test_succeed = test_succeed + 1
|
||||
elif res == 0:
|
||||
test_failed = test_failed + 1
|
||||
print "Test %s: no substitution done ???" % (id)
|
||||
elif res < 0:
|
||||
test_error = test_error + 1
|
||||
print "Test %s: failed valid XInclude processing" % (id)
|
||||
elif type == 'error':
|
||||
if res > 0:
|
||||
test_error = test_error + 1
|
||||
print "Test %s: failed to detect invalid XInclude processing" % (id)
|
||||
elif res == 0:
|
||||
test_failed = test_failed + 1
|
||||
print "Test %s: Invalid but no substitution done" % (id)
|
||||
elif res < 0:
|
||||
test_succeed = test_succeed + 1
|
||||
elif type == 'optional':
|
||||
if res > 0:
|
||||
test_succeed = test_succeed + 1
|
||||
else:
|
||||
print "Test %s: failed optional test" % (id)
|
||||
|
||||
# Log the ontext
|
||||
if res != 1:
|
||||
log.write("Test ID %s\n" % (id))
|
||||
log.write(" File: %s\n" % (URI))
|
||||
content = string.strip(test.content)
|
||||
while content[-1] == '\n':
|
||||
content = content[0:-1]
|
||||
log.write(" %s:%s\n\n" % (type, content))
|
||||
if error_msg != '':
|
||||
log.write(" ----\n%s ----\n" % (error_msg))
|
||||
error_msg = ''
|
||||
log.write("\n")
|
||||
if diff != None:
|
||||
log.write("diff from test %s:\n" %(id))
|
||||
log.write(" -----------\n%s\n -----------\n" % (diff));
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def runTestCases(case):
|
||||
creator = case.prop('creator')
|
||||
if creator != None:
|
||||
print "=>", creator
|
||||
base = case.getBase(None)
|
||||
basedir = case.prop('basedir')
|
||||
if basedir != None:
|
||||
base = libxml2.buildURI(basedir, base)
|
||||
test = case.children
|
||||
while test != None:
|
||||
if test.name == 'testcase':
|
||||
runTest(test, base)
|
||||
if test.name == 'testcases':
|
||||
runTestCases(test)
|
||||
test = test.next
|
||||
|
||||
conf = libxml2.parseFile(CONF)
|
||||
if conf == None:
|
||||
print "Unable to load %s" % CONF
|
||||
sys.exit(1)
|
||||
|
||||
testsuite = conf.getRootElement()
|
||||
if testsuite.name != 'testsuite':
|
||||
print "Expecting TESTSUITE root element: aborting"
|
||||
sys.exit(1)
|
||||
|
||||
profile = testsuite.prop('PROFILE')
|
||||
if profile != None:
|
||||
print profile
|
||||
|
||||
start = time.time()
|
||||
|
||||
case = testsuite.children
|
||||
while case != None:
|
||||
if case.name == 'testcases':
|
||||
old_test_nr = test_nr
|
||||
old_test_succeed = test_succeed
|
||||
old_test_failed = test_failed
|
||||
old_test_error = test_error
|
||||
runTestCases(case)
|
||||
print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % (
|
||||
test_nr - old_test_nr, test_succeed - old_test_succeed,
|
||||
test_failed - old_test_failed, test_error - old_test_error)
|
||||
case = case.next
|
||||
|
||||
conf.freeDoc()
|
||||
log.close()
|
||||
|
||||
print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % (
|
||||
test_nr, test_succeed, test_failed, test_error, time.time() - start)
|
||||
409
DesktopEditor/xml/libxml2/check-xml-test-suite.py
Normal file
409
DesktopEditor/xml/libxml2/check-xml-test-suite.py
Normal file
@ -0,0 +1,409 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
import string
|
||||
sys.path.insert(0, "python")
|
||||
import libxml2
|
||||
|
||||
test_nr = 0
|
||||
test_succeed = 0
|
||||
test_failed = 0
|
||||
test_error = 0
|
||||
|
||||
#
|
||||
# the testsuite description
|
||||
#
|
||||
CONF="xml-test-suite/xmlconf/xmlconf.xml"
|
||||
LOG="check-xml-test-suite.log"
|
||||
|
||||
log = open(LOG, "w")
|
||||
|
||||
#
|
||||
# Error and warning handlers
|
||||
#
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
def errorHandler(ctx, str):
|
||||
global error_nr
|
||||
global error_msg
|
||||
|
||||
error_nr = error_nr + 1
|
||||
if len(error_msg) < 300:
|
||||
if len(error_msg) == 0 or error_msg[-1] == '\n':
|
||||
error_msg = error_msg + " >>" + str
|
||||
else:
|
||||
error_msg = error_msg + str
|
||||
|
||||
libxml2.registerErrorHandler(errorHandler, None)
|
||||
|
||||
#warning_nr = 0
|
||||
#warning = ''
|
||||
#def warningHandler(ctx, str):
|
||||
# global warning_nr
|
||||
# global warning
|
||||
#
|
||||
# warning_nr = warning_nr + 1
|
||||
# warning = warning + str
|
||||
#
|
||||
#libxml2.registerWarningHandler(warningHandler, None)
|
||||
|
||||
#
|
||||
# Used to load the XML testsuite description
|
||||
#
|
||||
def loadNoentDoc(filename):
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return None
|
||||
ctxt.replaceEntities(1)
|
||||
ctxt.parseDocument()
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if ctxt.wellFormed() != 1:
|
||||
doc.freeDoc()
|
||||
return None
|
||||
return doc
|
||||
|
||||
#
|
||||
# The conformance testing routines
|
||||
#
|
||||
|
||||
def testNotWf(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if doc != None:
|
||||
doc.freeDoc()
|
||||
if ret == 0 or ctxt.wellFormed() != 0:
|
||||
print "%s: error: Well Formedness error not detected" % (id)
|
||||
log.write("%s: error: Well Formedness error not detected\n" % (id))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
def testNotWfEnt(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.replaceEntities(1)
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if doc != None:
|
||||
doc.freeDoc()
|
||||
if ret == 0 or ctxt.wellFormed() != 0:
|
||||
print "%s: error: Well Formedness error not detected" % (id)
|
||||
log.write("%s: error: Well Formedness error not detected\n" % (id))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
def testNotWfEntDtd(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.replaceEntities(1)
|
||||
ctxt.loadSubset(1)
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if doc != None:
|
||||
doc.freeDoc()
|
||||
if ret == 0 or ctxt.wellFormed() != 0:
|
||||
print "%s: error: Well Formedness error not detected" % (id)
|
||||
log.write("%s: error: Well Formedness error not detected\n" % (id))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
def testWfEntDtd(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.replaceEntities(1)
|
||||
ctxt.loadSubset(1)
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if doc == None or ret != 0 or ctxt.wellFormed() == 0:
|
||||
print "%s: error: wrongly failed to parse the document" % (id)
|
||||
log.write("%s: error: wrongly failed to parse the document\n" % (id))
|
||||
if doc != None:
|
||||
doc.freeDoc()
|
||||
return 0
|
||||
if error_nr != 0:
|
||||
print "%s: warning: WF document generated an error msg" % (id)
|
||||
log.write("%s: error: WF document generated an error msg\n" % (id))
|
||||
doc.freeDoc()
|
||||
return 2
|
||||
doc.freeDoc()
|
||||
return 1
|
||||
|
||||
def testError(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.replaceEntities(1)
|
||||
ctxt.loadSubset(1)
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
if doc != None:
|
||||
doc.freeDoc()
|
||||
if ctxt.wellFormed() == 0:
|
||||
print "%s: warning: failed to parse the document but accepted" % (id)
|
||||
log.write("%s: warning: failed to parse the document but accepte\n" % (id))
|
||||
return 2
|
||||
if error_nr != 0:
|
||||
print "%s: warning: WF document generated an error msg" % (id)
|
||||
log.write("%s: error: WF document generated an error msg\n" % (id))
|
||||
return 2
|
||||
return 1
|
||||
|
||||
def testInvalid(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.validate(1)
|
||||
ret = ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
valid = ctxt.isValid()
|
||||
if doc == None:
|
||||
print "%s: error: wrongly failed to parse the document" % (id)
|
||||
log.write("%s: error: wrongly failed to parse the document\n" % (id))
|
||||
return 0
|
||||
if valid == 1:
|
||||
print "%s: error: Validity error not detected" % (id)
|
||||
log.write("%s: error: Validity error not detected\n" % (id))
|
||||
doc.freeDoc()
|
||||
return 0
|
||||
if error_nr == 0:
|
||||
print "%s: warning: Validity error not reported" % (id)
|
||||
log.write("%s: warning: Validity error not reported\n" % (id))
|
||||
doc.freeDoc()
|
||||
return 2
|
||||
|
||||
doc.freeDoc()
|
||||
return 1
|
||||
|
||||
def testValid(filename, id):
|
||||
global error_nr
|
||||
global error_msg
|
||||
|
||||
error_nr = 0
|
||||
error_msg = ''
|
||||
|
||||
ctxt = libxml2.createFileParserCtxt(filename)
|
||||
if ctxt == None:
|
||||
return -1
|
||||
ctxt.validate(1)
|
||||
ctxt.parseDocument()
|
||||
|
||||
try:
|
||||
doc = ctxt.doc()
|
||||
except:
|
||||
doc = None
|
||||
valid = ctxt.isValid()
|
||||
if doc == None:
|
||||
print "%s: error: wrongly failed to parse the document" % (id)
|
||||
log.write("%s: error: wrongly failed to parse the document\n" % (id))
|
||||
return 0
|
||||
if valid != 1:
|
||||
print "%s: error: Validity check failed" % (id)
|
||||
log.write("%s: error: Validity check failed\n" % (id))
|
||||
doc.freeDoc()
|
||||
return 0
|
||||
if error_nr != 0 or valid != 1:
|
||||
print "%s: warning: valid document reported an error" % (id)
|
||||
log.write("%s: warning: valid document reported an error\n" % (id))
|
||||
doc.freeDoc()
|
||||
return 2
|
||||
doc.freeDoc()
|
||||
return 1
|
||||
|
||||
def runTest(test):
|
||||
global test_nr
|
||||
global test_succeed
|
||||
global test_failed
|
||||
global error_msg
|
||||
global log
|
||||
|
||||
uri = test.prop('URI')
|
||||
id = test.prop('ID')
|
||||
if uri == None:
|
||||
print "Test without ID:", uri
|
||||
return -1
|
||||
if id == None:
|
||||
print "Test without URI:", id
|
||||
return -1
|
||||
base = test.getBase(None)
|
||||
URI = libxml2.buildURI(uri, base)
|
||||
if os.access(URI, os.R_OK) == 0:
|
||||
print "Test %s missing: base %s uri %s" % (URI, base, uri)
|
||||
return -1
|
||||
type = test.prop('TYPE')
|
||||
if type == None:
|
||||
print "Test %s missing TYPE" % (id)
|
||||
return -1
|
||||
|
||||
extra = None
|
||||
if type == "invalid":
|
||||
res = testInvalid(URI, id)
|
||||
elif type == "valid":
|
||||
res = testValid(URI, id)
|
||||
elif type == "not-wf":
|
||||
extra = test.prop('ENTITIES')
|
||||
# print URI
|
||||
#if extra == None:
|
||||
# res = testNotWfEntDtd(URI, id)
|
||||
#elif extra == 'none':
|
||||
# res = testNotWf(URI, id)
|
||||
#elif extra == 'general':
|
||||
# res = testNotWfEnt(URI, id)
|
||||
#elif extra == 'both' or extra == 'parameter':
|
||||
res = testNotWfEntDtd(URI, id)
|
||||
#else:
|
||||
# print "Unknow value %s for an ENTITIES test value" % (extra)
|
||||
# return -1
|
||||
elif type == "error":
|
||||
res = testError(URI, id)
|
||||
else:
|
||||
# TODO skipped for now
|
||||
return -1
|
||||
|
||||
test_nr = test_nr + 1
|
||||
if res > 0:
|
||||
test_succeed = test_succeed + 1
|
||||
elif res == 0:
|
||||
test_failed = test_failed + 1
|
||||
elif res < 0:
|
||||
test_error = test_error + 1
|
||||
|
||||
# Log the ontext
|
||||
if res != 1:
|
||||
log.write(" File: %s\n" % (URI))
|
||||
content = string.strip(test.content)
|
||||
while content[-1] == '\n':
|
||||
content = content[0:-1]
|
||||
if extra != None:
|
||||
log.write(" %s:%s:%s\n" % (type, extra, content))
|
||||
else:
|
||||
log.write(" %s:%s\n\n" % (type, content))
|
||||
if error_msg != '':
|
||||
log.write(" ----\n%s ----\n" % (error_msg))
|
||||
error_msg = ''
|
||||
log.write("\n")
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def runTestCases(case):
|
||||
profile = case.prop('PROFILE')
|
||||
if profile != None and \
|
||||
string.find(profile, "IBM XML Conformance Test Suite - Production") < 0:
|
||||
print "=>", profile
|
||||
test = case.children
|
||||
while test != None:
|
||||
if test.name == 'TEST':
|
||||
runTest(test)
|
||||
if test.name == 'TESTCASES':
|
||||
runTestCases(test)
|
||||
test = test.next
|
||||
|
||||
conf = loadNoentDoc(CONF)
|
||||
if conf == None:
|
||||
print "Unable to load %s" % CONF
|
||||
sys.exit(1)
|
||||
|
||||
testsuite = conf.getRootElement()
|
||||
if testsuite.name != 'TESTSUITE':
|
||||
print "Expecting TESTSUITE root element: aborting"
|
||||
sys.exit(1)
|
||||
|
||||
profile = testsuite.prop('PROFILE')
|
||||
if profile != None:
|
||||
print profile
|
||||
|
||||
start = time.time()
|
||||
|
||||
case = testsuite.children
|
||||
while case != None:
|
||||
if case.name == 'TESTCASES':
|
||||
old_test_nr = test_nr
|
||||
old_test_succeed = test_succeed
|
||||
old_test_failed = test_failed
|
||||
old_test_error = test_error
|
||||
runTestCases(case)
|
||||
print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % (
|
||||
test_nr - old_test_nr, test_succeed - old_test_succeed,
|
||||
test_failed - old_test_failed, test_error - old_test_error)
|
||||
case = case.next
|
||||
|
||||
conf.freeDoc()
|
||||
log.close()
|
||||
|
||||
print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % (
|
||||
test_nr, test_succeed, test_failed, test_error, time.time() - start)
|
||||
420
DesktopEditor/xml/libxml2/check-xsddata-test-suite.py
Normal file
420
DesktopEditor/xml/libxml2/check-xsddata-test-suite.py
Normal file
@ -0,0 +1,420 @@
|
||||
#!/usr/bin/python
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
import string
|
||||
import StringIO
|
||||
sys.path.insert(0, "python")
|
||||
import libxml2
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.debugMemory(1)
|
||||
debug = 0
|
||||
verbose = 0
|
||||
quiet = 1
|
||||
|
||||
#
|
||||
# the testsuite description
|
||||
#
|
||||
CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml")
|
||||
LOG="check-xsddata-test-suite.log"
|
||||
|
||||
log = open(LOG, "w")
|
||||
nb_schemas_tests = 0
|
||||
nb_schemas_success = 0
|
||||
nb_schemas_failed = 0
|
||||
nb_instances_tests = 0
|
||||
nb_instances_success = 0
|
||||
nb_instances_failed = 0
|
||||
|
||||
libxml2.lineNumbersDefault(1)
|
||||
#
|
||||
# Error and warnng callbacks
|
||||
#
|
||||
def callback(ctx, str):
|
||||
global log
|
||||
log.write("%s%s" % (ctx, str))
|
||||
|
||||
libxml2.registerErrorHandler(callback, "")
|
||||
|
||||
#
|
||||
# Resolver callback
|
||||
#
|
||||
resources = {}
|
||||
def resolver(URL, ID, ctxt):
|
||||
global resources
|
||||
|
||||
if resources.has_key(URL):
|
||||
return(StringIO.StringIO(resources[URL]))
|
||||
log.write("Resolver failure: asked %s\n" % (URL))
|
||||
log.write("resources: %s\n" % (resources))
|
||||
return None
|
||||
|
||||
#
|
||||
# handle a valid instance
|
||||
#
|
||||
def handle_valid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = node.prop("dtd")
|
||||
if instance == None:
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
mem = libxml2.debugMemory(1);
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nFailed to parse correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
return
|
||||
|
||||
if debug:
|
||||
print "instance line %d" % (node.lineNo())
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
del ctxt
|
||||
except:
|
||||
ret = -1
|
||||
|
||||
doc.freeDoc()
|
||||
if mem != libxml2.debugMemory(1):
|
||||
print "validating instance %d line %d leaks" % (
|
||||
nb_instances_tests, node.lineNo())
|
||||
|
||||
if ret != 0:
|
||||
log.write("\nFailed to validate correct instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
|
||||
#
|
||||
# handle an invalid instance
|
||||
#
|
||||
def handle_invalid(node, schema):
|
||||
global log
|
||||
global nb_instances_success
|
||||
global nb_instances_failed
|
||||
|
||||
instance = node.prop("dtd")
|
||||
if instance == None:
|
||||
instance = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
instance = instance + child.serialize()
|
||||
child = child.next
|
||||
|
||||
# mem = libxml2.debugMemory(1);
|
||||
|
||||
try:
|
||||
doc = libxml2.parseDoc(instance)
|
||||
except:
|
||||
doc = None
|
||||
|
||||
if doc == None:
|
||||
log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
return
|
||||
|
||||
if debug:
|
||||
print "instance line %d" % (node.lineNo())
|
||||
|
||||
try:
|
||||
ctxt = schema.relaxNGNewValidCtxt()
|
||||
ret = doc.relaxNGValidateDoc(ctxt)
|
||||
del ctxt
|
||||
|
||||
except:
|
||||
ret = -1
|
||||
|
||||
doc.freeDoc()
|
||||
# if mem != libxml2.debugMemory(1):
|
||||
# print "validating instance %d line %d leaks" % (
|
||||
# nb_instances_tests, node.lineNo())
|
||||
|
||||
if ret == 0:
|
||||
log.write("\nFailed to detect validation problem in instance:\n-----\n")
|
||||
log.write(instance)
|
||||
log.write("\n-----\n")
|
||||
nb_instances_failed = nb_instances_failed + 1
|
||||
else:
|
||||
nb_instances_success = nb_instances_success + 1
|
||||
|
||||
#
|
||||
# handle an incorrect test
|
||||
#
|
||||
def handle_correct(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs == None:
|
||||
log.write("\nFailed to compile correct schema:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return rngs
|
||||
|
||||
def handle_incorrect(node):
|
||||
global log
|
||||
global nb_schemas_success
|
||||
global nb_schemas_failed
|
||||
|
||||
schema = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
schema = schema + child.serialize()
|
||||
child = child.next
|
||||
|
||||
try:
|
||||
rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
|
||||
rngs = rngp.relaxNGParse()
|
||||
except:
|
||||
rngs = None
|
||||
if rngs != None:
|
||||
log.write("\nFailed to detect schema error in:\n-----\n")
|
||||
log.write(schema)
|
||||
log.write("\n-----\n")
|
||||
nb_schemas_failed = nb_schemas_failed + 1
|
||||
else:
|
||||
# log.write("\nSuccess detecting schema error in:\n-----\n")
|
||||
# log.write(schema)
|
||||
# log.write("\n-----\n")
|
||||
nb_schemas_success = nb_schemas_success + 1
|
||||
return None
|
||||
|
||||
#
|
||||
# resource handling: keep a dictionary of URL->string mappings
|
||||
#
|
||||
def handle_resource(node, dir):
|
||||
global resources
|
||||
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
res = ""
|
||||
child = node.children
|
||||
while child != None:
|
||||
if child.type != 'text':
|
||||
res = res + child.serialize()
|
||||
child = child.next
|
||||
resources[name] = res
|
||||
|
||||
#
|
||||
# dir handling: pseudo directory resources
|
||||
#
|
||||
def handle_dir(node, dir):
|
||||
try:
|
||||
name = node.prop('name')
|
||||
except:
|
||||
name = None
|
||||
|
||||
if name == None or name == '':
|
||||
log.write("resource has no name")
|
||||
return;
|
||||
|
||||
if dir != None:
|
||||
# name = libxml2.buildURI(name, dir)
|
||||
name = dir + '/' + name
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, name)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, name)
|
||||
|
||||
#
|
||||
# handle a testCase element
|
||||
#
|
||||
def handle_testCase(node):
|
||||
global nb_schemas_tests
|
||||
global nb_instances_tests
|
||||
global resources
|
||||
|
||||
sections = node.xpathEval('string(section)')
|
||||
log.write("\n ======== test %d line %d section %s ==========\n" % (
|
||||
|
||||
nb_schemas_tests, node.lineNo(), sections))
|
||||
resources = {}
|
||||
if debug:
|
||||
print "test %d line %d" % (nb_schemas_tests, node.lineNo())
|
||||
|
||||
dirs = node.xpathEval('dir')
|
||||
for dir in dirs:
|
||||
handle_dir(dir, None)
|
||||
res = node.xpathEval('resource')
|
||||
for r in res:
|
||||
handle_resource(r, None)
|
||||
|
||||
tsts = node.xpathEval('incorrect')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <incorrect> example" %(node.lineNo())
|
||||
schema = handle_incorrect(tsts[0])
|
||||
else:
|
||||
tsts = node.xpathEval('correct')
|
||||
if tsts != []:
|
||||
if len(tsts) != 1:
|
||||
print "warning test line %d has more than one <correct> example"% (node.lineNo())
|
||||
schema = handle_correct(tsts[0])
|
||||
else:
|
||||
print "warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo())
|
||||
|
||||
nb_schemas_tests = nb_schemas_tests + 1;
|
||||
|
||||
valids = node.xpathEval('valid')
|
||||
invalids = node.xpathEval('invalid')
|
||||
nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
|
||||
if schema != None:
|
||||
for valid in valids:
|
||||
handle_valid(valid, schema)
|
||||
for invalid in invalids:
|
||||
handle_invalid(invalid, schema)
|
||||
|
||||
|
||||
#
|
||||
# handle a testSuite element
|
||||
#
|
||||
def handle_testSuite(node, level = 0):
|
||||
global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
|
||||
global nb_instances_tests, nb_instances_success, nb_instances_failed
|
||||
if verbose and level >= 0:
|
||||
old_schemas_tests = nb_schemas_tests
|
||||
old_schemas_success = nb_schemas_success
|
||||
old_schemas_failed = nb_schemas_failed
|
||||
old_instances_tests = nb_instances_tests
|
||||
old_instances_success = nb_instances_success
|
||||
old_instances_failed = nb_instances_failed
|
||||
|
||||
docs = node.xpathEval('documentation')
|
||||
authors = node.xpathEval('author')
|
||||
if docs != []:
|
||||
msg = ""
|
||||
for doc in docs:
|
||||
msg = msg + doc.content + " "
|
||||
if authors != []:
|
||||
msg = msg + "written by "
|
||||
for author in authors:
|
||||
msg = msg + author.content + " "
|
||||
if quiet == 0:
|
||||
print msg
|
||||
sections = node.xpathEval('section')
|
||||
if verbose and sections != [] and level <= 0:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
if quiet == 0:
|
||||
print "Tests for section %s" % (msg)
|
||||
for test in node.xpathEval('testCase'):
|
||||
handle_testCase(test)
|
||||
for test in node.xpathEval('testSuite'):
|
||||
handle_testSuite(test, level + 1)
|
||||
|
||||
|
||||
if verbose and level >= 0 :
|
||||
if sections != []:
|
||||
msg = ""
|
||||
for section in sections:
|
||||
msg = msg + section.content + " "
|
||||
print "Result of tests for section %s" % (msg)
|
||||
elif docs != []:
|
||||
msg = ""
|
||||
for doc in docs:
|
||||
msg = msg + doc.content + " "
|
||||
print "Result of tests for %s" % (msg)
|
||||
|
||||
if nb_schemas_tests != old_schemas_tests:
|
||||
print "found %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests - old_schemas_tests,
|
||||
nb_schemas_success - old_schemas_success,
|
||||
nb_schemas_failed - old_schemas_failed)
|
||||
if nb_instances_tests != old_instances_tests:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests - old_instances_tests,
|
||||
nb_instances_success - old_instances_success,
|
||||
nb_instances_failed - old_instances_failed)
|
||||
#
|
||||
# Parse the conf file
|
||||
#
|
||||
libxml2.substituteEntitiesDefault(1);
|
||||
testsuite = libxml2.parseFile(CONF)
|
||||
|
||||
#
|
||||
# Error and warnng callbacks
|
||||
#
|
||||
def callback(ctx, str):
|
||||
global log
|
||||
log.write("%s%s" % (ctx, str))
|
||||
|
||||
libxml2.registerErrorHandler(callback, "")
|
||||
|
||||
libxml2.setEntityLoader(resolver)
|
||||
root = testsuite.getRootElement()
|
||||
if root.name != 'testSuite':
|
||||
print "%s doesn't start with a testSuite element, aborting" % (CONF)
|
||||
sys.exit(1)
|
||||
if quiet == 0:
|
||||
print "Running Relax NG testsuite"
|
||||
handle_testSuite(root)
|
||||
|
||||
if quiet == 0 or nb_schemas_failed != 0:
|
||||
print "\nTOTAL:\nfound %d test schemas: %d success %d failures" % (
|
||||
nb_schemas_tests, nb_schemas_success, nb_schemas_failed)
|
||||
if quiet == 0 or nb_instances_failed != 0:
|
||||
print "found %d test instances: %d success %d failures" % (
|
||||
nb_instances_tests, nb_instances_success, nb_instances_failed)
|
||||
|
||||
testsuite.freeDoc()
|
||||
|
||||
# Memory debug specific
|
||||
libxml2.relaxNGCleanupTypes()
|
||||
libxml2.cleanupParser()
|
||||
if libxml2.debugMemory(1) == 0:
|
||||
if quiet == 0:
|
||||
print "OK"
|
||||
else:
|
||||
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
|
||||
libxml2.dumpMemory()
|
||||
336
DesktopEditor/xml/libxml2/chvalid.c
Normal file
336
DesktopEditor/xml/libxml2/chvalid.c
Normal file
@ -0,0 +1,336 @@
|
||||
/*
|
||||
* chvalid.c: this module implements the character range
|
||||
* validation APIs
|
||||
*
|
||||
* This file is automatically generated from the cvs source
|
||||
* definition files using the genChRanges.py Python script
|
||||
*
|
||||
* Generation date: Mon Mar 27 11:09:48 2006
|
||||
* Sources: chvalid.def
|
||||
* William Brack <wbrack@mmm.com.hk>
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#include <libxml/chvalid.h>
|
||||
|
||||
/*
|
||||
* The initial tables ({func_name}_tab) are used to validate whether a
|
||||
* single-byte character is within the specified group. Each table
|
||||
* contains 256 bytes, with each byte representing one of the 256
|
||||
* possible characters. If the table byte is set, the character is
|
||||
* allowed.
|
||||
*
|
||||
*/
|
||||
const unsigned char xmlIsPubidChar_tab[256] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
static const xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131},
|
||||
{0x134, 0x13e}, {0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3},
|
||||
{0x1cd, 0x1f0}, {0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8},
|
||||
{0x2bb, 0x2c1}, {0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c},
|
||||
{0x38e, 0x3a1}, {0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da},
|
||||
{0x3dc, 0x3dc}, {0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3},
|
||||
{0x401, 0x40c}, {0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481},
|
||||
{0x490, 0x4c4}, {0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb},
|
||||
{0x4ee, 0x4f5}, {0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559},
|
||||
{0x561, 0x586}, {0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a},
|
||||
{0x641, 0x64a}, {0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce},
|
||||
{0x6d0, 0x6d3}, {0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939},
|
||||
{0x93d, 0x93d}, {0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990},
|
||||
{0x993, 0x9a8}, {0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9},
|
||||
{0x9dc, 0x9dd}, {0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a},
|
||||
{0xa0f, 0xa10}, {0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33},
|
||||
{0xa35, 0xa36}, {0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e},
|
||||
{0xa72, 0xa74}, {0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91},
|
||||
{0xa93, 0xaa8}, {0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9},
|
||||
{0xabd, 0xabd}, {0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10},
|
||||
{0xb13, 0xb28}, {0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39},
|
||||
{0xb3d, 0xb3d}, {0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a},
|
||||
{0xb8e, 0xb90}, {0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c},
|
||||
{0xb9e, 0xb9f}, {0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5},
|
||||
{0xbb7, 0xbb9}, {0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28},
|
||||
{0xc2a, 0xc33}, {0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c},
|
||||
{0xc8e, 0xc90}, {0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9},
|
||||
{0xcde, 0xcde}, {0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10},
|
||||
{0xd12, 0xd28}, {0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e},
|
||||
{0xe30, 0xe30}, {0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82},
|
||||
{0xe84, 0xe84}, {0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d},
|
||||
{0xe94, 0xe97}, {0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5},
|
||||
{0xea7, 0xea7}, {0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0},
|
||||
{0xeb2, 0xeb3}, {0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47},
|
||||
{0xf49, 0xf69}, {0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100},
|
||||
{0x1102, 0x1103}, {0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c},
|
||||
{0x110e, 0x1112}, {0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140},
|
||||
{0x114c, 0x114c}, {0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155},
|
||||
{0x1159, 0x1159}, {0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165},
|
||||
{0x1167, 0x1167}, {0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173},
|
||||
{0x1175, 0x1175}, {0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab},
|
||||
{0x11ae, 0x11af}, {0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2},
|
||||
{0x11eb, 0x11eb}, {0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b},
|
||||
{0x1ea0, 0x1ef9}, {0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45},
|
||||
{0x1f48, 0x1f4d}, {0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b},
|
||||
{0x1f5d, 0x1f5d}, {0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc},
|
||||
{0x1fbe, 0x1fbe}, {0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3},
|
||||
{0x1fd6, 0x1fdb}, {0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc},
|
||||
{0x2126, 0x2126}, {0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182},
|
||||
{0x3041, 0x3094}, {0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}};
|
||||
const xmlChRangeGroup xmlIsBaseCharGroup =
|
||||
{197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static const xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff},
|
||||
{0xe000, 0xfffd}};
|
||||
static const xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}};
|
||||
const xmlChRangeGroup xmlIsCharGroup =
|
||||
{2, 1, xmlIsChar_srng, xmlIsChar_lrng};
|
||||
|
||||
static const xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345},
|
||||
{0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9},
|
||||
{0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4},
|
||||
{0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df},
|
||||
{0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903},
|
||||
{0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954},
|
||||
{0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be},
|
||||
{0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd},
|
||||
{0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c},
|
||||
{0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48},
|
||||
{0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc},
|
||||
{0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03},
|
||||
{0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d},
|
||||
{0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
|
||||
{0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44},
|
||||
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83},
|
||||
{0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6},
|
||||
{0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d},
|
||||
{0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e},
|
||||
{0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd},
|
||||
{0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39},
|
||||
{0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b},
|
||||
{0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7},
|
||||
{0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f},
|
||||
{0x3099, 0x3099}, {0x309a, 0x309a}};
|
||||
const xmlChRangeGroup xmlIsCombiningGroup =
|
||||
{95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static const xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669},
|
||||
{0x6f0, 0x6f9}, {0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f},
|
||||
{0xae6, 0xaef}, {0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f},
|
||||
{0xce6, 0xcef}, {0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9},
|
||||
{0xf20, 0xf29}};
|
||||
const xmlChRangeGroup xmlIsDigitGroup =
|
||||
{14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static const xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0},
|
||||
{0x2d1, 0x2d1}, {0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46},
|
||||
{0xec6, 0xec6}, {0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e},
|
||||
{0x30fc, 0x30fe}};
|
||||
const xmlChRangeGroup xmlIsExtenderGroup =
|
||||
{10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static const xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007},
|
||||
{0x3021, 0x3029}, {0x4e00, 0x9fa5}};
|
||||
const xmlChRangeGroup xmlIsIdeographicGroup =
|
||||
{3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
|
||||
|
||||
|
||||
/**
|
||||
* xmlCharInRange:
|
||||
* @val: character to be validated
|
||||
* @rptr: pointer to range to be used to validate
|
||||
*
|
||||
* Does a binary search of the range table to determine if char
|
||||
* is valid
|
||||
*
|
||||
* Returns: true if character valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
|
||||
int low, high, mid;
|
||||
const xmlChSRange *sptr;
|
||||
const xmlChLRange *lptr;
|
||||
|
||||
if (rptr == NULL) return(0);
|
||||
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
|
||||
if (rptr->nbShortRange == 0)
|
||||
return 0;
|
||||
low = 0;
|
||||
high = rptr->nbShortRange - 1;
|
||||
sptr = rptr->shortRange;
|
||||
while (low <= high) {
|
||||
mid = (low + high) / 2;
|
||||
if ((unsigned short) val < sptr[mid].low) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
if ((unsigned short) val > sptr[mid].high) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (rptr->nbLongRange == 0) {
|
||||
return 0;
|
||||
}
|
||||
low = 0;
|
||||
high = rptr->nbLongRange - 1;
|
||||
lptr = rptr->longRange;
|
||||
while (low <= high) {
|
||||
mid = (low + high) / 2;
|
||||
if (val < lptr[mid].low) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
if (val > lptr[mid].high) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsBaseChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsBaseChar(unsigned int ch) {
|
||||
return(xmlIsBaseCharQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsBlank:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsBlank_ch or xmlIsBlankQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsBlank(unsigned int ch) {
|
||||
return(xmlIsBlankQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsChar_ch or xmlIsCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsChar(unsigned int ch) {
|
||||
return(xmlIsCharQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsCombining:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsCombiningQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsCombining(unsigned int ch) {
|
||||
return(xmlIsCombiningQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsDigit:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsDigit_ch or xmlIsDigitQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsDigit(unsigned int ch) {
|
||||
return(xmlIsDigitQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsExtender:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsExtender_ch or xmlIsExtenderQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsExtender(unsigned int ch) {
|
||||
return(xmlIsExtenderQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsIdeographic:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsIdeographicQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsIdeographic(unsigned int ch) {
|
||||
return(xmlIsIdeographicQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsPubidChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsPubidChar(unsigned int ch) {
|
||||
return(xmlIsPubidCharQ(ch));
|
||||
}
|
||||
|
||||
#define bottom_chvalid
|
||||
#include "elfgcchack.h"
|
||||
361
DesktopEditor/xml/libxml2/chvalid.def
Normal file
361
DesktopEditor/xml/libxml2/chvalid.def
Normal file
@ -0,0 +1,361 @@
|
||||
name xmlIsChar
|
||||
ur 0x9
|
||||
ur 0xA
|
||||
ur 0xD
|
||||
ur 0x20..0xFF
|
||||
ur 0x0100..0xD7FF
|
||||
ur 0xE000..0xFFFD
|
||||
ur 0x10000..0x10FFFF
|
||||
end xmlIsChar
|
||||
|
||||
name xmlIsPubidChar
|
||||
ur 0x20 0x0d 0x0a 'a'..'z' 'A'..'Z' '0'..'9'
|
||||
ur '-' 0x27 '(' ')' '+' ',' '.' '/'
|
||||
ur ':' '=' '?' ';' '!' '*' '#' '@'
|
||||
ur '$' '_' '%'
|
||||
end
|
||||
|
||||
name xmlIsBlank
|
||||
ur 0x09 0x0a 0x0d 0x20
|
||||
end xmlIsBlank
|
||||
|
||||
name xmlIsBaseChar
|
||||
ur 0x0041..0x005A
|
||||
ur 0x0061..0x007A
|
||||
ur 0x00C0..0x00D6
|
||||
ur 0x00D8..0x00F6
|
||||
ur 0x00F8..0x00FF
|
||||
ur 0x0100..0x0131
|
||||
ur 0x0134..0x013E
|
||||
ur 0x0141..0x0148
|
||||
ur 0x014A..0x017E
|
||||
ur 0x0180..0x01C3
|
||||
ur 0x01CD..0x01F0
|
||||
ur 0x01F4..0x01F5
|
||||
ur 0x01FA..0x0217
|
||||
ur 0x0250..0x02A8
|
||||
ur 0x02BB..0x02C1
|
||||
ur 0x0386
|
||||
ur 0x0388..0x038A
|
||||
ur 0x038C
|
||||
ur 0x038E..0x03A1
|
||||
ur 0x03A3..0x03CE
|
||||
ur 0x03D0..0x03D6
|
||||
ur 0x03DA
|
||||
ur 0x03DC
|
||||
ur 0x03DE
|
||||
ur 0x03E0
|
||||
ur 0x03E2..0x03F3
|
||||
ur 0x0401..0x040C
|
||||
ur 0x040E..0x044F
|
||||
ur 0x0451..0x045C
|
||||
ur 0x045E..0x0481
|
||||
ur 0x0490..0x04C4
|
||||
ur 0x04C7..0x04C8
|
||||
ur 0x04CB..0x04CC
|
||||
ur 0x04D0..0x04EB
|
||||
ur 0x04EE..0x04F5
|
||||
ur 0x04F8..0x04F9
|
||||
ur 0x0531..0x0556
|
||||
ur 0x0559
|
||||
ur 0x0561..0x0586
|
||||
ur 0x05D0..0x05EA
|
||||
ur 0x05F0..0x05F2
|
||||
ur 0x0621..0x063A
|
||||
ur 0x0641..0x064A
|
||||
ur 0x0671..0x06B7
|
||||
ur 0x06BA..0x06BE
|
||||
ur 0x06C0..0x06CE
|
||||
ur 0x06D0..0x06D3
|
||||
ur 0x06D5
|
||||
ur 0x06E5..0x06E6
|
||||
ur 0x0905..0x0939
|
||||
ur 0x093D
|
||||
ur 0x0958..0x0961
|
||||
ur 0x0985..0x098C
|
||||
ur 0x098F..0x0990
|
||||
ur 0x0993..0x09A8
|
||||
ur 0x09AA..0x09B0
|
||||
ur 0x09B2
|
||||
ur 0x09B6..0x09B9
|
||||
ur 0x09DC..0x09DD
|
||||
ur 0x09DF..0x09E1
|
||||
ur 0x09F0..0x09F1
|
||||
ur 0x0A05..0x0A0A
|
||||
ur 0x0A0F..0x0A10
|
||||
ur 0x0A13..0x0A28
|
||||
ur 0x0A2A..0x0A30
|
||||
ur 0x0A32..0x0A33
|
||||
ur 0x0A35..0x0A36
|
||||
ur 0x0A38..0x0A39
|
||||
ur 0x0A59..0x0A5C
|
||||
ur 0x0A5E
|
||||
ur 0x0A72..0x0A74
|
||||
ur 0x0A85..0x0A8B
|
||||
ur 0x0A8D
|
||||
ur 0x0A8F..0x0A91
|
||||
ur 0x0A93..0x0AA8
|
||||
ur 0x0AAA..0x0AB0
|
||||
ur 0x0AB2..0x0AB3
|
||||
ur 0x0AB5..0x0AB9
|
||||
ur 0x0ABD
|
||||
ur 0x0AE0
|
||||
ur 0x0B05..0x0B0C
|
||||
ur 0x0B0F..0x0B10
|
||||
ur 0x0B13..0x0B28
|
||||
ur 0x0B2A..0x0B30
|
||||
ur 0x0B32..0x0B33
|
||||
ur 0x0B36..0x0B39
|
||||
ur 0x0B3D
|
||||
ur 0x0B5C..0x0B5D
|
||||
ur 0x0B5F..0x0B61
|
||||
ur 0x0B85..0x0B8A
|
||||
ur 0x0B8E..0x0B90
|
||||
ur 0x0B92..0x0B95
|
||||
ur 0x0B99..0x0B9A
|
||||
ur 0x0B9C
|
||||
ur 0x0B9E..0x0B9F
|
||||
ur 0x0BA3..0x0BA4
|
||||
ur 0x0BA8..0x0BAA
|
||||
ur 0x0BAE..0x0BB5
|
||||
ur 0x0BB7..0x0BB9
|
||||
ur 0x0C05..0x0C0C
|
||||
ur 0x0C0E..0x0C10
|
||||
ur 0x0C12..0x0C28
|
||||
ur 0x0C2A..0x0C33
|
||||
ur 0x0C35..0x0C39
|
||||
ur 0x0C60..0x0C61
|
||||
ur 0x0C85..0x0C8C
|
||||
ur 0x0C8E..0x0C90
|
||||
ur 0x0C92..0x0CA8
|
||||
ur 0x0CAA..0x0CB3
|
||||
ur 0x0CB5..0x0CB9
|
||||
ur 0x0CDE
|
||||
ur 0x0CE0..0x0CE1
|
||||
ur 0x0D05..0x0D0C
|
||||
ur 0x0D0E..0x0D10
|
||||
ur 0x0D12..0x0D28
|
||||
ur 0x0D2A..0x0D39
|
||||
ur 0x0D60..0x0D61
|
||||
ur 0x0E01..0x0E2E
|
||||
ur 0x0E30
|
||||
ur 0x0E32..0x0E33
|
||||
ur 0x0E40..0x0E45
|
||||
ur 0x0E81..0x0E82
|
||||
ur 0x0E84
|
||||
ur 0x0E87..0x0E88
|
||||
ur 0x0E8A
|
||||
ur 0x0E8D
|
||||
ur 0x0E94..0x0E97
|
||||
ur 0x0E99..0x0E9F
|
||||
ur 0x0EA1..0x0EA3
|
||||
ur 0x0EA5
|
||||
ur 0x0EA7
|
||||
ur 0x0EAA..0x0EAB
|
||||
ur 0x0EAD..0x0EAE
|
||||
ur 0x0EB0
|
||||
ur 0x0EB2..0x0EB3
|
||||
ur 0x0EBD
|
||||
ur 0x0EC0..0x0EC4
|
||||
ur 0x0F40..0x0F47
|
||||
ur 0x0F49..0x0F69
|
||||
ur 0x10A0..0x10C5
|
||||
ur 0x10D0..0x10F6
|
||||
ur 0x1100
|
||||
ur 0x1102..0x1103
|
||||
ur 0x1105..0x1107
|
||||
ur 0x1109
|
||||
ur 0x110B..0x110C
|
||||
ur 0x110E..0x1112
|
||||
ur 0x113C
|
||||
ur 0x113E
|
||||
ur 0x1140
|
||||
ur 0x114C
|
||||
ur 0x114E
|
||||
ur 0x1150
|
||||
ur 0x1154..0x1155
|
||||
ur 0x1159
|
||||
ur 0x115F..0x1161
|
||||
ur 0x1163
|
||||
ur 0x1165
|
||||
ur 0x1167
|
||||
ur 0x1169
|
||||
ur 0x116D..0x116E
|
||||
ur 0x1172..0x1173
|
||||
ur 0x1175
|
||||
ur 0x119E
|
||||
ur 0x11A8
|
||||
ur 0x11AB
|
||||
ur 0x11AE..0x11AF
|
||||
ur 0x11B7..0x11B8
|
||||
ur 0x11BA
|
||||
ur 0x11BC..0x11C2
|
||||
ur 0x11EB
|
||||
ur 0x11F0
|
||||
ur 0x11F9
|
||||
ur 0x1E00..0x1E9B
|
||||
ur 0x1EA0..0x1EF9
|
||||
ur 0x1F00..0x1F15
|
||||
ur 0x1F18..0x1F1D
|
||||
ur 0x1F20..0x1F45
|
||||
ur 0x1F48..0x1F4D
|
||||
ur 0x1F50..0x1F57
|
||||
ur 0x1F59
|
||||
ur 0x1F5B
|
||||
ur 0x1F5D
|
||||
ur 0x1F5F..0x1F7D
|
||||
ur 0x1F80..0x1FB4
|
||||
ur 0x1FB6..0x1FBC
|
||||
ur 0x1FBE
|
||||
ur 0x1FC2..0x1FC4
|
||||
ur 0x1FC6..0x1FCC
|
||||
ur 0x1FD0..0x1FD3
|
||||
ur 0x1FD6..0x1FDB
|
||||
ur 0x1FE0..0x1FEC
|
||||
ur 0x1FF2..0x1FF4
|
||||
ur 0x1FF6..0x1FFC
|
||||
ur 0x2126
|
||||
ur 0x212A..0x212B
|
||||
ur 0x212E
|
||||
ur 0x2180..0x2182
|
||||
ur 0x3041..0x3094
|
||||
ur 0x30A1..0x30FA
|
||||
ur 0x3105..0x312C
|
||||
ur 0xAC00..0xD7A3
|
||||
end xmlIsBaseChar
|
||||
|
||||
name xmlIsIdeographic
|
||||
ur 0x4E00..0x9FA5
|
||||
ur 0x3007
|
||||
ur 0x3021..0x3029
|
||||
end xmlIsIdeographic
|
||||
|
||||
name xmlIsCombining
|
||||
ur 0x0300..0x0345
|
||||
ur 0x0360..0x0361
|
||||
ur 0x0483..0x0486
|
||||
ur 0x0591..0x05A1
|
||||
ur 0x05A3..0x05B9
|
||||
ur 0x05BB..0x05BD
|
||||
ur 0x05BF
|
||||
ur 0x05C1..0x05C2
|
||||
ur 0x05C4
|
||||
ur 0x064B..0x0652
|
||||
ur 0x0670
|
||||
ur 0x06D6..0x06DC
|
||||
ur 0x06DD..0x06DF
|
||||
ur 0x06E0..0x06E4
|
||||
ur 0x06E7..0x06E8
|
||||
ur 0x06EA..0x06ED
|
||||
ur 0x0901..0x0903
|
||||
ur 0x093C
|
||||
ur 0x093E..0x094C
|
||||
ur 0x094D
|
||||
ur 0x0951..0x0954
|
||||
ur 0x0962..0x0963
|
||||
ur 0x0981..0x0983
|
||||
ur 0x09BC
|
||||
ur 0x09BE
|
||||
ur 0x09BF
|
||||
ur 0x09C0..0x09C4
|
||||
ur 0x09C7..0x09C8
|
||||
ur 0x09CB..0x09CD
|
||||
ur 0x09D7
|
||||
ur 0x09E2..0x09E3
|
||||
ur 0x0A02
|
||||
ur 0x0A3C
|
||||
ur 0x0A3E
|
||||
ur 0x0A3F
|
||||
ur 0x0A40..0x0A42
|
||||
ur 0x0A47..0x0A48
|
||||
ur 0x0A4B..0x0A4D
|
||||
ur 0x0A70..0x0A71
|
||||
ur 0x0A81..0x0A83
|
||||
ur 0x0ABC
|
||||
ur 0x0ABE..0x0AC5
|
||||
ur 0x0AC7..0x0AC9
|
||||
ur 0x0ACB..0x0ACD
|
||||
ur 0x0B01..0x0B03
|
||||
ur 0x0B3C
|
||||
ur 0x0B3E..0x0B43
|
||||
ur 0x0B47..0x0B48
|
||||
ur 0x0B4B..0x0B4D
|
||||
ur 0x0B56..0x0B57
|
||||
ur 0x0B82..0x0B83
|
||||
ur 0x0BBE..0x0BC2
|
||||
ur 0x0BC6..0x0BC8
|
||||
ur 0x0BCA..0x0BCD
|
||||
ur 0x0BD7
|
||||
ur 0x0C01..0x0C03
|
||||
ur 0x0C3E..0x0C44
|
||||
ur 0x0C46..0x0C48
|
||||
ur 0x0C4A..0x0C4D
|
||||
ur 0x0C55..0x0C56
|
||||
ur 0x0C82..0x0C83
|
||||
ur 0x0CBE..0x0CC4
|
||||
ur 0x0CC6..0x0CC8
|
||||
ur 0x0CCA..0x0CCD
|
||||
ur 0x0CD5..0x0CD6
|
||||
ur 0x0D02..0x0D03
|
||||
ur 0x0D3E..0x0D43
|
||||
ur 0x0D46..0x0D48
|
||||
ur 0x0D4A..0x0D4D
|
||||
ur 0x0D57
|
||||
ur 0x0E31
|
||||
ur 0x0E34..0x0E3A
|
||||
ur 0x0E47..0x0E4E
|
||||
ur 0x0EB1
|
||||
ur 0x0EB4..0x0EB9
|
||||
ur 0x0EBB..0x0EBC
|
||||
ur 0x0EC8..0x0ECD
|
||||
ur 0x0F18..0x0F19
|
||||
ur 0x0F35
|
||||
ur 0x0F37
|
||||
ur 0x0F39
|
||||
ur 0x0F3E
|
||||
ur 0x0F3F
|
||||
ur 0x0F71..0x0F84
|
||||
ur 0x0F86..0x0F8B
|
||||
ur 0x0F90..0x0F95
|
||||
ur 0x0F97
|
||||
ur 0x0F99..0x0FAD
|
||||
ur 0x0FB1..0x0FB7
|
||||
ur 0x0FB9
|
||||
ur 0x20D0..0x20DC
|
||||
ur 0x20E1
|
||||
ur 0x302A..0x302F
|
||||
ur 0x3099
|
||||
ur 0x309A
|
||||
end xmlIsCombining
|
||||
|
||||
name xmlIsDigit
|
||||
ur 0x0030..0x0039
|
||||
ur 0x0660..0x0669
|
||||
ur 0x06F0..0x06F9
|
||||
ur 0x0966..0x096F
|
||||
ur 0x09E6..0x09EF
|
||||
ur 0x0A66..0x0A6F
|
||||
ur 0x0AE6..0x0AEF
|
||||
ur 0x0B66..0x0B6F
|
||||
ur 0x0BE7..0x0BEF
|
||||
ur 0x0C66..0x0C6F
|
||||
ur 0x0CE6..0x0CEF
|
||||
ur 0x0D66..0x0D6F
|
||||
ur 0x0E50..0x0E59
|
||||
ur 0x0ED0..0x0ED9
|
||||
ur 0x0F20..0x0F29
|
||||
end xmlIsDigit
|
||||
|
||||
name xmlIsExtender
|
||||
ur 0x00B7
|
||||
ur 0x02D0
|
||||
ur 0x02D1
|
||||
ur 0x0387
|
||||
ur 0x0640
|
||||
ur 0x0E46
|
||||
ur 0x0EC6
|
||||
ur 0x3005
|
||||
ur 0x3031..0x3035
|
||||
ur 0x309D..0x309E
|
||||
ur 0x30FC..0x30FE
|
||||
end xmlIsExtender
|
||||
43
DesktopEditor/xml/libxml2/dbgen.pl
Normal file
43
DesktopEditor/xml/libxml2/dbgen.pl
Normal file
@ -0,0 +1,43 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$size = shift;
|
||||
|
||||
if ($size eq "")
|
||||
{
|
||||
die "usage: dbgen.pl [size]\n";
|
||||
}
|
||||
|
||||
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
|
||||
"George", "Hank", "Inki", "James");
|
||||
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
|
||||
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
|
||||
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
|
||||
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
|
||||
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
|
||||
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
|
||||
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
|
||||
|
||||
print "<?xml version=\"1.0\"?>\n";
|
||||
print "\n";
|
||||
print "<table>\n";
|
||||
|
||||
for ($i=0; $i<$size; $i++)
|
||||
{
|
||||
$first = $firstnames [$i % 10];
|
||||
$last = $lastnames [($i / 10) % 10];
|
||||
$state = $states [($i / 100) % 50];
|
||||
$zip = 22000 + $i / 5000;
|
||||
|
||||
printf " <row>\n";
|
||||
printf " <id>%04d</id>\n", $i;
|
||||
printf " <firstname>$first</firstname>\n", $i;
|
||||
printf " <lastname>$last</lastname>\n", $i;
|
||||
printf " <street>%d Any St.</street>\n", ($i % 100) + 1;
|
||||
printf " <city>Anytown</city>\n";
|
||||
printf " <state>$state</state>\n";
|
||||
printf " <zip>%d</zip>\n", $zip;
|
||||
printf " </row>\n";
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
42
DesktopEditor/xml/libxml2/dbgenattr.pl
Normal file
42
DesktopEditor/xml/libxml2/dbgenattr.pl
Normal file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
$size = shift;
|
||||
|
||||
if ($size eq "")
|
||||
{
|
||||
die "usage: dbgen.pl [size]\n";
|
||||
}
|
||||
|
||||
@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood",
|
||||
"George", "Hank", "Inki", "James");
|
||||
@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman",
|
||||
"Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
|
||||
@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA",
|
||||
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
|
||||
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
|
||||
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
|
||||
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
|
||||
|
||||
print "<?xml version=\"1.0\"?>\n";
|
||||
print "\n";
|
||||
print "<table>\n";
|
||||
|
||||
for ($i=0; $i<$size; $i++)
|
||||
{
|
||||
$first = $firstnames [$i % 10];
|
||||
$last = $lastnames [($i / 10) % 10];
|
||||
$state = $states [($i / 100) % 50];
|
||||
$zip = 22000 + $i / 5000;
|
||||
|
||||
printf " <row\n";
|
||||
printf " id='%04d'\n", $i;
|
||||
printf " firstname='$first'\n", $i;
|
||||
printf " lastname='$last'\n", $i;
|
||||
printf " street='%d Any St.'\n", ($i % 100) + 1;
|
||||
printf " city='Anytown'\n";
|
||||
printf " state='$state'\n";
|
||||
printf " zip='%d'/>\n", $zip;
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
3428
DesktopEditor/xml/libxml2/debugXML.c
Normal file
3428
DesktopEditor/xml/libxml2/debugXML.c
Normal file
File diff suppressed because it is too large
Load Diff
1262
DesktopEditor/xml/libxml2/dict.c
Normal file
1262
DesktopEditor/xml/libxml2/dict.c
Normal file
File diff suppressed because it is too large
Load Diff
301
DesktopEditor/xml/libxml2/doc/APIchunk0.html
Normal file
301
DesktopEditor/xml/libxml2/doc/APIchunk0.html
Normal file
File diff suppressed because one or more lines are too long
382
DesktopEditor/xml/libxml2/doc/APIchunk1.html
Normal file
382
DesktopEditor/xml/libxml2/doc/APIchunk1.html
Normal file
File diff suppressed because one or more lines are too long
675
DesktopEditor/xml/libxml2/doc/APIchunk10.html
Normal file
675
DesktopEditor/xml/libxml2/doc/APIchunk10.html
Normal file
File diff suppressed because one or more lines are too long
339
DesktopEditor/xml/libxml2/doc/APIchunk11.html
Normal file
339
DesktopEditor/xml/libxml2/doc/APIchunk11.html
Normal file
File diff suppressed because one or more lines are too long
927
DesktopEditor/xml/libxml2/doc/APIchunk12.html
Normal file
927
DesktopEditor/xml/libxml2/doc/APIchunk12.html
Normal file
File diff suppressed because one or more lines are too long
653
DesktopEditor/xml/libxml2/doc/APIchunk13.html
Normal file
653
DesktopEditor/xml/libxml2/doc/APIchunk13.html
Normal file
File diff suppressed because one or more lines are too long
470
DesktopEditor/xml/libxml2/doc/APIchunk14.html
Normal file
470
DesktopEditor/xml/libxml2/doc/APIchunk14.html
Normal file
File diff suppressed because one or more lines are too long
454
DesktopEditor/xml/libxml2/doc/APIchunk15.html
Normal file
454
DesktopEditor/xml/libxml2/doc/APIchunk15.html
Normal file
File diff suppressed because one or more lines are too long
375
DesktopEditor/xml/libxml2/doc/APIchunk16.html
Normal file
375
DesktopEditor/xml/libxml2/doc/APIchunk16.html
Normal file
File diff suppressed because one or more lines are too long
580
DesktopEditor/xml/libxml2/doc/APIchunk17.html
Normal file
580
DesktopEditor/xml/libxml2/doc/APIchunk17.html
Normal file
File diff suppressed because one or more lines are too long
457
DesktopEditor/xml/libxml2/doc/APIchunk18.html
Normal file
457
DesktopEditor/xml/libxml2/doc/APIchunk18.html
Normal file
File diff suppressed because one or more lines are too long
373
DesktopEditor/xml/libxml2/doc/APIchunk19.html
Normal file
373
DesktopEditor/xml/libxml2/doc/APIchunk19.html
Normal file
File diff suppressed because one or more lines are too long
416
DesktopEditor/xml/libxml2/doc/APIchunk2.html
Normal file
416
DesktopEditor/xml/libxml2/doc/APIchunk2.html
Normal file
File diff suppressed because one or more lines are too long
330
DesktopEditor/xml/libxml2/doc/APIchunk20.html
Normal file
330
DesktopEditor/xml/libxml2/doc/APIchunk20.html
Normal file
File diff suppressed because one or more lines are too long
399
DesktopEditor/xml/libxml2/doc/APIchunk21.html
Normal file
399
DesktopEditor/xml/libxml2/doc/APIchunk21.html
Normal file
File diff suppressed because one or more lines are too long
599
DesktopEditor/xml/libxml2/doc/APIchunk22.html
Normal file
599
DesktopEditor/xml/libxml2/doc/APIchunk22.html
Normal file
File diff suppressed because one or more lines are too long
668
DesktopEditor/xml/libxml2/doc/APIchunk23.html
Normal file
668
DesktopEditor/xml/libxml2/doc/APIchunk23.html
Normal file
File diff suppressed because one or more lines are too long
1001
DesktopEditor/xml/libxml2/doc/APIchunk24.html
Normal file
1001
DesktopEditor/xml/libxml2/doc/APIchunk24.html
Normal file
File diff suppressed because one or more lines are too long
451
DesktopEditor/xml/libxml2/doc/APIchunk25.html
Normal file
451
DesktopEditor/xml/libxml2/doc/APIchunk25.html
Normal file
File diff suppressed because one or more lines are too long
333
DesktopEditor/xml/libxml2/doc/APIchunk26.html
Normal file
333
DesktopEditor/xml/libxml2/doc/APIchunk26.html
Normal file
File diff suppressed because one or more lines are too long
349
DesktopEditor/xml/libxml2/doc/APIchunk27.html
Normal file
349
DesktopEditor/xml/libxml2/doc/APIchunk27.html
Normal file
File diff suppressed because one or more lines are too long
565
DesktopEditor/xml/libxml2/doc/APIchunk28.html
Normal file
565
DesktopEditor/xml/libxml2/doc/APIchunk28.html
Normal file
File diff suppressed because one or more lines are too long
131
DesktopEditor/xml/libxml2/doc/APIchunk29.html
Normal file
131
DesktopEditor/xml/libxml2/doc/APIchunk29.html
Normal file
File diff suppressed because one or more lines are too long
360
DesktopEditor/xml/libxml2/doc/APIchunk3.html
Normal file
360
DesktopEditor/xml/libxml2/doc/APIchunk3.html
Normal file
File diff suppressed because one or more lines are too long
351
DesktopEditor/xml/libxml2/doc/APIchunk4.html
Normal file
351
DesktopEditor/xml/libxml2/doc/APIchunk4.html
Normal file
File diff suppressed because one or more lines are too long
293
DesktopEditor/xml/libxml2/doc/APIchunk5.html
Normal file
293
DesktopEditor/xml/libxml2/doc/APIchunk5.html
Normal file
File diff suppressed because one or more lines are too long
294
DesktopEditor/xml/libxml2/doc/APIchunk6.html
Normal file
294
DesktopEditor/xml/libxml2/doc/APIchunk6.html
Normal file
File diff suppressed because one or more lines are too long
330
DesktopEditor/xml/libxml2/doc/APIchunk7.html
Normal file
330
DesktopEditor/xml/libxml2/doc/APIchunk7.html
Normal file
File diff suppressed because one or more lines are too long
307
DesktopEditor/xml/libxml2/doc/APIchunk8.html
Normal file
307
DesktopEditor/xml/libxml2/doc/APIchunk8.html
Normal file
File diff suppressed because one or more lines are too long
273
DesktopEditor/xml/libxml2/doc/APIchunk9.html
Normal file
273
DesktopEditor/xml/libxml2/doc/APIchunk9.html
Normal file
File diff suppressed because one or more lines are too long
595
DesktopEditor/xml/libxml2/doc/APIconstructors.html
Normal file
595
DesktopEditor/xml/libxml2/doc/APIconstructors.html
Normal file
File diff suppressed because one or more lines are too long
3591
DesktopEditor/xml/libxml2/doc/APIfiles.html
Normal file
3591
DesktopEditor/xml/libxml2/doc/APIfiles.html
Normal file
File diff suppressed because one or more lines are too long
2345
DesktopEditor/xml/libxml2/doc/APIfunctions.html
Normal file
2345
DesktopEditor/xml/libxml2/doc/APIfunctions.html
Normal file
File diff suppressed because one or more lines are too long
3587
DesktopEditor/xml/libxml2/doc/APIsymbols.html
Normal file
3587
DesktopEditor/xml/libxml2/doc/APIsymbols.html
Normal file
File diff suppressed because one or more lines are too long
49
DesktopEditor/xml/libxml2/doc/ChangeLog.awk
Normal file
49
DesktopEditor/xml/libxml2/doc/ChangeLog.awk
Normal file
@ -0,0 +1,49 @@
|
||||
#!/bin/awk -f
|
||||
function translate(str) {
|
||||
while (sub(/&/, "#amp;", str) == 1);
|
||||
while (sub(/#amp;/, "\\&", str) == 1); # fun isn't it ?
|
||||
while (sub(/</, "\\<", str) == 1);
|
||||
while (sub(/>/, "\\>", str) == 1);
|
||||
sub(/[0-9][0-9][0-9][0-9][0-9]+/, "<bug number='&'/>", str)
|
||||
return(str)
|
||||
}
|
||||
BEGIN {
|
||||
nb_entry = 0
|
||||
in_entry = 0
|
||||
in_item = 0
|
||||
print "<?xml version='1.0' encoding='ISO-8859-1'?>"
|
||||
print "<log>"
|
||||
}
|
||||
END {
|
||||
if (in_item == 1) printf("%s</item>\n", translate(item))
|
||||
if (in_entry == 1) print " </entry>"
|
||||
print "</log>"
|
||||
}
|
||||
/^[ \t]*$/ { next }
|
||||
/^[A-Za-z0-9]/ {
|
||||
match($0, "\(.*\) \([A-Z]+\) \([0-9][0-9][0-9][0-9]\) \(.*\) <\(.*\)>", loge)
|
||||
if (in_item == 1) printf("%s</item>\n", translate(item))
|
||||
if (in_entry == 1) print " </entry>"
|
||||
nb_entry = nb_entry + 1
|
||||
if (nb_entry > 50) {
|
||||
in_entry = 0
|
||||
in_item = 0
|
||||
exit
|
||||
}
|
||||
in_entry = 1
|
||||
in_item = 0
|
||||
printf(" <entry date='%s' timezone='%s' year='%s'\n who='%s' email='%s'>\n", loge[1], loge[2], loge[3], loge[4], loge[5])
|
||||
}
|
||||
/^[ \t]*\*/ {
|
||||
if (in_item == 1) printf("%s</item>\n", translate(item))
|
||||
in_item = 1
|
||||
printf(" <item>")
|
||||
match($0, "[ \t]*. *\(.*\)", loge)
|
||||
item = loge[1]
|
||||
}
|
||||
/^[ \t]*[a-zA-Z0-9\#]/ {
|
||||
if (in_item == 1) {
|
||||
match($0, "[ \t]*\(.*\)[ \t]*", loge)
|
||||
item = sprintf("%s %s", item, loge[1])
|
||||
}
|
||||
}
|
||||
117
DesktopEditor/xml/libxml2/doc/ChangeLog.xsl
Normal file
117
DesktopEditor/xml/libxml2/doc/ChangeLog.xsl
Normal file
@ -0,0 +1,117 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- this stylesheet builds the ChangeLog.html -->
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<!-- Import the rest of the site stylesheets -->
|
||||
<xsl:import href="site.xsl"/>
|
||||
|
||||
<!-- Generate XHTML-1.0 transitional -->
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
|
||||
|
||||
<xsl:param name="module">libxml2</xsl:param>
|
||||
|
||||
<!-- The table of content for the HTML page -->
|
||||
<xsl:variable name="menu_name">API Menu</xsl:variable>
|
||||
<xsl:variable name="develtoc">
|
||||
<form action="../search.php"
|
||||
enctype="application/x-www-form-urlencoded" method="get">
|
||||
<input name="query" type="text" size="20" value=""/>
|
||||
<input name="submit" type="submit" value="Search ..."/>
|
||||
</form>
|
||||
<ul><!-- style="margin-left: -1em" -->
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}index.html">Main Menu</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}docs.html">Developer Menu</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}html/index.html">Modules Index</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="{$href_base}examples/index.html">Code Examples</a></li>
|
||||
<li><a style="font-weight:bold"
|
||||
href="index.html">API Menu</a></li>
|
||||
<li><a href="html/libxml-parser.html">Parser API</a></li>
|
||||
<li><a href="html/libxml-tree.html">Tree API</a></li>
|
||||
<li><a href="html/libxml-xmlreader.html">Reader API</a></li>
|
||||
<li><a href="{$href_base}guidelines.html">XML Guidelines</a></li>
|
||||
</ul>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:template match="bug">
|
||||
<a href="http://bugzilla.gnome.org/show_bug.cgi?id={@number}">
|
||||
<xsl:value-of select="@number"/></a>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="entry">
|
||||
|
||||
<p>
|
||||
<b><xsl:value-of select="@who"/></b>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@date"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="@timezone"/>
|
||||
<ul>
|
||||
<xsl:apply-templates select="item"/>
|
||||
</ul>
|
||||
</p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="log">
|
||||
<xsl:variable name="title">ChangeLog last entries of <xsl:value-of select="$module"/></xsl:variable>
|
||||
<html>
|
||||
<head>
|
||||
<xsl:call-template name="style"/>
|
||||
<xsl:element name="title">
|
||||
<xsl:value-of select="$title"/>
|
||||
</xsl:element>
|
||||
</head>
|
||||
<body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000">
|
||||
<xsl:call-template name="titlebox">
|
||||
<xsl:with-param name="title" select="$title"/>
|
||||
</xsl:call-template>
|
||||
<table border="0" cellpadding="4" cellspacing="0" width="100%" align="center">
|
||||
<tr>
|
||||
<td bgcolor="#8b7765">
|
||||
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
||||
<tr>
|
||||
<td valign="top" width="200" bgcolor="#8b7765">
|
||||
<xsl:call-template name="develtoc"/>
|
||||
</td>
|
||||
<td valign="top" bgcolor="#8b7765">
|
||||
<table border="0" cellspacing="0" cellpadding="1" width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000">
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="3" cellspacing="1" width="100%">
|
||||
<tr>
|
||||
<td bgcolor="#fffacd">
|
||||
<xsl:apply-templates select="entry"/>
|
||||
<p><a href="{$href_base}bugs.html">Daniel Veillard</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
64
DesktopEditor/xml/libxml2/doc/DOM.fig
Normal file
64
DesktopEditor/xml/libxml2/doc/DOM.fig
Normal file
@ -0,0 +1,64 @@
|
||||
#FIG 3.2
|
||||
Landscape
|
||||
Center
|
||||
Inches
|
||||
Letter
|
||||
100.00
|
||||
Single
|
||||
-2
|
||||
1200 2
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
825 1125 2625 1125 2625 3375 825 3375 825 1125
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
4125 1125 5925 1125 5925 3375 4125 3375 4125 1125
|
||||
2 4 0 1 0 7 0 0 -1 0.000 0 0 7 0 0 5
|
||||
2025 3075 2025 1650 1050 1650 1050 3075 2025 3075
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1425 1875 1575 1875 1575 2025 1425 2025 1425 1875
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1200 2175 1350 2175 1350 2325 1200 2325 1200 2175
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1500 2175 1650 2175 1650 2325 1500 2325 1500 2175
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1800 2175 1950 2175 1950 2325 1800 2325 1800 2175
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1500 2475 1650 2475 1650 2625 1500 2625 1500 2475
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1725 2700 1875 2700 1875 2850 1725 2850 1725 2700
|
||||
2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
|
||||
1275 2700 1425 2700 1425 2850 1275 2850 1275 2700
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1500 2025 1350 2175
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1500 2025 1575 2175
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1500 2025 1875 2175
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1575 2325 1575 2475
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1650 2625 1725 2700
|
||||
2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
|
||||
1500 2625 1425 2700
|
||||
2 3 0 2 0 7 0 0 -1 6.000 0 0 -1 0 0 5
|
||||
2550 1725 2175 1950 2175 2850 2550 3075 2550 1725
|
||||
2 3 0 2 0 7 0 0 -1 6.000 0 0 -1 0 0 5
|
||||
4575 1725 4200 1950 4200 2850 4575 3075 4575 1725
|
||||
2 2 0 1 0 7 0 0 -1 4.000 0 0 -1 0 0 5
|
||||
2700 2025 4050 2025 4050 2775 2700 2775 2700 2025
|
||||
2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 0 0 2
|
||||
5025 2025 4575 2175
|
||||
2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 1 0 3
|
||||
1 1 2.00 120.00 240.00
|
||||
4575 2175 4200 2250 2025 2250
|
||||
2 1 1 2 0 7 0 0 -1 6.000 0 0 -1 0 0 3
|
||||
2025 2475 4200 2475 4575 2550
|
||||
2 1 0 2 0 7 0 0 -1 6.000 0 0 -1 1 0 2
|
||||
1 1 2.00 120.00 240.00
|
||||
4575 2550 5025 2625
|
||||
4 0 0 0 0 0 18 0.0000 4 255 1155 1050 825 Program 1\001
|
||||
4 0 0 0 0 0 18 0.0000 4 255 1155 4425 900 Program 2\001
|
||||
4 0 0 0 0 0 18 0.0000 4 195 585 1350 1500 XML\001
|
||||
4 0 0 0 0 0 18 0.0000 4 195 975 3000 3075 CORBA\001
|
||||
4 0 0 0 0 0 18 0.0000 4 195 735 3000 3375 ORBit\001
|
||||
4 0 0 0 0 0 18 0.0000 4 195 1395 2175 1575 DOM server\001
|
||||
4 0 0 0 0 0 18 0.0000 4 195 1335 4200 1650 DOM client\001
|
||||
BIN
DesktopEditor/xml/libxml2/doc/DOM.gif
Normal file
BIN
DesktopEditor/xml/libxml2/doc/DOM.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
17
DesktopEditor/xml/libxml2/doc/DOM.html
Normal file
17
DesktopEditor/xml/libxml2/doc/DOM.html
Normal file
File diff suppressed because one or more lines are too long
299
DesktopEditor/xml/libxml2/doc/FAQ.html
Normal file
299
DesktopEditor/xml/libxml2/doc/FAQ.html
Normal file
@ -0,0 +1,299 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="SHORTCUT ICON" href="/favicon.ico" /><style type="text/css">
|
||||
TD {font-family: Verdana,Arial,Helvetica}
|
||||
BODY {font-family: Verdana,Arial,Helvetica; margin-top: 2em; margin-left: 0em; margin-right: 0em}
|
||||
H1 {font-family: Verdana,Arial,Helvetica}
|
||||
H2 {font-family: Verdana,Arial,Helvetica}
|
||||
H3 {font-family: Verdana,Arial,Helvetica}
|
||||
A:link, A:visited, A:active { text-decoration: underline }
|
||||
</style><title>FAQ</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>FAQ</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation & DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxml2">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>Table of Contents:</p><ul>
|
||||
<li><a href="FAQ.html#License">License(s)</a></li>
|
||||
<li><a href="FAQ.html#Installati">Installation</a></li>
|
||||
<li><a href="FAQ.html#Compilatio">Compilation</a></li>
|
||||
<li><a href="FAQ.html#Developer">Developer corner</a></li>
|
||||
</ul><h3><a name="License" id="License">License</a>(s)</h3><ol>
|
||||
<li><em>Licensing Terms for libxml</em>
|
||||
<p>libxml2 is released under the <a href="http://www.opensource.org/licenses/mit-license.html">MIT
|
||||
License</a>; see the file Copyright in the distribution for the precise
|
||||
wording</p>
|
||||
</li>
|
||||
<li><em>Can I embed libxml2 in a proprietary application ?</em>
|
||||
<p>Yes. The MIT License allows you to keep proprietary the changes you
|
||||
made to libxml, but it would be graceful to send-back bug fixes and
|
||||
improvements as patches for possible incorporation in the main
|
||||
development tree.</p>
|
||||
</li>
|
||||
</ol><h3><a name="Installati" id="Installati">Installation</a></h3><ol>
|
||||
<li><strong><span style="background-color: #FF0000">Do Not Use
|
||||
libxml1</span></strong>, use libxml2</li>
|
||||
<p></p>
|
||||
<li><em>Where can I get libxml</em> ?
|
||||
<p>The original distribution comes from <a href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a> or <a href="ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/2.6/">gnome.org</a></p>
|
||||
<p>Most Linux and BSD distributions include libxml, this is probably the
|
||||
safer way for end-users to use libxml.</p>
|
||||
<p>David Doolin provides precompiled Windows versions at <a href="http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/ ">http://www.ce.berkeley.edu/~doolin/code/libxmlwin32/</a></p>
|
||||
</li>
|
||||
<p></p>
|
||||
<li><em>I see libxml and libxml2 releases, which one should I install ?</em>
|
||||
<ul>
|
||||
<li>If you are not constrained by backward compatibility issues with
|
||||
existing applications, install libxml2 only</li>
|
||||
<li>If you are not doing development, you can safely install both.
|
||||
Usually the packages <a href="http://rpmfind.net/linux/RPM/libxml.html">libxml</a> and <a href="http://rpmfind.net/linux/RPM/libxml2.html">libxml2</a> are
|
||||
compatible (this is not the case for development packages).</li>
|
||||
<li>If you are a developer and your system provides separate packaging
|
||||
for shared libraries and the development components, it is possible
|
||||
to install libxml and libxml2, and also <a href="http://rpmfind.net/linux/RPM/libxml-devel.html">libxml-devel</a>
|
||||
and <a href="http://rpmfind.net/linux/RPM/libxml2-devel.html">libxml2-devel</a>
|
||||
too for libxml2 >= 2.3.0</li>
|
||||
<li>If you are developing a new application, please develop against
|
||||
libxml2(-devel)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><em>I can't install the libxml package, it conflicts with libxml0</em>
|
||||
<p>You probably have an old libxml0 package used to provide the shared
|
||||
library for libxml.so.0, you can probably safely remove it. The libxml
|
||||
packages provided on <a href="ftp://xmlsoft.org/libxml2/">xmlsoft.org</a> provide
|
||||
libxml.so.0</p>
|
||||
</li>
|
||||
<li><em>I can't install the libxml(2) RPM package due to failed
|
||||
dependencies</em>
|
||||
<p>The most generic solution is to re-fetch the latest src.rpm , and
|
||||
rebuild it locally with</p>
|
||||
<p><code>rpm --rebuild libxml(2)-xxx.src.rpm</code>.</p>
|
||||
<p>If everything goes well it will generate two binary rpm packages (one
|
||||
providing the shared libs and xmllint, and the other one, the -devel
|
||||
package, providing includes, static libraries and scripts needed to build
|
||||
applications with libxml(2)) that you can install locally.</p>
|
||||
</li>
|
||||
</ol><h3><a name="Compilatio" id="Compilatio">Compilation</a></h3><ol>
|
||||
<li><em>What is the process to compile libxml2 ?</em>
|
||||
<p>As most UNIX libraries libxml2 follows the "standard":</p>
|
||||
<p><code>gunzip -c xxx.tar.gz | tar xvf -</code></p>
|
||||
<p><code>cd libxml-xxxx</code></p>
|
||||
<p><code>./configure --help</code></p>
|
||||
<p>to see the options, then the compilation/installation proper</p>
|
||||
<p><code>./configure [possible options]</code></p>
|
||||
<p><code>make</code></p>
|
||||
<p><code>make install</code></p>
|
||||
<p>At that point you may have to rerun ldconfig or a similar utility to
|
||||
update your list of installed shared libs.</p>
|
||||
</li>
|
||||
<li><em>What other libraries are needed to compile/install libxml2 ?</em>
|
||||
<p>Libxml2 does not require any other library, the normal C ANSI API
|
||||
should be sufficient (please report any violation to this rule you may
|
||||
find).</p>
|
||||
<p>However if found at configuration time libxml2 will detect and use the
|
||||
following libs:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.info-zip.org/pub/infozip/zlib/">libz</a> : a
|
||||
highly portable and available widely compression library.</li>
|
||||
<li>iconv: a powerful character encoding conversion library. It is
|
||||
included by default in recent glibc libraries, so it doesn't need to
|
||||
be installed specifically on Linux. It now seems a <a href="http://www.opennc.org/onlinepubs/7908799/xsh/iconv.html">part
|
||||
of the official UNIX</a> specification. Here is one <a href="http://www.gnu.org/software/libiconv/">implementation of the
|
||||
library</a> which source can be found <a href="ftp://ftp.ilog.fr/pub/Users/haible/gnu/">here</a>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<p></p>
|
||||
<li><em>Make check fails on some platforms</em>
|
||||
<p>Sometimes the regression tests' results don't completely match the
|
||||
value produced by the parser, and the makefile uses diff to print the
|
||||
delta. On some platforms the diff return breaks the compilation process;
|
||||
if the diff is small this is probably not a serious problem.</p>
|
||||
<p>Sometimes (especially on Solaris) make checks fail due to limitations
|
||||
in make. Try using GNU-make instead.</p>
|
||||
</li>
|
||||
<li><em>I use the SVN version and there is no configure script</em>
|
||||
<p>The configure script (and other Makefiles) are generated. Use the
|
||||
autogen.sh script to regenerate the configure script and Makefiles,
|
||||
like:</p>
|
||||
<p><code>./autogen.sh --prefix=/usr --disable-shared</code></p>
|
||||
</li>
|
||||
<li><em>I have troubles when running make tests with gcc-3.0</em>
|
||||
<p>It seems the initial release of gcc-3.0 has a problem with the
|
||||
optimizer which miscompiles the URI module. Please use another
|
||||
compiler.</p>
|
||||
</li>
|
||||
</ol><h3><a name="Developer" id="Developer">Developer</a> corner</h3><ol>
|
||||
<li><em>Troubles compiling or linking programs using libxml2</em>
|
||||
<p>Usually the problem comes from the fact that the compiler doesn't get
|
||||
the right compilation or linking flags. There is a small shell script
|
||||
<code>xml2-config</code> which is installed as part of libxml2 usual
|
||||
install process which provides those flags. Use</p>
|
||||
<p><code>xml2-config --cflags</code></p>
|
||||
<p>to get the compilation flags and</p>
|
||||
<p><code>xml2-config --libs</code></p>
|
||||
<p>to get the linker flags. Usually this is done directly from the
|
||||
Makefile as:</p>
|
||||
<p><code>CFLAGS=`xml2-config --cflags`</code></p>
|
||||
<p><code>LIBS=`xml2-config --libs`</code></p>
|
||||
</li>
|
||||
<li><em>I want to install my own copy of libxml2 in my home directory and
|
||||
link my programs against it, but it doesn't work</em>
|
||||
<p>There are many different ways to accomplish this. Here is one way to
|
||||
do this under Linux. Suppose your home directory is <code>/home/user.
|
||||
</code>Then:</p>
|
||||
<ul>
|
||||
<li>Create a subdirectory, let's call it <code>myxml</code></li>
|
||||
<li>unpack the libxml2 distribution into that subdirectory</li>
|
||||
<li>chdir into the unpacked distribution
|
||||
(<code>/home/user/myxml/libxml2 </code>)</li>
|
||||
<li>configure the library using the "<code>--prefix</code>" switch,
|
||||
specifying an installation subdirectory in
|
||||
<code>/home/user/myxml</code>, e.g.
|
||||
<p><code>./configure --prefix /home/user/myxml/xmlinst</code> {other
|
||||
configuration options}</p>
|
||||
</li>
|
||||
<li>now run <code>make</code> followed by <code>make install</code></li>
|
||||
<li>At this point, the installation subdirectory contains the complete
|
||||
"private" include files, library files and binary program files (e.g.
|
||||
xmllint), located in
|
||||
<p><code>/home/user/myxml/xmlinst/lib,
|
||||
/home/user/myxml/xmlinst/include </code> and <code>
|
||||
/home/user/myxml/xmlinst/bin</code></p>
|
||||
respectively.</li>
|
||||
<li>In order to use this "private" library, you should first add it to
|
||||
the beginning of your default PATH (so that your own private program
|
||||
files such as xmllint will be used instead of the normal system
|
||||
ones). To do this, the Bash command would be
|
||||
<p><code>export PATH=/home/user/myxml/xmlinst/bin:$PATH</code></p>
|
||||
</li>
|
||||
<li>Now suppose you have a program <code>test1.c</code> that you would
|
||||
like to compile with your "private" library. Simply compile it using
|
||||
the command
|
||||
<p><code>gcc `xml2-config --cflags --libs` -o test test.c</code></p>
|
||||
Note that, because your PATH has been set with <code>
|
||||
/home/user/myxml/xmlinst/bin</code> at the beginning, the xml2-config
|
||||
program which you just installed will be used instead of the system
|
||||
default one, and this will <em>automatically</em> get the correct
|
||||
libraries linked with your program.</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<p></p>
|
||||
<li><em>xmlDocDump() generates output on one line.</em>
|
||||
<p>Libxml2 will not <strong>invent</strong> spaces in the content of a
|
||||
document since <strong>all spaces in the content of a document are
|
||||
significant</strong>. If you build a tree from the API and want
|
||||
indentation:</p>
|
||||
<ol>
|
||||
<li>the correct way is to generate those yourself too.</li>
|
||||
<li>the dangerous way is to ask libxml2 to add those blanks to your
|
||||
content <strong>modifying the content of your document in the
|
||||
process</strong>. The result may not be what you expect. There is
|
||||
<strong>NO</strong> way to guarantee that such a modification won't
|
||||
affect other parts of the content of your document. See <a href="http://xmlsoft.org/html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault
|
||||
()</a> and <a href="http://xmlsoft.org/html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile
|
||||
()</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<p></p>
|
||||
<li><em>Extra nodes in the document:</em>
|
||||
<p><em>For an XML file as below:</em></p>
|
||||
<pre><?xml version="1.0"?>
|
||||
<PLAN xmlns="http://www.argus.ca/autotest/1.0/">
|
||||
<NODE CommFlag="0"/>
|
||||
<NODE CommFlag="1"/>
|
||||
</PLAN></pre>
|
||||
<p><em>after parsing it with the function
|
||||
pxmlDoc=xmlParseFile(...);</em></p>
|
||||
<p><em>I want to the get the content of the first node (node with the
|
||||
CommFlag="0")</em></p>
|
||||
<p><em>so I did it as following;</em></p>
|
||||
<pre>xmlNodePtr pnode;
|
||||
pnode=pxmlDoc->children->children;</pre>
|
||||
<p><em>but it does not work. If I change it to</em></p>
|
||||
<pre>pnode=pxmlDoc->children->children->next;</pre>
|
||||
<p><em>then it works. Can someone explain it to me.</em></p>
|
||||
<p></p>
|
||||
<p>In XML all characters in the content of the document are significant
|
||||
<strong>including blanks and formatting line breaks</strong>.</p>
|
||||
<p>The extra nodes you are wondering about are just that, text nodes with
|
||||
the formatting spaces which are part of the document but that people tend
|
||||
to forget. There is a function <a href="http://xmlsoft.org/html/libxml-parser.html">xmlKeepBlanksDefault
|
||||
()</a> to remove those at parse time, but that's an heuristic, and its
|
||||
use should be limited to cases where you are certain there is no
|
||||
mixed-content in the document.</p>
|
||||
</li>
|
||||
<li><em>I get compilation errors of existing code like when accessing
|
||||
<strong>root</strong> or <strong>child fields</strong> of nodes.</em>
|
||||
<p>You are compiling code developed for libxml version 1 and using a
|
||||
libxml2 development environment. Either switch back to libxml v1 devel or
|
||||
even better fix the code to compile with libxml2 (or both) by <a href="upgrade.html">following the instructions</a>.</p>
|
||||
</li>
|
||||
<li><em>I get compilation errors about non existing
|
||||
<strong>xmlRootNode</strong> or <strong>xmlChildrenNode</strong>
|
||||
fields.</em>
|
||||
<p>The source code you are using has been <a href="upgrade.html">upgraded</a> to be able to compile with both libxml
|
||||
and libxml2, but you need to install a more recent version:
|
||||
libxml(-devel) >= 1.8.8 or libxml2(-devel) >= 2.1.0</p>
|
||||
</li>
|
||||
<li><em>Random crashes in threaded applications</em>
|
||||
<p>Read and follow all advices on the <a href="threads.html">thread
|
||||
safety</a> page, and make 100% sure you never call xmlCleanupParser()
|
||||
while the library or an XML document might still be in use by another
|
||||
thread.</p>
|
||||
</li>
|
||||
<li><em>The example provided in the web page does not compile.</em>
|
||||
<p>It's hard to maintain the documentation in sync with the code
|
||||
<grin/> ...</p>
|
||||
<p>Check the previous points 1/ and 2/ raised before, and please send
|
||||
patches.</p>
|
||||
</li>
|
||||
<li><em>Where can I get more examples and information than provided on the
|
||||
web page?</em>
|
||||
<p>Ideally a libxml2 book would be nice. I have no such plan ... But you
|
||||
can:</p>
|
||||
<ul>
|
||||
<li>check more deeply the <a href="html/libxml-lib.html">existing
|
||||
generated doc</a></li>
|
||||
<li>have a look at <a href="examples/index.html">the set of
|
||||
examples</a>.</li>
|
||||
<li>look for examples of use for libxml2 function using the Gnome code
|
||||
or by asking on Google.</li>
|
||||
<li><a href="http://svn.gnome.org/viewvc/libxml2/trunk/">Browse
|
||||
the libxml2 source</a> , I try to write code as clean and documented
|
||||
as possible, so looking at it may be helpful. In particular the code
|
||||
of <a href="http://svn.gnome.org/viewvc/libxml2/trunk/xmllint.c?view=markup">xmllint.c</a> and of the various testXXX.c test programs should
|
||||
provide good examples of how to do things with the library.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<p></p>
|
||||
<li><em>What about C++ ?</em>
|
||||
<p>libxml2 is written in pure C in order to allow easy reuse on a number
|
||||
of platforms, including embedded systems. I don't intend to convert to
|
||||
C++.</p>
|
||||
<p>There is however a C++ wrapper which may fulfill your needs:</p>
|
||||
<ul>
|
||||
<li>by Ari Johnson <ari@btigate.com>:
|
||||
<p>Website: <a href="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</a></p>
|
||||
<p>Download: <a href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><em>How to validate a document a posteriori ?</em>
|
||||
<p>It is possible to validate documents which had not been validated at
|
||||
initial parsing time or documents which have been built from scratch
|
||||
using the API. Use the <a href="http://xmlsoft.org/html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd()</a>
|
||||
function. It is also possible to simply add a DTD to an existing
|
||||
document:</p>
|
||||
<pre>xmlDocPtr doc; /* your existing document */
|
||||
xmlDtdPtr dtd = xmlParseDTD(NULL, filename_of_dtd); /* parse the DTD */
|
||||
|
||||
dtd->name = xmlStrDup((xmlChar*)"root_name"); /* use the given root */
|
||||
|
||||
doc->intSubset = dtd;
|
||||
if (doc->children == NULL) xmlAddChild((xmlNodePtr)doc, (xmlNodePtr)dtd);
|
||||
else xmlAddPrevSibling(doc->children, (xmlNodePtr)dtd);
|
||||
</pre>
|
||||
</li>
|
||||
<li><em>So what is this funky "xmlChar" used all the time?</em>
|
||||
<p>It is a null terminated sequence of utf-8 characters. And only utf-8!
|
||||
You need to convert strings encoded in different ways to utf-8 before
|
||||
passing them to the API. This can be accomplished with the iconv library
|
||||
for instance.</p>
|
||||
</li>
|
||||
<li>etc ...</li>
|
||||
</ol><p></p><p><a href="bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
|
||||
BIN
DesktopEditor/xml/libxml2/doc/Libxml2-Logo-180x168.gif
Normal file
BIN
DesktopEditor/xml/libxml2/doc/Libxml2-Logo-180x168.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
BIN
DesktopEditor/xml/libxml2/doc/Libxml2-Logo-90x34.gif
Normal file
BIN
DesktopEditor/xml/libxml2/doc/Libxml2-Logo-90x34.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
351
DesktopEditor/xml/libxml2/doc/Makefile.am
Normal file
351
DesktopEditor/xml/libxml2/doc/Makefile.am
Normal file
@ -0,0 +1,351 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS = . devhelp examples
|
||||
|
||||
# The top-level SGML file.
|
||||
DOC_MAIN_XML_FILE=gnome-xml.xml
|
||||
|
||||
# The directory containing the source code (if it contains documentation).
|
||||
DOC_SOURCE_DIR=..
|
||||
|
||||
# A file in win32 depends upon one of the doc files
|
||||
WIN32_DIR=$(top_srcdir)/win32
|
||||
|
||||
PAGES= architecture.html bugs.html contribs.html docs.html DOM.html \
|
||||
downloads.html entities.html example.html help.html index.html \
|
||||
interface.html intro.html library.html namespaces.html news.html \
|
||||
tree.html xmldtd.html XMLinfo.html XSLT.html
|
||||
APIPAGES=APIconstructors.html APIfiles.html APIfunctions.html \
|
||||
APIsymbols.html APIchunk0.html
|
||||
|
||||
if REBUILD_DOCS
|
||||
EXTRA_DIST_wc = xmlcatalog_man.xml $(wildcard tutorial/*.html) \
|
||||
$(wildcard tutorial/*.c) $(wildcard tutorial/*.pdf) \
|
||||
$(wildcard tutorial/images/*.png) \
|
||||
$(wildcard tutorial/images/callouts/*.png) $(wildcard API*.html) \
|
||||
$(wildcard *.1) $(wildcard *.xsl) $(wildcard *.html) \
|
||||
$(wildcard *.gif) w3c.png $(wildcard html/*.html) \
|
||||
$(wildcard html/*.png) libxml2-api.xml index.py search.php \
|
||||
apibuild.py libxml2.xsa xmllint.xml xmlcatalog_man.xml \
|
||||
README.docs symbols.xml
|
||||
endif
|
||||
|
||||
# Expanded form of EXTRA_DIST_wc
|
||||
#
|
||||
EXTRA_DIST = \
|
||||
APIchunk0.html \
|
||||
APIchunk1.html \
|
||||
APIchunk2.html \
|
||||
APIchunk3.html \
|
||||
APIchunk4.html \
|
||||
APIchunk5.html \
|
||||
APIchunk6.html \
|
||||
APIchunk7.html \
|
||||
APIchunk8.html \
|
||||
APIchunk9.html \
|
||||
APIchunk10.html \
|
||||
APIchunk11.html \
|
||||
APIchunk12.html \
|
||||
APIchunk13.html \
|
||||
APIchunk14.html \
|
||||
APIchunk15.html \
|
||||
APIchunk16.html \
|
||||
APIchunk17.html \
|
||||
APIchunk18.html \
|
||||
APIchunk19.html \
|
||||
APIchunk20.html \
|
||||
APIchunk21.html \
|
||||
APIchunk22.html \
|
||||
APIchunk23.html \
|
||||
APIchunk24.html \
|
||||
APIchunk25.html \
|
||||
APIchunk26.html \
|
||||
APIchunk27.html \
|
||||
APIchunk28.html \
|
||||
APIchunk29.html \
|
||||
APIconstructors.html \
|
||||
APIfiles.html \
|
||||
APIfunctions.html \
|
||||
APIsymbols.html \
|
||||
ChangeLog.xsl \
|
||||
DOM.gif \
|
||||
DOM.html \
|
||||
FAQ.html \
|
||||
Libxml2-Logo-180x168.gif \
|
||||
Libxml2-Logo-90x34.gif \
|
||||
README.docs \
|
||||
XMLinfo.html \
|
||||
XSLT.html \
|
||||
api.xsl \
|
||||
apibuild.py \
|
||||
architecture.html \
|
||||
bugs.html \
|
||||
catalog.gif \
|
||||
catalog.html \
|
||||
checkapisym.xsl \
|
||||
contribs.html \
|
||||
docs.html \
|
||||
downloads.html \
|
||||
elfgcchack.xsl \
|
||||
encoding.html \
|
||||
entities.html \
|
||||
example.html \
|
||||
guidelines.html \
|
||||
help.html \
|
||||
html/book1.html \
|
||||
html/home.png \
|
||||
html/index.html \
|
||||
html/left.png \
|
||||
html/libxml-DOCBparser.html \
|
||||
html/libxml-HTMLparser.html \
|
||||
html/libxml-HTMLtree.html \
|
||||
html/libxml-SAX.html \
|
||||
html/libxml-SAX2.html \
|
||||
html/libxml-c14n.html \
|
||||
html/libxml-catalog.html \
|
||||
html/libxml-chvalid.html \
|
||||
html/libxml-debugXML.html \
|
||||
html/libxml-dict.html \
|
||||
html/libxml-encoding.html \
|
||||
html/libxml-entities.html \
|
||||
html/libxml-globals.html \
|
||||
html/libxml-hash.html \
|
||||
html/libxml-lib.html \
|
||||
html/libxml-list.html \
|
||||
html/libxml-nanoftp.html \
|
||||
html/libxml-nanohttp.html \
|
||||
html/libxml-parser.html \
|
||||
html/libxml-parserInternals.html \
|
||||
html/libxml-pattern.html \
|
||||
html/libxml-relaxng.html \
|
||||
html/libxml-schemasInternals.html \
|
||||
html/libxml-schematron.html \
|
||||
html/libxml-threads.html \
|
||||
html/libxml-tree.html \
|
||||
html/libxml-uri.html \
|
||||
html/libxml-valid.html \
|
||||
html/libxml-xinclude.html \
|
||||
html/libxml-xlink.html \
|
||||
html/libxml-xmlIO.html \
|
||||
html/libxml-xmlautomata.html \
|
||||
html/libxml-xmlerror.html \
|
||||
html/libxml-xmlexports.html \
|
||||
html/libxml-xmlmemory.html \
|
||||
html/libxml-xmlmodule.html \
|
||||
html/libxml-xmlreader.html \
|
||||
html/libxml-xmlregexp.html \
|
||||
html/libxml-xmlsave.html \
|
||||
html/libxml-xmlschemas.html \
|
||||
html/libxml-xmlschemastypes.html \
|
||||
html/libxml-xmlstring.html \
|
||||
html/libxml-xmlunicode.html \
|
||||
html/libxml-xmlversion.html \
|
||||
html/libxml-xmlwriter.html \
|
||||
html/libxml-xpath.html \
|
||||
html/libxml-xpathInternals.html \
|
||||
html/libxml-xpointer.html \
|
||||
html/libxml-xzlib.html \
|
||||
html/right.png \
|
||||
html/up.png \
|
||||
index.html \
|
||||
index.py \
|
||||
interface.html \
|
||||
intro.html \
|
||||
library.html \
|
||||
libxml.gif \
|
||||
libxml2-api.xml \
|
||||
libxml2.xsa \
|
||||
namespaces.html \
|
||||
newapi.xsl \
|
||||
news.html \
|
||||
news.xsl \
|
||||
python.html \
|
||||
redhat.gif \
|
||||
search.php \
|
||||
searches.html \
|
||||
searches.xsl \
|
||||
site.xsl \
|
||||
smallfootonly.gif \
|
||||
structure.gif \
|
||||
symbols.xml \
|
||||
syms.xsl \
|
||||
threads.html \
|
||||
tree.html \
|
||||
tutorial/apa.html \
|
||||
tutorial/apb.html \
|
||||
tutorial/apc.html \
|
||||
tutorial/apd.html \
|
||||
tutorial/ape.html \
|
||||
tutorial/apf.html \
|
||||
tutorial/apg.html \
|
||||
tutorial/aph.html \
|
||||
tutorial/api.html \
|
||||
tutorial/ar01s02.html \
|
||||
tutorial/ar01s03.html \
|
||||
tutorial/ar01s04.html \
|
||||
tutorial/ar01s05.html \
|
||||
tutorial/ar01s06.html \
|
||||
tutorial/ar01s07.html \
|
||||
tutorial/ar01s08.html \
|
||||
tutorial/ar01s09.html \
|
||||
tutorial/images/blank.png \
|
||||
tutorial/images/callouts/1.png \
|
||||
tutorial/images/callouts/10.png \
|
||||
tutorial/images/callouts/2.png \
|
||||
tutorial/images/callouts/3.png \
|
||||
tutorial/images/callouts/4.png \
|
||||
tutorial/images/callouts/5.png \
|
||||
tutorial/images/callouts/6.png \
|
||||
tutorial/images/callouts/7.png \
|
||||
tutorial/images/callouts/8.png \
|
||||
tutorial/images/callouts/9.png \
|
||||
tutorial/images/caution.png \
|
||||
tutorial/images/draft.png \
|
||||
tutorial/images/home.png \
|
||||
tutorial/images/important.png \
|
||||
tutorial/images/next.png \
|
||||
tutorial/images/note.png \
|
||||
tutorial/images/prev.png \
|
||||
tutorial/images/tip.png \
|
||||
tutorial/images/toc-blank.png \
|
||||
tutorial/images/toc-minus.png \
|
||||
tutorial/images/toc-plus.png \
|
||||
tutorial/images/up.png \
|
||||
tutorial/images/warning.png \
|
||||
tutorial/includeaddattribute.c \
|
||||
tutorial/includeaddkeyword.c \
|
||||
tutorial/includeconvert.c \
|
||||
tutorial/includegetattribute.c \
|
||||
tutorial/includekeyword.c \
|
||||
tutorial/includexpath.c \
|
||||
tutorial/index.html \
|
||||
tutorial/ix01.html \
|
||||
tutorial/xmltutorial.pdf \
|
||||
upgrade.html \
|
||||
w3c.png \
|
||||
wiki.xsl \
|
||||
xml.html \
|
||||
xmlcatalog.1 \
|
||||
xmlcatalog_man.html \
|
||||
xmlcatalog_man.xml \
|
||||
xmldtd.html \
|
||||
xmlio.html \
|
||||
xmllint.1 \
|
||||
xmllint.html \
|
||||
xmllint.xml \
|
||||
xmlmem.html \
|
||||
xmlreader.html \
|
||||
xsa.xsl
|
||||
|
||||
man_MANS = xmllint.1 xmlcatalog.1
|
||||
|
||||
if REBUILD_DOCS
|
||||
docs: web $(top_builddir)/NEWS libxml2.xsa $(man_MANS)
|
||||
|
||||
api: libxml2-api.xml libxml2-refs.xml $(APIPAGES) $(srcdir)/html/index.html $(WIN32_DIR)/libxml2.def.src ../elfgcchack.h $(srcdir)/site.xsl
|
||||
|
||||
web: $(PAGES)
|
||||
|
||||
../elfgcchack.h: $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the elfgcchack.h header" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/elfgcchack.xsl $(srcdir)/libxml2-api.xml > elfgcchack.h ; \
|
||||
if [ "`diff -q elfgcchack.h ../elfgcchack.h`" ] ; then \
|
||||
echo "updating ../elfgcchack.h"; \
|
||||
cp elfgcchack.h ../elfgcchack.h; \
|
||||
fi ; rm -f elfgcchack.h ; fi );
|
||||
|
||||
$(PAGES): xml.html $(srcdir)/site.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the HTML Web pages from xml.html" ; \
|
||||
$(XSLTPROC) --nonet --html --path $(srcdir) $(srcdir)/site.xsl $(srcdir)/xml.html > index.html ; fi );
|
||||
-@(if [ -x $(XMLLINT) ] ; then \
|
||||
echo "Validating the HTML Web pages" ; \
|
||||
$(XMLLINT) --nonet --valid --noout $(PAGES) ; fi );
|
||||
|
||||
$(top_builddir)/NEWS: $(srcdir)/news.xsl $(srcdir)/news.html
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) --nonet $(srcdir)/news.xsl $(srcdir)/news.html > $(top_builddir)/NEWS ; fi );
|
||||
|
||||
libxml2.xsa: $(srcdir)/xsa.xsl $(srcdir)/news.html
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the NEWS file" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/xsa.xsl $(srcdir)/news.html > libxml2.xsa ; fi );
|
||||
|
||||
$(APIPAGES): libxml2-api.xml libxml2-refs.xml $(srcdir)/site.xsl $(srcdir)/api.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the HTML API pages from libxml2-refs.xml" ; \
|
||||
$(XSLTPROC) --nonet --html $(srcdir)/api.xsl \
|
||||
$(srcdir)/xml.html ; fi );
|
||||
-@(if [ -x $(XMLLINT) ] ; then \
|
||||
echo "Validating the HTML API pages" ; \
|
||||
$(XMLLINT) --nonet --valid --noout API*.html ; fi );
|
||||
|
||||
$(srcdir)/html/index.html: libxml2-api.xml $(srcdir)/newapi.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the HTML pages from the XML API" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl $(srcdir)/libxml2-api.xml ; fi )
|
||||
-@(if [ -x $(XMLLINT) ] ; then \
|
||||
echo "Validating the resulting XHTML pages" ; \
|
||||
$(XMLLINT) --nonet --valid --noout html/*.html ; fi );
|
||||
|
||||
wiki: libxml2-api.xml $(srcdir)/wiki.xsl
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
echo "Rebuilding the wiki HTML pages from the XML API" ; \
|
||||
$(XSLTPROC) --nonet $(srcdir)/wiki.xsl $(srcdir)/libxml2-api.xml; fi )
|
||||
|
||||
$(WIN32_DIR)/libxml2.def.src: libxml2-api.xml
|
||||
-@(if [ -x $(XSLTPROC) ] ; then \
|
||||
$(XSLTPROC) -o $(WIN32_DIR)/libxml2.def.src \
|
||||
--nonet $(WIN32_DIR)/defgen.xsl libxml2-api.xml ; fi )
|
||||
|
||||
source_file_deps = \
|
||||
$(filter-out %/xmlversion.h, $(wildcard $(top_srcdir)/include/libxml/*.h)) \
|
||||
$(top_srcdir)/include/libxml/xmlversion.h.in \
|
||||
$(wildcard $(top_srcdir)/*.c)
|
||||
|
||||
libxml2-api.xml libxml2-refs.xml ../libxml2.syms: apibuild.py symbols.xml syms.xsl checkapisym.xsl $(source_file_deps)
|
||||
test -f $(top_srcdir)/include/libxml/xmlversion.h
|
||||
(cd $(srcdir) && ./apibuild.py)
|
||||
($(XSLTPROC) $(srcdir)/checkapisym.xsl $(srcdir)/libxml2-api.xml)
|
||||
($(XSLTPROC) -o ../libxml2.syms $(srcdir)/syms.xsl $(srcdir)/symbols.xml)
|
||||
-@(cd .. ; $(MAKE) rebuild_testapi)
|
||||
|
||||
|
||||
xmllint.1: xmllint.xml
|
||||
-@($(XSLTPROC) --nonet xmllint.xml)
|
||||
|
||||
xmlcatalog.1: xmlcatalog_man.xml
|
||||
-@($(XSLTPROC) --nonet xmlcatalog_man.xml)
|
||||
|
||||
check-extra-dist:
|
||||
for f in $(EXTRA_DIST_wc) ; do echo $$f; done | sort -u >tmp.EXTRA_DIST_wc
|
||||
for f in $(EXTRA_DIST) ; do echo $$f; done | sort >tmp.EXTRA_DIST
|
||||
diff -u tmp.EXTRA_DIST_wc tmp.EXTRA_DIST
|
||||
rm -f tmp.EXTRA_DIST_wc tmp.EXTRA_DIST
|
||||
endif
|
||||
|
||||
clean-local:
|
||||
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
|
||||
|
||||
maintainer-clean-local: clean-local
|
||||
rm -rf libxml-decl-list.txt libxml-decl.txt
|
||||
|
||||
rebuild: api docs
|
||||
|
||||
install-data-local:
|
||||
$(MKDIR_P) $(DESTDIR)$(HTML_DIR)
|
||||
-$(INSTALL) -m 0644 $(srcdir)/xml.html $(srcdir)/encoding.html $(srcdir)/FAQ.html $(srcdir)/structure.gif $(srcdir)/DOM.gif $(srcdir)/smallfootonly.gif $(srcdir)/redhat.gif $(srcdir)/libxml.gif $(srcdir)/w3c.png $(srcdir)/Libxml2-Logo-180x168.gif $(srcdir)/Libxml2-Logo-90x34.gif $(DESTDIR)$(HTML_DIR)
|
||||
$(MKDIR_P) $(DESTDIR)$(HTML_DIR)/html
|
||||
-$(INSTALL) -m 0644 $(srcdir)/html/*.html $(DESTDIR)$(HTML_DIR)/html
|
||||
-$(INSTALL) -m 0644 $(srcdir)/html/*.png $(DESTDIR)$(HTML_DIR)/html
|
||||
$(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial
|
||||
-$(INSTALL) -m 0644 $(srcdir)/tutorial/*.* \
|
||||
$(DESTDIR)$(HTML_DIR)/tutorial
|
||||
$(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial/images
|
||||
-$(INSTALL) -m 0644 $(srcdir)/tutorial/images/*.* \
|
||||
$(DESTDIR)$(HTML_DIR)/tutorial/images
|
||||
$(MKDIR_P) $(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
|
||||
-$(INSTALL) -m 0644 $(srcdir)/tutorial/images/callouts/*.* \
|
||||
$(DESTDIR)$(HTML_DIR)/tutorial/images/callouts
|
||||
|
||||
.PHONY: docs api web wiki rebuild
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user