Commit 9f145333 authored by ElenaSubbotina's avatar ElenaSubbotina

x2t - remove libxml2 from DocxFormat

parent c8c5b829

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -2,9 +2,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
EndProject
......@@ -44,8 +41,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\DesktopEditor\
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtfFormatLib", "..\ASCOfficeRtfFile\RtfFormatLib\Win32\RtfFormatLib.vcproj", "{AF2D00A7-A351-4700-AE88-C1D9ADE29345}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\ASCOfficeDocFile\DocFormatLib\Win32\DocFormatLib.vcproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
......@@ -72,7 +67,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "X2tTest", "..\X2tConverter\
{E5A67556-44DA-4481-8F87-0A3AEDBD20DD} = {E5A67556-44DA-4481-8F87-0A3AEDBD20DD}
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{DACBE6CA-E089-47D1-8CE7-C7DB59C15417} = {DACBE6CA-E089-47D1-8CE7-C7DB59C15417}
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
......@@ -109,6 +103,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\Common\3dPar
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\DesktopEditor\xml\build\vs2005\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......@@ -420,27 +416,6 @@ Global
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.ReleaseOpenSource|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.Build.0 = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|Win32.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|x64.Build.0 = Release|x64
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|Win32.ActiveCfg = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|Win32.Build.0 = Debug|Win32
{AF2D00A7-A351-4700-AE88-C1D9ADE29345}.Debug|x64.ActiveCfg = Debug|x64
......@@ -831,6 +806,28 @@ Global
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.ReleaseOpenSource|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.Build.0 = Debug|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|Win32.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|x64.Build.0 = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|Win32.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|x64.ActiveCfg = Release|x64
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
========================================================================
. libxml2_test
========================================================================
libxml2_test
.
,
libxml2_test.
libxml2_test.vcproj
VC++,
.
Visual C++,
, ,
, .
libxml2_test.cpp
.
/////////////////////////////////////////////////////////////////////////////
:
StdAfx.h, StdAfx.cpp
(PCH) libxml2_test.pch
StdAfx.obj.
/////////////////////////////////////////////////////////////////////////////
:
TODO:
, .
/////////////////////////////////////////////////////////////////////////////
// libxml2_test.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include "../libxml2.h"
int _tmain(int argc, _TCHAR* argv[])
{
//std::wstring sFileInput = L"C:\\Users\\Oleg\\Desktop\\book1\\word\\document.xml";
std::wstring sFileInput = L"D:\\123\\word\\document.xml";
#if 0
XmlUtils::CXmlLiteReader oReader;
oReader.FromFile(sFileInput);
oReader.ReadNextNode();
std::wstring strXml = oReader.GetOuterXml();
#endif
#if 1
XmlUtils::CXmlNode oNode;
bool bRes = oNode.FromXmlFile(sFileInput);
XmlUtils::CXmlNode oNodeBody = oNode.GetNode(L"w:body");
XmlUtils::CXmlNodes oNodesPar = oNodeBody.GetNodes(L"w:p");
XmlUtils::CXmlNode oNodePar1;
if (oNodesPar.GetAt(1, oNodePar1))
{
XmlUtils::CXmlNode oNode1 = oNodePar1.GetNode(L"w:pPr");
XmlUtils::CXmlNode oNode2 = oNode1.GetNode(L"w:spacing");
std::wstring sAttribute = oNode2.GetAttribute(L"w:after");
XmlUtils::CXmlNode oNode3 = oNodePar1.GetNode(L"w:r");
XmlUtils::CXmlNode oNode4 = oNode3.GetNode(L"w:t");
std::wstring sText = oNode4.GetText();
int y = 0;
++y;
}
//std::wstring sResultXmlDOM = oNode.private_GetXml();
std::wstring sResultXmlDOM = oNode.private_GetXmlFast();
#endif
return 0;
}

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2_test", "libxml2_test.vcproj", "{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}.Debug|Win32.ActiveCfg = Debug|Win32
{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}.Debug|Win32.Build.0 = Debug|Win32
{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}.Release|Win32.ActiveCfg = Release|Win32
{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="libxml2_test"
ProjectGUID="{FAD19DFC-E88A-4969-8C7D-0EEB59558CDD}"
RootNamespace="libxml2_test"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfATL="1"
CharacterSet="1"
ManagedExtensions="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../XML/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comsuppw.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="../win_build/Debug"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="../XML/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comsuppw.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="../win_build/Release"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name=" "
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\libxml2.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\libxml2_test.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=" "
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\targetver.h"
>
</File>
</Filter>
<Filter
Name=" "
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
// stdafx.cpp: исходный файл, содержащий только стандартные включаемые модули
// libxml2_test.pch будет предкомпилированным заголовком
// stdafx.obj будет содержать предварительно откомпилированные сведения о типе
#include "stdafx.h"
// TODO. Установите ссылки на любые требующиеся дополнительные заголовки в файле STDAFX.H
// , а не в данном файле
// stdafx.h: включаемый файл для стандартных системных включаемых файлов
// или включаемых файлов для конкретного проекта, которые часто используются, но
// не часто изменяются
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO. Установите здесь ссылки на дополнительные заголовки, требующиеся для программы
#pragma once
// Следующие макросы определяют минимальные требования к версии платформы. Минимальные требования к версии платформы
// - это самая ранняя версия Windows, Internet Explorer и т. д., имеющая все необходимые функции для выполнения
// вашего приложения. В результате выполнения макроса включаются все функции, доступные для версий платформы вплоть до указанной и
// включая указанную версию.
// Измените следующие определения, если версия вашей платформы более ранняя, чем указанная ниже.
// Последние данные о соответствующих значениях для различных платформ см. в MSDN.
#ifndef _WIN32_WINNT // Указывает, что минимально необходимой версией платформы является Windows Vista.
#define _WIN32_WINNT 0x0600 // Выберите значение, указывающее на другие версии Windows.
#endif
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _CRT_SECURE_NO_DEPRECATE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS
#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atlcoll.h>
#include <comutil.h>
using namespace ATL;
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>
This diff is collapsed.
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.
/*
* 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 (DoctRenderer(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 */
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
This diff is collapsed.
This diff is collapsed.
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
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>
This diff is collapsed.
#
# 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
# 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
This diff is collapsed.
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$
Please read the HACKING file for instructions
Daniel
$Id$
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
/*
* 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 */
This diff is collapsed.
This diff is collapsed.
- 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
##----------------------------------------------------------------
##
##-- Filename: Makefile
##
##-- $Date: 2008/02/23 02:56:17 $
##-- $Revision: 1.2 $
##-- $Name: $
##
##----------------------------------------------------------------
NAME = xml2
TOOL_FAMILY=gnu
include $(WIND_USR)/tool/gnu/make.$(VXCPU)
FLAGS = -Wall -g -Isrc -Isrc/include -D_REENTRANT=1
#FLAGS = -Wall -O2 -Isrc -Isrc/include -D_REENTRANT=1
FLAGS += $(DEFINE_CC) $(CC_ARCH_SPEC) -MD -MP -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=$(TOOL)
ifeq ($(VXTYPE),RTP)
FLAGS += -mrtp -fpic -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip
else
FLAGS += -D_WRS_KERNEL -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip
endif
ifeq ($(VXTYPE),RTP)
ifeq ($(CPU),SH32)
LIB_LDFLAGS += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC
else
LIB_LDFLAGS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS)
endif
endif
OBJS = c14n.o catalog.o chvalid.o \
debugXML.o dict.o DOCBparser.o \
encoding.o entities.o error.o \
globals.o \
hash.o \
legacy.o list.o \
parser.o parserInternals.o pattern.o \
relaxng.o \
SAX2.o SAX.o schematron.o \
threads.o tree.o \
uri.o \
valid.o \
xinclude.o xlink.o xmlcatalog.o xmlIO.o \
xmlmemory.o xmlmodule.o xmlreader.o xmlregexp.o \
xmlsave.o xmlschemas.o xmlschemastypes.o xmlstring.o \
xmlunicode.o xmlwriter.o xpath.o xpointer.o
all : lib$(NAME).so
init :
mkdir -p objs
.PHONY : lib$(NAME).so
lib$(NAME).so : init $(patsubst %.o, objs/%.o, $(OBJS))
$(CC) $(FLAGS) $(LIB_LDFLAGS) -shared -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
(NAME).out : init $(patsubst %.o, objs/%.o, $(OBJS))
$(CC) $(FLAGS) -o $@ $(patsubst %.o, objs/%.o, $(OBJS))
objs/%.o: src/%.c
$(CC) $(FLAGS) -o $@ -c $<
clean:
rm -fR *.so objs
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
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/.
\ No newline at end of file
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*])
#!/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
<?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>
\ No newline at end of file
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>
This diff is collapsed.
/*
* 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 xmlBufPtr buf); */
/* const xmlChar * xmlBufEnd(const 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__ */
#! /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 */")
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/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";
#!/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";
This diff is collapsed.
This diff is collapsed.
#!/bin/awk -f
function translate(str) {
while (sub(/&/, "#amp;", str) == 1);
while (sub(/#amp;/, "\\&amp;", str) == 1); # fun isn't it ?
while (sub(/</, "\\&lt;", str) == 1);
while (sub(/>/, "\\&gt;", 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])
}
}
#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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment