Author: jasons Date: Mon Nov 10 09:54:42 2003 New Revision: 102 Modified: xml/xerces-p/trunk/.cvsignore xml/xerces-p/trunk/Changes xml/xerces-p/trunk/Handler/.cvsignore xml/xerces-p/trunk/MANIFEST xml/xerces-p/trunk/META.yml xml/xerces-p/trunk/README Log: usual
Modified: xml/xerces-p/trunk/.cvsignore ============================================================================== --- xml/xerces-p/trunk/.cvsignore (original) +++ xml/xerces-p/trunk/.cvsignore Mon Nov 10 09:54:42 2003 @@ -1,5 +1,6 @@ .todo Makefile +Makefile.old XML-Xerces-1.3.2.tar.gz XML-Xerces-1.3.3.tar.gz XML-Xerces-1.3.4.tar.gz @@ -32,6 +33,8 @@ XML-Xerces-2.0.0-1.tar.gz.asc XML-Xerces-2.1.0-0.tar.gz XML-Xerces-2.1.0-0.tar.gz.asc +XML-Xerces-2.3.0-4.tar.gz +XML-Xerces-2.3.0-4.tar.gz.asc Xerces.bs archives blib Modified: xml/xerces-p/trunk/Changes ============================================================================== --- xml/xerces-p/trunk/Changes (original) +++ xml/xerces-p/trunk/Changes Mon Nov 10 09:54:42 2003 @@ -1,8 +1,16 @@ Revision history for Perl extension Genex. +2.3.0-4 + - fourth bugfix release of 2.3.0 series. + - exposed new API components for DTDValidator and SchemaValidator + - added XML::Xerces::XMLCatalogResolver, for a standard way of + using XMLCatalog to resolve file locations + - added new samples: samples/DOM2hash.pl, samples/EnumVal.pl, + and samples/SEnumVal.pl + - improved Win32 support 2.3.0-3 Sun Nov 2 12:03:30 IST 2003 - - second bugfix release of 2.3.0 series. + - third bugfix release of 2.3.0 series. - fixed output of all XMLUni::* constants (thanks to Christian Orsatti for pointing this out) - added LocalFileFormatTarget (thanks to Christian @@ -18,13 +26,13 @@ - second bugfix release of 2.3.0 series. - fixes isAnySlash() error -2.3.0-1 +2.3.0-1 Aug 09 2003 - first bugfix release of 2.3.0 series. - fixes support for Attributes::getValue(int) and AttributeList::getValue(int) - added support for MacOS X. -2.3.0-0 +2.3.0-0 Aug 09 2003 - First public release that supports Xerces-C-2.3.0 2.1.0-1 Mon Dec 9 13:56:08 MST 2002 Modified: xml/xerces-p/trunk/Handler/.cvsignore ============================================================================== --- xml/xerces-p/trunk/Handler/.cvsignore (original) +++ xml/xerces-p/trunk/Handler/.cvsignore Mon Nov 10 09:54:42 2003 @@ -1,3 +1,4 @@ Handler.bs Makefile +Makefile.old pm_to_blib Modified: xml/xerces-p/trunk/MANIFEST ============================================================================== --- xml/xerces-p/trunk/MANIFEST (original) +++ xml/xerces-p/trunk/MANIFEST Mon Nov 10 09:54:42 2003 @@ -1,10 +1,13 @@ -ANNOUNCE -Changes -FAQ +# the code.. +Xerces.cpp +Xerces.pm + +Makefile.PL +MANIFEST + Handler/Makefile.PL Handler/PerlCallbackHandler.cpp Handler/PerlCallbackHandler.hpp -Handler/PerlCallbackHandler.swig.hpp Handler/PerlCallbackHandler.cpp Handler/PerlContentCallbackHandler.hpp Handler/PerlDocumentCallbackHandler.cpp @@ -16,44 +19,25 @@ Handler/PerlNodeFilterCallbackHandler.hpp Handler/PerlNodeFilterCallbackHandler.i Handler/PerlContentCallbackHandler.cpp -Handler/PerlNodeFilterCallbackHandler.swig.hpp -INSTALL -LICENSE -MANIFEST -Makefile.PL -README -SWIG.pm -TODO -Xerces.i -Xerces.cpp -Xerces.pm -Xerces-extra.pm -docs/apidocs.xml -docs/blueb.gif -docs/dtd/blocks.ent -docs/dtd/book.dtd -docs/dtd/characters.ent -docs/dtd/document.dtd -docs/dtd/entities.ent -docs/dtd/faqs.dtd -docs/dtd/links.ent -docs/dtd/markup.ent -docs/entities.ent -docs/faq-using.xml -docs/feedback.xml -docs/install.xml -docs/readme.xml -docs/releases.xml -docs/samples.xml -docs/xerces-perl_book.xml + hints/darwin.pl hints/dec_osf.pl hints/linux.pl hints/solaris_2.pl hints/aix.pl hints/hpux.pl -postModule.pl -postSource.pl + +# user level documents +Changes +FAQ +INSTALL +LICENSE +README +TODO + +docs/XMLUni.txt + +# sample documents samples/personal-no-xmldecl.xml samples/catalog.dtd samples/catalog.xml @@ -64,11 +48,18 @@ samples/personal.xsd samples/public.xml samples/system.xml + +# sample programs +samples/DOM2hash.pl +samples/EnumVal.pl +samples/SEnumVal.pl samples/DOMCount.pl samples/DOMCreate.pl samples/DOMPrint.pl samples/SAXCount.pl samples/SAX2Count.pl + +# tests t/AttributeList.t t/Attributes.t t/XercesDOMParser.t @@ -93,7 +84,6 @@ t/MemBufInputSource.t t/StdInInputSource.t t/URLInputSource.t -t/actualCast.t t/TestUtils.pm t/PerlErrorHandler.t t/SAX2Count.t @@ -107,5 +97,46 @@ t/XMLURL.t t/XMLUri.t t/XMLUni.t -typemaps.i +t/DOMBuilder.t +t/DOMParser.t +t/SAX2XMLReader.t +t/actualCast.t + +# administrivia META.yml Module meta-data (added by MakeMaker) + +# These are only useful for developers and those wishing to regenerate +# Xerces.cpp and Xerces.pm +Xerces-extra.pm +Xerces.i +SWIG.pm +Handler/PerlCallbackHandler.swig.hpp +postModule.pl +postSource.pl +typemaps.i + +# this is for internal use by developers making a release +# ANNOUNCE + +# +# these are old and of no use +# +# docs/apidocs.xml +# docs/blueb.gif +# docs/dtd/blocks.ent +# docs/dtd/book.dtd +# docs/dtd/characters.ent +# docs/dtd/document.dtd +# docs/dtd/entities.ent +# docs/dtd/faqs.dtd +# docs/dtd/links.ent +# docs/dtd/markup.ent +# docs/entities.ent +# docs/faq-using.xml +# docs/feedback.xml +# docs/install.xml +# docs/readme.xml +# docs/releases.xml +# docs/samples.xml +# docs/xerces-perl_book.xml + Modified: xml/xerces-p/trunk/META.yml ============================================================================== --- xml/xerces-p/trunk/META.yml (original) +++ xml/xerces-p/trunk/META.yml Mon Nov 10 09:54:42 2003 @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: XML-Xerces -version: 2.3.0-3 +version: 2.3.0-4 version_from: installdirs: site requires: Modified: xml/xerces-p/trunk/README ============================================================================== --- xml/xerces-p/trunk/README (original) +++ xml/xerces-p/trunk/README Mon Nov 10 09:54:42 2003 @@ -2,7 +2,7 @@ Xerces Perl: The Perl API to the Apache Xerces XML parser ============================================================ - $Id: README,v 1.22 2002/12/09 21:11:23 jasons Exp $ + $Id: readme.xsl,v 1.1 2002/05/07 06:06:10 jasons Exp $ LEGAL HOOP JUMPING: =================== @@ -11,7 +11,7 @@ -1) Current Release: XML::Xerces 2.3.0-3 +1) Current Release: XML::Xerces 2.3.0-4 ======================== XML::Xerces is the Perl API to the Apache project's Xerces XML parser. It @@ -20,21 +20,18 @@ Because it is based on Xerces-C, XML::Xerces provides a validating XML parser that makes it easy to give your application the ability to read and -write XML data. A shared library is provided for parsing, generating, -manipulating, and validating XML documents. XML::Xerces is faithful to the -XML 1.0 recommendation and associated standards (DOM 1.0, DOM 2.0. SAX 1.0, -SAX 2.0, Namespaces, and Schema). The parser provides high performance, -modularity, and scalability. It also provides full support for Unicode. +write XML data. Classes are provided for parsing, generating, manipulating, +and validating XML documents. XML::Xerces is faithful to the XML 1.0 +recommendation and associated standards (DOM levels 1,2, and 3, SAX 1 and +2, Namespaces, and W3C XML Schema). The parser provides high performance, +modularity, and scalability, and provides full support for Unicode. XML::Xerces implements the vast majority of the Xerces-C API (if you notice any discrepancies please mail the list <URL: -mailto:[EMAIL PROTECTED]> ). The exception of this are some -functions in the C++ API which have been overloaded to accept different -arguments may currently have only a single version in the Perl API. This is -a simple fix and most of the overloaded functions are finished, but will -take time to catch them all. Also, there are some functions in the C++ API -which either have better Perl counterparts (such as file I/O) or which -manipulate internal C++ information that has no role in the Perl module. +mailto:[EMAIL PROTECTED]> ). The exception is some functions in +the C++ API which either have better Perl counterparts (such as file I/O) +or which manipulate internal C++ information that has no role in the Perl +module. The majority of the API is created automatically using Simplified Wrapper Interface Generator (SWIG) <URL: http://www.swig.org/> . However, care has @@ -50,7 +47,7 @@ * Linux * Cygwin * Windows - * MacOS X + * Mac OS X * BSD * Solaris * AIX @@ -62,10 +59,9 @@ 3.1) ANSI C++ compiler ------------------------ - Builds are known to work with the GNU compiler. Ports to other - compilers such as MSVC++ (the Microsoft Visual C++ compiler and - development environment) are in the works. Contributions in this area - are always welcome :-). + Builds are known to work with the GNU C compiler, and other platform + specific compilers (such as VC++ on Windows and Forte on Solaris). + Contributions in this area are always welcome :-). 3.2) Perl5 ------------------------ @@ -77,11 +73,10 @@ XML::Xerces now supports Unicode. Since Unicode support wasn't added to Perl until 5.6.0, you will need to upgrade in order to use this and future versions of XML::Xerces. Upgrading to at least to the latest - stable release, 5.6.1, is recommended, but if you already have 5.6.0 - installed it will work fine. + stable release, 5.6.1, is recommended. If you plan on using Unicode, I *strongly* recommend upgrading to - Perl-5.8.0, the latest stable version. There have been significant + Perl-5.8.x, the latest stable version. There have been significant improvements to Perl's Unicode support. 3.3) The Apache Xerces C++ XML Parser @@ -91,106 +86,66 @@ Required version: 2.3.0 ############### - Which can be downloaded from the apache archive: + (which can be downloaded from the apache archive <URL: + http://www.apache.org/dist/xml/xerces-c/> ) You'll need both the + library and header files, and to set up any environment variables that + will direct the XML::Xerces build to the directories where these + reside. - http://xml.apache.org/dist/xerces-c/stable/ - - You'll need both the library and header files, and to set up any - environment variables that will direct the XML::Xerces build to - the directories where these reside. - -4) Development Tools +4) Prepare for the build ======================== - #### NOTE: #### - These are only for internal XML::Xerces development. If your - intention is solely to use XML::Xerces to write XML applications in - Perl, you will *NOT* need these tools. - ############### - - 4.1) SWIG - ------------------------ - - Simplified Wrapper Interface Generator (SWIG) <URL: - http://www.swig.org/> is an open source tool by David Beazley of the - University of Chicago for automatically generating Perl wrappers for C - and C++ libraries (i.e. *.a or *.so for UNIX, *.dll for Windoes). You - can get the source from the SWIG home page <URL: http://www.swig.org/> - and then build it for your platform. - - You will only need this if the include Xerces.C and XML::Xerces files - do not work for your perl distribution. The pre-generated files have - been created by SWIG 1.3 and work under perl-5.8. - - This port will only work with SWIG 1.3.20+. - - If your planning to use SWIG, you can set the environment variable SWIG - to the full path to the SWIG executable before running perl - Makefile.pl. For example: - - - export SWIG=/usr/bin/swig - - This is only necessary if it isn't in your path or you have more than - one version installed. - -5) Prepare for the build -======================== - - 5.1) Download XML::Xerces + 4.1) Download XML::Xerces ------------------------ Download the release and it's digital signature, from the apache Xerces-C archive <URL: http://xml.apache.org/dist/xerces-p/stable> . - 5.2) Verify the archive + 4.2) Verify the archive ------------------------ Optionally verify the release using the supplied digital signature (see the apache Xerces-Perl archive <URL: http://xml.apache.org/xerces-p/download.html> for details) - 5.3) Unpack the archive + 4.3) Unpack the archive ------------------------ Unpack the archive in a directory of your choice. Example (for UNIX): - * tar zxvf XML-Xerces-2.3.0-3.tar.gz - * cd XML-Xerces-2.3.0-3 + * tar zxvf XML-Xerces-2.3.0-4.tar.gz + * cd XML-Xerces-2.3.0-4 - 5.4) Examine Makefile.PL + 4.4) Getting Xerces-C ------------------------ - Examine the Perl script "Makefile.PL". You shouldn't need to change any - of the information unless you are attempting to build on a platform - other than UNIX, in which case, you will probably have to. + If the Xerces-C library and header files are installed on your system + directly, e.g. via an rpm or deb package, proceed to the directions for + building XML::Xerces. - 5.5) Getting Xerces-C - ------------------------ + Otherwise, you must download Xerces-C from www.apache.org. If there is + a binary available for your architecture, you may use it, otherwise you + must build it from source. If you wish to make Xerces-C available to + other applications, you may install it however it is not necessary to + do so in order to build XML::Xerces. To build XML::Xerces from an + uninstalled Xerces-C set the XERCESCROOT environment variable the + top-level directory of the source directory (i.e. the same value it + needs to be to build Xerces-C): - If the Xerces-C library and header files are installed on your system - directly, e.g. via an rpm or deb package, proceed to the build. - Otherwise, you must download Xerces from xml.apache.org and build it. - To build XML::Xerces in this case, make sure the value of your - XERCESCROOT environment variable is the top-level directory of your - xerces distribution (i.e. the same value it needs to be to build - XERCES). - - If you have built Xerces-C yourself and want to work directly from the - build directory, then you should only need to set the XERCESCROOT - environment variable. If you have installed xerces on your system you - should only need to set the XERCES_INCLUDE, XERCES_LIB, and - XERCES_CONFIG environment variables. For example: + export XERCESCROOT=/home/jasons/xerces-2.3.0/ + + If you choose to install Xerces-C on your system, you need to set the + XERCES_INCLUDE and XERCES_LIB environment variables: + export XERCES_INCLUDE=/usr/include/xerces export XERCES_LIB=/usr/lib - export XERCES_CONFIG=/home/jasons/build/xerces-c-2.3.0/config.status -6) Build XML::Xerces +5) Build XML::Xerces ======================== - A) Go to the XML-Xerces-2.3.0-3 directory. + A) Go to the XML-Xerces-2.3.0-4 directory. B) Build XML::Xerces as you would any perl package that you might get from CPAN: * perl Makefile.PL @@ -199,7 +154,7 @@ * make install -7) Using XML::Xerces +6) Using XML::Xerces ======================== XML::Xerces implements the vast majority of the Xerces-C API (if you notice @@ -207,11 +162,10 @@ sadly not available in POD format, but the Xerces-C html documentation is available online <URL: http://xml.apache.org/xerces-c/apiDocs/index.html> . -For more information, see the sample scripts: DOMCount.pl, DOMCreate.pl, -and DOMPrint.pl in the samples/ directory, or the test scripts located in -the t/ directory (especially the TestUtils.pm module). +For more information, see the examples in the samples/ directory. and the +test scripts located in the t/ directory. -8) Special Perl API Features +7) Special Perl API Features ======================== Even though XML::Xerces is based on the C++ API, it has been modified in a @@ -221,63 +175,85 @@ * String I/O (Perl strings versus XMLch arrays) * List I/O (Perl lists versus DOM_NodeList's) * Hash I/O (Perl hashes versus DOM_NamedNodeMap's) + * Combined List/Hash classes * DOM Serialization API * Implementing Perl handlers for C++ event callbacks * handling C++ exceptions + * XML::Xerces::XMLUni unicode constants - 8.1) String I/O + 7.1) String I/O ------------------------ Any functions in the C++ API that return XMLCh arrays will return plain vanilla perl-strings in XML::Xerces. This obviates calls to transcode (in fact, it makes them entirely invalid). - 8.2) List I/O + 7.2) List I/O ------------------------ - Any function that in the C++ API returns a DOM_NodeList (e.g. + Any function that in the C++ API returns a DOMNodeList (e.g. getChildNodes() and getElementsByTagName() for example) will return different types if they are called in a list context or a scalar context. In a scalar context, these functions return a reference to a - XML::Xerces::DOM_NodeList, just like in C++ API. However, in a list + XML::Xerces::DOMNodeList, just like in C++ API. However, in a list context they will return a Perl list of XML::Xerces::DOM_Node references. For example: - # returns a reference to a XML::Xerces::DOM_NodeList + # returns a reference to a XML::Xerces::DOMNodeList my $node_list_ref = $doc->getElementsByTagName('foo'); - # returns a list of XML::Xerces::DOM_Node's + # returns a list of XML::Xerces::DOMNode's my @node_list = $doc->getElementsByTagName('foo'); - 8.3) Hash I/O + 7.3) Hash I/O ------------------------ - Any function that in the C++ API returns a DOM_NamedNodeMap + Any function that in the C++ API returns a DOMNamedNodeMap (getEntities() and getAttributes() for example) will return different types if they are called in a list context or a scalar context. In a scalar context, these functions return a reference to a - XML::Xerces::DOM_NamedNodeMap, just like in C++ API. However, in a list + XML::Xerces::DOMNamedNodeMap, just like in C++ API. However, in a list context they will return a Perl hash. For example: - # returns a reference to a XML::Xerces::DOM_NamedNodeMap + # returns a reference to a XML::Xerces::DOMNamedNodeMap my $attr_map_ref = $element_node->getAttributes(); # returns a hash of the attributes my %attrs = $element_node->getAttributes(); - 8.4) Serialize API + 7.4) Combined List/Hash classes (XMLAttDefList) + ------------------------ + + Any function that in the C++ API returns a XMLAttDefList + (getAttDefList() for SchemaElementDecl and DTDElementDecl), will always + return an instance of XML::Xerces::XMLAttDefList. However, there are + two Perl specific API methods that can be invoked on the object: + to_list() and to_hash(). + + + # get the XML::Xerces::XMLAttDefList. + my $attr_list = $element_decl->getAttDefList(); + + # return a list of XML::Xerces::XMLAttDef instances + my @list = $attr_list->to_list(); + + # returns a hash of the attributes, where the keys are the + # result of calling getFullName() on the attributes, and the + # values are the XML::Xerces::XMLAttDef instances. + my %attrs = $attr_list->to_hash(); + + 7.5) Serialize API ------------------------ - The XML::Xerces::DOMParse module implements a generic serializer API - for DOM Trees. See the script DOMPrint.pl for an example of how to use - the API. + The DOMWriter class is used for serializing DOM hierarchies. See + t/DOMWriter.t or samples/DOMPrint.pl for details. For less complex usage, just use the serialize() method defined for all - DOM_Node subclasses. + DOMNode subclasses. - 8.5) Implementing {Document,Content,Error}Handlers from Perl + 7.6) Implementing {Document,Content,Error}Handlers from Perl ------------------------ Thanks to suggestions from Duncan Cameron, XML::Xerces now has a @@ -302,19 +278,39 @@ my $dom = new XML::Xerces::DOMParser; $dom->setErrorHandler(MyErrorHandler->new()); - 8.6) Handling exceptions ({XML,DOM,SAX}Exception's) + 7.7) Handling exceptions ({XML,DOM,SAX}Exception's) ------------------------ Some errors occur outside parsing and are not caught by the parser's ErrorHandler. XML::Xerces provides a way for catching these errors - using the PerlExceptionHandler class. + using the PerlExceptionHandler class. Usually the following code is + enough for catching exceptions: + + + eval{$parser->parser($my_file)}; + XML::Xerces::error($@) if $@; + + Wrap any code that might throw an exception inside an eval{...} and + call XML::Xerces::error() passing $@, if $@ is set. There are a default methods that prints out an error message and calls die(), but if more is needed, see the files t/XMLException.t, t/SAXException.t, and t/DOMException.t for details on how to roll your own handler. -9) Sample Code + 7.8) XML::Xerces::XMLUni unicode constants + ------------------------ + + XML::Xerces uses many constant values for setting of features, and + properties, such as for XML::Xerces::SAX2XMLReader::setFeature(). You + can hard code the strings or integers into your programs but this will + make them vulnerable to an API change. Instead, use the constants + defined in the XML::Xerces::XMLUni class. If the API changes, the + constants will be updated to reflect that change. See the file + docs/UMLUni.txt for a complete listing of the constant names and their + values. + +8) Sample Code ======================== XML::Xerces comes with a number of sample applications: @@ -329,4 +325,46 @@ an XML file to STDOUT * DOMCreate.pl: Creates a simple XML document using the DOM interface and writes it to STDOUT + * DOM2hash.pl: Uses the DOM interface to convert the file to a simple hash of + lists representation + * EnumVal.pl: Parses and input XML document and outputs the DTD information + to STDOUT + * SEnumVal.pl: Parses and input XML document and outputs the XML Schema + information to STDOUT + +9) Development Tools +======================== + + #### NOTE: #### + These are only for internal XML::Xerces development. If your + intention is solely to use XML::Xerces to write XML applications in + Perl, you will *NOT* need these tools. + ############### + + 9.1) SWIG + ------------------------ + + Simplified Wrapper Interface Generator (SWIG) <URL: + http://www.swig.org/> is an open source tool by David Beazley of the + University of Chicago for automatically generating Perl wrappers for C + and C++ libraries (i.e. *.a or *.so for UNIX, *.dll for Windoes). You + can get the source from the SWIG home page <URL: http://www.swig.org/> + and then build it for your platform. + + You will only need this if the include Xerces.C and XML::Xerces files + do not work for your perl distribution. The pre-generated files have + been created by SWIG 1.3 and work under Perl-5.6 or later. + + This port will only work with SWIG 1.3.20 (which is currently only + available via CVS). + + If your planning to use SWIG, you can set the environment variable SWIG + to the full path to the SWIG executable before running perl + Makefile.pl. For example: + + + export SWIG=/usr/bin/swig + + This is only necessary if it isn't in your path or you have more than + one version installed. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]