You can subscribe to this list here.
| 2002 |
Jan
(8) |
Feb
(22) |
Mar
(3) |
Apr
(13) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(5) |
Sep
(9) |
Oct
(36) |
Nov
(7) |
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(4) |
Feb
(1) |
Mar
(55) |
Apr
(25) |
May
(25) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(12) |
Oct
(6) |
Nov
(14) |
Dec
(1) |
| 2004 |
Jan
(1) |
Feb
(8) |
Mar
(6) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(3) |
Nov
(11) |
Dec
|
| 2005 |
Jan
(14) |
Feb
(3) |
Mar
(4) |
Apr
(14) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(19) |
Nov
(5) |
Dec
|
| 2007 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Christian G. <phi...@us...> - 2002-09-02 09:15:19
|
Update of /cvsroot/perl-xml/XML-LibXML-Common In directory usw-pr-cvs1:/tmp/cvs-serv10555 Log Message: XML::LibXML::Common initial release Status: Vendor Tag: phish108 Release Tags: cvs_0_10 N XML-LibXML-Common/Common.pm N XML-LibXML-Common/Makefile.PL N XML-LibXML-Common/README N XML-LibXML-Common/test.pl N XML-LibXML-Common/Changes N XML-LibXML-Common/MANIFEST N XML-LibXML-Common/ppport.h N XML-LibXML-Common/Common.xs N XML-LibXML-Common/pm_to_blib N XML-LibXML-Common/Common.c N XML-LibXML-Common/typemap N XML-LibXML-Common/Common.bs N XML-LibXML-Common/Makefile N XML-LibXML-Common/blib/lib/XML/LibXML/.exists N XML-LibXML-Common/blib/lib/XML/LibXML/Common.pm N XML-LibXML-Common/blib/lib/auto/XML/LibXML/Common/.exists N XML-LibXML-Common/blib/arch/auto/XML/LibXML/Common/.exists N XML-LibXML-Common/blib/arch/auto/XML/LibXML/Common/Common.bs N XML-LibXML-Common/blib/man3/.exists N XML-LibXML-Common/blib/man3/XML::LibXML::Common.3pm No conflicts created by this import ***** Bogus filespec: - Imported sources |
|
From: ivan <iv...@us...> - 2002-08-03 00:46:42
|
Update of /cvsroot/perl-xml/Frontier-RPC
In directory usw-pr-cvs1:/tmp/cvs-serv1493
Modified Files:
ChangeLog MANIFEST
Log Message:
* MANIFEST: added docs/make-rel
Index: ChangeLog
===================================================================
RCS file: /cvsroot/perl-xml/Frontier-RPC/ChangeLog,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ChangeLog 2 Aug 2002 18:35:21 -0000 1.28
+++ ChangeLog 3 Aug 2002 00:46:39 -0000 1.29
@@ -3,6 +3,8 @@
* lib/Frontier/RPC2.pm: added repr subroutine for String datatype
so that an explicity-specified String type encodes < > & and "
+ * MANIFEST: added docs/make-rel
+
2002-08-02 Ken MacLeod <ke...@bi...>
* docs/make-rel: added
Index: MANIFEST
===================================================================
RCS file: /cvsroot/perl-xml/Frontier-RPC/MANIFEST,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- MANIFEST 23 Apr 2001 19:16:45 -0000 1.8
+++ MANIFEST 3 Aug 2002 00:46:39 -0000 1.9
@@ -7,6 +7,7 @@
README
docs/changes.xml
docs/changes.xsl
+docs/make-rel
examples/cli-xml-rpc.pl
examples/example-cli-input
examples/rpc-client.pl
|
|
From: ivan <iv...@us...> - 2002-08-02 18:35:25
|
Update of /cvsroot/perl-xml/Frontier-RPC In directory usw-pr-cvs1:/tmp/cvs-serv9937 Modified Files: ChangeLog Changes Log Message: * lib/Frontier/RPC2.pm: added repr subroutine for String datatype so that an explicity-specified String type encodes < > & and " Index: ChangeLog =================================================================== RCS file: /cvsroot/perl-xml/Frontier-RPC/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ChangeLog 2 Aug 2002 14:54:50 -0000 1.27 +++ ChangeLog 2 Aug 2002 18:35:21 -0000 1.28 @@ -1,3 +1,8 @@ +2002-08-02 Ivan Kohler <iva...@42...> + + * lib/Frontier/RPC2.pm: added repr subroutine for String datatype + so that an explicity-specified String type encodes < > & and " + 2002-08-02 Ken MacLeod <ke...@bi...> * docs/make-rel: added Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/Frontier-RPC/Changes,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Changes 2 Aug 2002 14:54:50 -0000 1.26 +++ Changes 2 Aug 2002 18:35:21 -0000 1.27 @@ -26,6 +26,8 @@ - create an Integer special object for <int>s (was just <i4>s), reported by John Posner - use_objects wasn't working, reported by John Posner + - an explicity-specified String type now correctly + encodes < > & and " 0.06 Sat Nov 20 17:09:40 CST 1999 - Nick Bauman <nix...@ya...> sent in a patch to add |
|
From: ivan <iv...@us...> - 2002-08-02 18:35:25
|
Update of /cvsroot/perl-xml/Frontier-RPC/lib/Frontier
In directory usw-pr-cvs1:/tmp/cvs-serv9937/lib/Frontier
Modified Files:
RPC2.pm
Log Message:
* lib/Frontier/RPC2.pm: added repr subroutine for String datatype
so that an explicity-specified String type encodes < > & and "
Index: RPC2.pm
===================================================================
RCS file: /cvsroot/perl-xml/Frontier-RPC/lib/Frontier/RPC2.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- RPC2.pm 9 Apr 2001 20:30:27 -0000 1.17
+++ RPC2.pm 2 Aug 2002 18:35:21 -0000 1.18
@@ -534,6 +534,13 @@
use vars qw{@ISA};
@ISA = qw{Frontier::RPC2::DataType};
+sub repr {
+ my $self = shift;
+ my $value = $$self;
+ $value =~ s/([&<>\"])/$Frontier::RPC2::char_entities{$1}/ge;
+ $value;
+}
+
package Frontier::RPC2::Double;
use vars qw{@ISA};
|
|
From: Ken M. <kma...@us...> - 2002-08-02 14:54:57
|
Update of /cvsroot/perl-xml/Frontier-RPC In directory usw-pr-cvs1:/tmp/cvs-serv26086 Modified Files: ChangeLog Changes README Log Message: * docs/make-rel: added * README: changed mirror location to SourceForge; added notes for Apache::XMLRPC and Frontier::Responder. Index: ChangeLog =================================================================== RCS file: /cvsroot/perl-xml/Frontier-RPC/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ChangeLog 3 Oct 2001 01:30:53 -0000 1.26 +++ ChangeLog 2 Aug 2002 14:54:50 -0000 1.27 @@ -1,3 +1,10 @@ +2002-08-02 Ken MacLeod <ke...@bi...> + + * docs/make-rel: added + + * README: changed mirror location to SourceForge; added notes for + Apache::XMLRPC and Frontier::Responder. + 2001-04-25 Ken MacLeod <ke...@bi...> * lib/Frontier/Daemon.pm (new): return $self; submitted by Aaron Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/Frontier-RPC/Changes,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Changes 23 Apr 2001 19:08:38 -0000 1.25 +++ Changes 2 Aug 2002 14:54:50 -0000 1.26 @@ -21,6 +21,7 @@ <struct>s, suggested by John Posner <jj...@co...> - Frontier::Daemon now supports use_objects, suggested by John Posner + - Added docs/make-rel to create releases from CVS - fixes - create an Integer special object for <int>s (was just <i4>s), reported by John Posner Index: README =================================================================== RCS file: /cvsroot/perl-xml/Frontier-RPC/README,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- README 3 Oct 2001 01:30:53 -0000 1.10 +++ README 2 Aug 2002 14:54:50 -0000 1.11 @@ -29,12 +29,12 @@ <http://www.xmlrpc.com/> Newer versions of this module can be found on CPAN or at - <http://bitsko.slc.ut.us/~ken/xml-rpc/>. Questions can be + <http://perl-xml.sourceforge.net/xml-rpc/>. Questions can be directed to the discussion board on XML-RPC.com or to the XML-RPC mailing list. To join the XML-RPC mailing list visit - <http://egroups.com/group/xml-rpc/>. + <http://yahoogroups.com/group/xml-rpc/>. - Copyright (C) 1998-2001 Ken MacLeod + Copyright (C) 1998-2002 Ken MacLeod Frontier::RPC is distributed under the same terms as Perl. OVERVIEW @@ -52,6 +52,9 @@ The Frontier::RPC2 module implements the encoding and decoding of XML RPC requests using the XML::Parser Perl module. + + Apache::XMLRPC serves XML-RPC requests from Apache's mod_perl. + Frontier::Responder serves XML-RPC requests as a CGI script. QUICK USAGE GUIDE |
|
From: Ken M. <kma...@us...> - 2002-08-02 14:54:57
|
Update of /cvsroot/perl-xml/Frontier-RPC/docs
In directory usw-pr-cvs1:/tmp/cvs-serv26086/docs
Added Files:
make-rel
Log Message:
* docs/make-rel: added
* README: changed mirror location to SourceForge; added notes for
Apache::XMLRPC and Frontier::Responder.
--- NEW FILE: make-rel ---
#! /bin/sh
#
# NAME
# make-rel -- make a software release
#
# SYNOPSIS
usage="make-rel SYMBOLIC_TAG MODULE"
#
# DESCRIPTION
#
# `make-rel' exports MODULE from CVS using SYMBOLIC_TAG and
# creates a distribution from it.
#
# `make-rel' can tell the difference between `autoconf' style
# packages, Perl, and Python packages and create them accordingly.
#
# For `autoconf' packages, `make-rel' edits the SYMBOLIC_TAG into
# `configure.in', runs `autoconf', `./configure', and then
# performs a `make dist'.
#
# For Perl packages, `make-rel' edits the SYMBOLIC_TAG into the
# file identified in `Makefile.PL' as the `VERSION_FROM' file,
# runs `perl Makefile.pl' and `make dist'.
#
# For Python packages, `make-rel' edits the SYMBOLIC_TAG into
# `setup.py'.
#
# SYMBOLIC_TAGs of the form ``r([0-9]+)m([0-9]+)(.*)'' are
# reformatted to ``\1.\2\3'' to translate between CVS/RCSs
# requirement against using `.' in a tag name. For example, a
# symbolic tag `r0m1b1' is reformatted to `0.1b1'.
#
# The leading `r' of a SYMBOLIC_TAG is removed. Underscores (`_')
# are translated to periods (`.').
#
# $Id: make-rel,v 1.1 2002/08/02 14:54:50 kmacleod Exp $
#
AUTOCONF="/usr/bin/autoconf"
GREP="/usr/bin/grep"
PERL="/usr/bin/perl"
AWK="/usr/bin/awk"
CVS="/usr/bin/cvs"
PWD_CMD="/bin/pwd"
SED="/bin/sed"
TR="/usr/bin/tr"
if [ $# != 2 ]; then
echo "$usage"
exit 0
fi
SYMBOLIC_TAG="$1"
MODULE="$2"
set -e
set -x
original_dir="`$PWD_CMD`"
release="`echo \"$SYMBOLIC_TAG\" | $SED -e 's/r\([0-9]\{1,\}\)m\([0-9]\{1,\}\)\(.*\)/\1.\2\3/'`"
release="`echo \"$release\" | $SED -e 's/^r//' | $TR '_' '.'`"
mkdir /tmp/dist-$$
cd /tmp/dist-$$
$CVS export -r $SYMBOLIC_TAG -d dist $MODULE
cd dist
if [ -f configure.in ]; then
mv configure.in ..
# edit the SYMBOLIC_TAG into `configure.in', translating to a
# ``cleaner'' release number
$SED <../configure.in >configure.in \
-e 's/^VERSION=.*$/VERSION='"$release"'/'
echo "$release" >.release
$AUTOCONF
./configure
make dist
cd ..
elif [ -f Makefile.PL ]; then
perl <<'EOF'
use ExtUtils::Manifest;
($missfile, $missentry) = ExtUtils::Manifest::fullcheck;
die "make-rel: release does not check against manifest\n"
if ($#{$missfile} != -1 || $#{$missentry} != -1);
EOF
if [ $? != 0 ]; then
exit 1;
fi
VERSION_FROM="`$SED -n -e \"/VERSION_FROM/s/.*'\(.*\)',/\1/p\" Makefile.PL`"
mv $VERSION_FROM ..
$SED <../`basename $VERSION_FROM` >$VERSION_FROM \
-e '/VERSION = /s/0\.00/'"$release"'/'
for ii in `find . -name \*.pm`; do
mv $ii ..
$SED <../`basename $ii` >$ii \
-e '/VERSION = /s/0\.00/'"$release"'/'
done
if [ -f $MODULE.spec ]; then
$SED <$MODULE.spec >$MODULE-$release.spec \
-e 's/@VERSION@/'"$release"'/g'
mv MANIFEST ..
$SED <../MANIFEST >MANIFEST \
-e "/^$MODULE.spec$/a\\
$MODULE-$release.spec
"
fi
perl Makefile.PL
make dist
mv $MODULE-$release.tar.gz ..
cd ..
elif [ -f setup.py ]; then
mv setup.py ..
$SED <../setup.py >setup.py \
-e '/version = /s/0\.0\.0/'"$release"'/'
python setup.py sdist
mv dist/$MODULE-$release.tar.gz ..
cd ..
else
echo "Unknown package type"
cd ..
rm -rf dist-$$
exit 1
fi
chmod a-w *.tar.gz
mv *.tar.gz $original_dir
cd ..
rm -rf dist-$$
|
|
From: Grant M. <gr...@us...> - 2002-06-19 21:34:36
|
Update of /cvsroot/perl-xml/perl-xml-faq In directory usw-pr-cvs1:/tmp/cvs-serv30961 Removed Files: toc-links.xsl Log Message: - no longer required since TOC links fixed in DocBook XSL stylesheets --- toc-links.xsl DELETED --- |
|
From: Grant M. <gr...@us...> - 2002-06-19 21:30:35
|
Update of /cvsroot/perl-xml/perl-xml-faq In directory usw-pr-cvs1:/tmp/cvs-serv29397a Modified Files: faq-style.xsl Log Message: - tweaks for version 1.51 of the DocBook XSL stylesheets Index: faq-style.xsl =================================================================== RCS file: /cvsroot/perl-xml/perl-xml-faq/faq-style.xsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- faq-style.xsl 17 Apr 2002 20:46:36 -0000 1.3 +++ faq-style.xsl 19 Jun 2002 21:30:29 -0000 1.4 @@ -15,6 +15,12 @@ <xsl:param name="html.stylesheet.type">text/css</xsl:param> <xsl:param name="html.stylesheet">faq.css</xsl:param> <xsl:param name="spacing.paras">1</xsl:param> +<xsl:param name="generate.toc"> +qandaset toc +qandadiv nop +</xsl:param> + + <!-- Templates to override defaults --> |
|
From: Grant M. <gr...@us...> - 2002-06-19 21:29:45
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv28934
Modified Files:
perl-xml-faq.xml
Log Message:
- added a section on rolling your own parser in Perl (or not)
- fixed maintainer name for XML::LibXML
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- perl-xml-faq.xml 3 May 2002 19:49:02 -0000 1.8
+++ perl-xml-faq.xml 19 Jun 2002 21:29:41 -0000 1.9
@@ -35,7 +35,8 @@
<ulink url="http://www.perlxml.net/perl-xml-faq.dkb">http://www.perlxml.net/perl-xml-faq.dkb</ulink>.
The official source for this document is in CVS on <ulink
url="http://www.sourceforge.net/">SourceForge</ulink> at <ulink
- url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/</ulink></para>
+ url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/"
+ >http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/</ulink></para>
</abstract>
@@ -366,7 +367,46 @@
</answer>
</qandaentry>
-
+
+ <qandaentry id="roll_your_own">
+ <question>
+ <para>Rolling your own parser</para>
+ </question>
+ <answer>
+
+ <para>You may be tempted to develop your own Perl code for parsing XML.
+ After all, XML is text and Perl is a great language for working with
+ text. But before you go too far down that track, here are some points
+ to consider:</para>
+
+ <itemizedlist mark="bullet">
+
+ <listitem><para>Smart people don't. (Actually a number of really smart
+ people have - that's why there's a range of existing parsers to chose
+ from).</para></listitem>
+
+ <listitem><para>It's harder than you think. The first major hurdle is
+ <link linkend="encodings">encodings</link>. Then you'll have to handle
+ DTDs - even if you're not doing validation. The feature list will also
+ need to include numeric and named entities, CDATA sections, processing
+ instructions and well-formedness checks. You probably should support
+ namespaces too.</para></listitem>
+
+ <listitem><para>If you haven't done all that, it's not XML. It might
+ work for that subset of XML that you deem to be important, but if you
+ can't exchange documents with other parties, what's the
+ point?</para></listitem>
+
+ <listitem><para>Even if it works it will be slow.</para></listitem>
+
+ </itemizedlist>
+
+ <para>If none of the existing modules have an API that suits your needs,
+ write your own wrapper module to extend the one that comes closest.</para>
+
+ </answer>
+ </qandaentry>
+
</qandadiv>
<qandadiv id="cpan_modules"><title>CPAN Modules</title>
@@ -478,12 +518,13 @@
</question>
<answer>
- <para>Matt has also written <classname>XML::LibXML</classname> - a Perl
- wrapper around the GNOME Project's libxml2 library. It is very fast,
- complete and stable. It can run in validating or non-validating modes
- and offers a DOM with XPath support. The DOM and associated memory
- management is implemented in C which offers significant performance
- advantages over DOM trees built from Perl datatypes. The
+ <para><classname>XML::LibXML</classname> provides a Perl wrapper around
+ the GNOME Project's libxml2 library. This module was originally written
+ by Matt Sergeant and is now actively maintained by Christian Glahn. It
+ is very fast, complete and stable. It can run in validating or
+ non-validating modes and offers a DOM with XPath support. The DOM and
+ associated memory management is implemented in C which offers significant
+ performance advantages over DOM trees built from Perl datatypes. The
<classname>XML::LibXML::SAX::Builder</classname> module allows a libxml2
DOM to be constructed from SAX events.</para>
|
|
From: Grant M. <gr...@us...> - 2002-06-14 20:40:16
|
Update of /cvsroot/perl-xml/xml-filter-sort In directory usw-pr-cvs1:/tmp/cvs-serv19865 Log Message: XML::Filter::Sort Version 0.91 Status: Vendor Tag: grantm Release Tags: start N xml-filter-sort/README N xml-filter-sort/MANIFEST N xml-filter-sort/Changes N xml-filter-sort/Makefile.PL N xml-filter-sort/t/4_workout.t N xml-filter-sort/t/6_diskworkout.t N xml-filter-sort/t/2_buffermgr.t N xml-filter-sort/t/0_config.t N xml-filter-sort/t/3_sort.t N xml-filter-sort/t/1_buffer.t N xml-filter-sort/t/5_diskbuffer.t N xml-filter-sort/lib/XML/Filter/Sort.pm N xml-filter-sort/lib/XML/Filter/Sort/BufferMgr.pm N xml-filter-sort/lib/XML/Filter/Sort/DiskBuffer.pm N xml-filter-sort/lib/XML/Filter/Sort/DiskBufferMgr.pm N xml-filter-sort/lib/XML/Filter/Sort/Buffer.pm N xml-filter-sort/bin/xmlsort No conflicts created by this import ***** Bogus filespec: - Imported sources |
|
From: Grant M. <gr...@us...> - 2002-05-03 19:49:06
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv21029
Modified Files:
perl-xml-faq.xml
Log Message:
- added link to official FAQ web site
- note on XML::Parser documentation in XML::Parser::Expat
- added mention for XML::TiePYX
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- perl-xml-faq.xml 27 Apr 2002 21:59:30 -0000 1.7
+++ perl-xml-faq.xml 3 May 2002 19:49:02 -0000 1.8
@@ -30,6 +30,13 @@
<para>This document aims to provide answers to questions that crop up
regularly on the 'perl-xml' mailing list. In particular it addresses the
most common question for beginners - "Where do I start?"</para>
+
+ <para>The official home for this document on the web is:
+ <ulink url="http://www.perlxml.net/perl-xml-faq.dkb">http://www.perlxml.net/perl-xml-faq.dkb</ulink>.
+ The official source for this document is in CVS on <ulink
+ url="http://www.sourceforge.net/">SourceForge</ulink> at <ulink
+ url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/perl-xml/perl-xml-faq/</ulink></para>
+
</abstract>
<legalnotice>
@@ -395,6 +402,12 @@
url="http://expat.sourceforge.net">expat.sourceforge.net</ulink>) and
you will need a compiler.</para>
+ <para>Most of the documentation you need for the
+ <classname>XML::Parser</classname> API can be access using
+ <command>perldoc XML::Parser</command>, however some of the low-level
+ functionality is documented in <command>perldoc
+ XML::Parser::Expat</command>.</para>
+
</answer>
</qandaentry>
@@ -546,7 +559,7 @@
using MSXML from Perl</ulink> at <ulink
url="http://www.perl.com">www.perl.com</ulink>. You can find reference
documentation for the MSXML API on <ulink
- url="msdn.microsoft.com">MSDN</ulink>.</para>
+ url="http://msdn.microsoft.com">MSDN</ulink>.</para>
</answer>
</qandaentry>
@@ -582,6 +595,15 @@
<programlisting><![CDATA[
pyx talk.xml | sed -ne 's/^-//p' | ispell -l | sort -u
]]></programlisting>
+
+ <para>Eric Bohlman's <classname>XML::TiePYX</classname> is an alternative
+ Perl PYX implementation which employs tied filehandles. One of the
+ aims of the design was to work around limitiations of the Win9x
+ architecture which doesn't really support pipes. Using this module
+ you can <function>print</function> PYX format data to a filehandle
+ and well-formed XML will actually be written. Conversely, you can
+ read from an XML file and <command><FILEHANDLE></command> will
+ return PYX data.</para>
<para>Sean McGrath has written <ulink
url="http://www.xml.com/pub/a/2000/03/15/feature/index.html">an article
|
|
From: Edwin P. <edp...@us...> - 2002-04-30 05:33:07
|
Update of /cvsroot/perl-xml/xalan-p
In directory usw-pr-cvs1:/tmp/cvs-serv28194
Modified Files:
Xalan.xs xs.dom xs.xpath
Log Message:
Now uses TranscodeToLocalCodePage.
Index: Xalan.xs
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/Xalan.xs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Xalan.xs 20 Apr 2002 06:37:51 -0000 1.2
+++ Xalan.xs 30 Apr 2002 05:33:02 -0000 1.3
@@ -12,29 +12,7 @@
#include "Xalan.hpp"
-#ifdef _USE_UTF8
-#define DOMSTRING_2CHAR(result, domstring) \
- { \
- unsigned int j; \
- for (j = 0; j < domstring.length(); j++) \
- { \
- if (domstring[j] > 0x80) \
- uv_to_utf8((U8*)(result + j), domstring[j]); \
- else \
- *(result + j) = domstring[j]; \
- } \
- *(result + j) = '\0'; \
- }
-#else
-#define DOMSTRING_2CHAR(result, domstring) \
- { \
- unsigned int j = 0; \
- result = new char[domstring.length() + 1]; \
- for (j = 0; j < domstring.length(); j++) \
- *(result + j) = domstring[j]; \
- *(result + j) = '\0'; \
- }
-#endif
+#define TRANSCODE_2LOCAL(domstring) (char*)c_str(TranscodeToLocalCodePage(domstring))
#define BLESS_CORRECT_NODE_CLASS(sv, node) \
switch (node->getNodeType()) { \
@@ -294,8 +272,7 @@
case XObject::eTypeStringCached:
case XObject::eTypeXTokenStringAdapter:
if (m_auto_cast) {
- char *temp_str;
- DOMSTRING_2CHAR(temp_str, args[i].get()->str());
+ char *temp_str = TRANSCODE_2LOCAL(args[i].get()->str());
sv_setpv(sv_arg, temp_str);
#ifdef _USE_UTF8
SvUTF8_on(sv_arg);
Index: xs.dom
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/xs.dom,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- xs.dom 18 Apr 2002 03:37:40 -0000 1.1.1.1
+++ xs.dom 30 Apr 2002 05:33:02 -0000 1.2
@@ -13,7 +13,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -30,7 +30,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode())
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -62,7 +62,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -111,7 +111,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -131,7 +131,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -148,7 +148,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -165,7 +165,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -494,7 +494,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -525,7 +525,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -545,7 +545,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -562,7 +562,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -579,7 +579,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -596,7 +596,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -711,7 +711,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -778,7 +778,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -846,7 +846,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -880,8 +880,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
- DOMSTRING_2CHAR(RETVAL, self->getPrefix());
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1056,7 +1055,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1160,7 +1159,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1179,7 +1178,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1448,7 +1447,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1487,7 +1486,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
@@ -1611,7 +1610,7 @@
TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
croak("XalanDOMException caught: %s.\n", mesg);
}
- DOMSTRING_2CHAR(RETVAL, tmpDOMString);
+ RETVAL = TRANSCODE_2LOCAL(tmpDOMString);
OUTPUT:
RETVAL
Index: xs.xpath
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/xs.xpath,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- xs.xpath 18 Apr 2002 03:37:38 -0000 1.1.1.1
+++ xs.xpath 30 Apr 2002 05:33:02 -0000 1.2
@@ -11,11 +11,51 @@
str(self)
XObject* self
CODE:
- DOMSTRING_2CHAR(RETVAL, self->str());
+ RETVAL = TRANSCODE_2LOCAL(self->str());
OUTPUT:
RETVAL
void
+my_nodeset(self)
+ XObject* self
+ PREINIT:
+ int i;
+ PPCODE:
+ XNodeSetAllocator xnodeset_allocator(XObjectFactoryDefault::eDefaultXNodeSetBlockSize);
+ XNodeSet *xnodeset = xnodeset_allocator.clone(*(XNodeSet*)self);
+
+ const NodeRefListBase& ret_nodeset = self->nodeset();
+ const unsigned int theLength = ret_nodeset.getLength();
+ //PerlIO_printf(PerlIO_stderr(), "Nodeset size: %d\n", theLength);
+
+ if (theLength == 0)
+ XSRETURN_EMPTY;
+ else {
+ EXTEND(sp, theLength);
+ for (i = 0; i < theLength; i++) {
+ SV *sv_node = sv_newmortal();
+ XalanNode const *the_node = xnodeset->item(i);
+#ifdef DEBUG_XALAN
+ try {
+ char *tmp;
+ if (the_node->getNodeType() == XalanNode::ELEMENT_NODE) {
+ PerlIO_printf(PerlIO_stderr(), "Element node.\n");
+
+ tmp = TRANSCODE_2LOCAL(the_node->getNodeName());
+ PerlIO_printf(PerlIO_stderr(), "Node name: %s\n", tmp);
+ }
+ } catch (const XalanDOMException& e) {
+ char *mesg;
+ TRANSLATE_DOMEXCEPTION_CODE(mesg, e.getExceptionCode());
+ croak("XalanDOMException caught: %s.\n", mesg);
+ }
+#endif
+ BLESS_CORRECT_NODE_CLASS(sv_node, the_node)
+ PUSHs(sv_node);
+ }
+ }
+
+void
nodeset(self)
XObject* self
PREINIT:
@@ -32,11 +72,11 @@
for (i = 0; i < theLength; i++) {
SV *sv_node = sv_newmortal();
XalanNode const *the_node = ret_nodeset.item(i);
-
- //char *tmp;
+#ifdef DEBUG_XALAN
+ char *tmp;
//DOMSTRING_2CHAR(tmp, the_node->getNodeName());
//PerlIO_printf(PerlIO_stderr(), "Node name: %s\n", tmp);
-
+#endif
BLESS_CORRECT_NODE_CLASS(sv_node, the_node)
PUSHs(sv_node);
}
|
|
From: Grant M. <gr...@us...> - 2002-04-28 22:02:35
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv19897
Added Files:
db2sdb.pl
Log Message:
- script for converting FAQ document from DocBook to Simplified DocBook (to work in with existing stylesheets)
--- NEW FILE: db2sdb.pl ---
#!/usr/local/bin/perl -w
##############################################################################
#
# Title: db2sbd.pl
#
# Author: Grant McLean <gr...@cp...>
#
# Description:
#
# Script for converting a DocBook XML document to a Simplified DocBook XML
# document. The primary target for conversion is the Perl-XML FAQ.
# Requires XML::SAX, XML::SAX::Machines and XML::SAX::Writer.
#
use strict;
##############################################################################
# Filter class that does the translation
#
package DocBook2SDocBook;
use XML::SAX::Base;
our @ISA = qw(XML::SAX::Base);
my %simple_elems = map { $_, undef } qw(
abbrev abstract acronym affiliation appendix article articleinfo attribution
audiodata audioobject author authorblurb authorgroup authorinitials
bibliodiv bibliography bibliomisc bibliomixed bibliomset blockquote
caption citetitle colspec command computeroutput copyright corpauthor
date edition editor email emphasis entry epigraph example figure filename
firstname footnote holder honorific imagedata imageobject informaltable
inlinemediaobject issuenum itemizedlist jobtitle keyword keywordset
legalnotice lineage lineannotation link listitem literal literallayout
mediaobject note objectinfo option orderedlist orgname othercredit othername
para phrase programlisting pubdate publishername quote releaseinfo
replaceable revdescription revhistory revision revnumber revremark row
section sectioninfo sidebar subject subjectset subjectterm subtitle surname
systemitem table tbody term textobject tgroup thead title titleabbrev
trademark ulink userinput variablelist varlistentry videodata videoobject
volumenum xref year
);
my %elem_mapping = (
address => undef,
qandaset => undef,
guimenu => undef,
answer => undef,
classname => 'filename',
function => 'filename',
formalpara => 'example',
menuchoice => 'command',
qandadiv => \§ion_elem,
qandaentry => \§ion_elem,
question => sub {
my($self, $context, $elem) = @_;
$self->{in_question} = ($context eq 'start' ? 1 : 0);
# skip element
},
para => sub {
my($self, $context, $elem) = @_;
if($self->{in_question}) {
$elem->{Name} = 'title';
}
if($context eq 'start') {
return $self->SUPER::start_element($elem);
}
return $self->SUPER::end_element($elem);
},
# formalpara => sub {
# my($self, $context, $elem) = @_;
# $self->{in_formal_para} = ($context eq 'start' ? 1 : 0);
# # skip element
# },
guisubmenu => sub {
my($self, $context, $elem) = @_;
if($context eq 'start') {
return $self->SUPER::characters({ Data => '->' });
}
# skip element
},
);
sub section_elem {
my($self, $context, $elem) = @_;
$elem->{Name} = 'section';
delete($elem->{Attributes}->{'{}defaultlabel'});
if($context eq 'start') {
return $self->SUPER::start_element($elem);
}
else {
return $self->SUPER::end_element($elem);
}
}
sub add_mappings {
my $map = shift;
while(my($from, $to) = each(%$map)) {
$to = undef if($to eq '' or $to eq '1');
$elem_mapping{$from} = $to;
}
}
##############################################################################
# SAX handler methods
#
sub start_document {
my $self = shift;
$self->{sectnum} = [ 0 ];
$self->SUPER::start_document(@_);
}
sub start_dtd {
my $self = shift;
my $data = shift;
$data->{PublicId} = $main::opt{p} ||
'-//OASIS//DTD Simplified DocBook XML V4.1.2.5//EN';
$data->{SystemId} = $main::opt{s} ||
'file:///usr/share/xml/docbook/simple/4.1.2.5/sdocbook.dtd';
$self->SUPER::start_dtd($data);
}
sub comment {
my($self, $comment) = @_;
$self->SUPER::comment($comment) if($main::opt{c});
};
sub start_element {
my $self = shift;
my $elem = shift;
if(exists($elem_mapping{$elem->{Name}})) {
$elem = { %$elem };
my $mapping = $elem_mapping{$elem->{Name}};
return unless(defined($mapping));
if(ref($mapping)) {
return $mapping->($self, start => $elem);
}
else {
$elem->{Name} = $mapping;
}
return $self->SUPER::start_element($elem);
}
if(exists($simple_elems{$elem->{Name}})) {
return $self->SUPER::start_element($elem);
}
die "\nNo mapping for element: $elem->{Name}";
}
sub end_element {
my $self = shift;
my $elem = shift;
if(exists($elem_mapping{$elem->{Name}})) {
$elem = { %$elem };
my $mapping = $elem_mapping{$elem->{Name}};
return unless(defined($mapping));
if(ref($mapping)) {
return $mapping->($self, end => $elem);
}
else {
$elem->{Name} = $mapping;
}
return $self->SUPER::end_element($elem);
}
if(exists($simple_elems{$elem->{Name}})) {
return $self->SUPER::end_element($elem);
}
die "\nNo mapping for element: $elem->{Name}";
}
##############################################################################
# Wrapper script to instantiate filter pipeline
#
package main;
use Getopt::Long;
use Pod::Usage;
use XML::SAX::Machines qw( :all );
# handle command line options
our %opt = ( m => {} );
GetOptions(\%opt, 'm=s', 'c', 'p=s', 's=s', 'h') ||
pod2usage(1);
DocBook2SDocBook::add_mappings($opt{m});
pod2usage({-verbose => 2, -exitval => 0}) if($opt{h});
my $src_file = shift || 'perl-xml-faq.xml';
# filter the document
my $filter = DocBook2SDocBook->new();
Pipeline($filter => \*STDOUT)->parse_uri($src_file);
print "\n";
exit;
__END__
=head1 NAME
db2sbd.pl - converts from DocBook XML to Simplified DocBook
=head1 SYNOPSIS
db2sbd.pl <options> <filename>
Options:
-m x=y map <x> to <y>, 'x' will be skipped if 'y' not supplied
-c keep comments (default action is to strip them out)
-p override default PublicId
-s override default SystemId (point to your local DTD copy)
-h help - display the full documentation
=head1 DESCRIPTION
This script is a bit of a quick hack for converting a DocBookX (XML) document
(specifically a E<lt>qandasetE<gt>) to Simplified DocBook. The original
motivation being to integrate the Perl-XML FAQ document into a site built
using Simplified DocBook with some pre-existing XSLT stylesheets. The code
might be useful as a base for implementing similar translations.
The DB to SDB element mappings are defined in a hash. A simple mapping from
one element name to another looks like this:
'qandadiv' => 'section',
An element which should simply be skipped, can be mapped to 'nothing' like this:
'qandaset' => undef,
A more complex mapping can be achieved using a code reference:
'para' => sub { some clever code with conditionals etc },
The code will be called for both start_element() and end_element() events
and will be passed three parameters:
my($self, $context, $elem) = @;
The 'context' is a string containing 'start' or 'end'.
=head1 SEE ALSO
This script uses the following modules:
XML::SAX(::Base)
XML::SAX::Machines
XML::SAX::Writer
=head1 AUTHOR
Grant McLean <gr...@cp...>
=head1 COPYRIGHT
Copyright (c) 2002 Grant McLean. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
as Perl itself.
=cut
|
|
From: Grant M. <gr...@us...> - 2002-04-28 19:38:06
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv20829
Modified Files:
perl-xml-faq.xml
Log Message:
- formatting tweaks etc to ease DB to SDB mappings
- added a mention for Xerces Schema validation support
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- perl-xml-faq.xml 23 Apr 2002 19:55:39 -0000 1.6
+++ perl-xml-faq.xml 27 Apr 2002 21:59:30 -0000 1.7
@@ -7,8 +7,13 @@
<articleinfo>
<title>Perl-XML Frequently Asked Questions</title>
<titleabbrev>Perl-XML FAQ</titleabbrev>
- <author><firstname>Grant</firstname> <surname>McLean</surname></author>
- <address><email>gr...@cp...</email></address>
+ <author>
+ <firstname>Grant</firstname>
+ <surname>McLean</surname>
+ <authorblurb><para>
+ <email>gr...@cp...</email>
+ </para></authorblurb>
+ </author>
<copyright>
<year>2002</year>
<holder>Grant McLean</holder>
@@ -21,6 +26,12 @@
</revision>
</revhistory>
+ <abstract>
+ <para>This document aims to provide answers to questions that crop up
+ regularly on the 'perl-xml' mailing list. In particular it addresses the
+ most common question for beginners - "Where do I start?"</para>
+ </abstract>
+
<legalnotice>
<para>This work is distributed under the terms of Perl's Artistic License.
@@ -46,7 +57,7 @@
<para>Kip Hampton has written a number of articles on the subject of Perl
and XML, which are available at <ulink
url="http://www.xml.com">www.xml.com</ulink>. Here are a few links to
- get you started:
+ get you started:</para>
<itemizedlist mark="bullet">
@@ -65,13 +76,16 @@
<listitem><para><ulink
url="http://www.xml.com/pub/a/2001/11/14/xml-libxml.html">XML::LibXML
- An XML::Parser Alternative</ulink></para></listitem>
+
+ <listitem><para><ulink
+ url="http://www.xml.com/pub/a/2002/04/17/perl-xml.html">Perl
+ and XML on the Command Line</ulink></para></listitem>
<listitem><para><ulink
url="http://www.xml.com/pub/au/83">List of all Kip's articles</ulink>
</para></listitem>
</itemizedlist>
- </para>
</answer>
</qandaentry>
@@ -112,7 +126,7 @@
<para>The reference documentation is embedded in the Perl code of
each module in 'POD' (Plain Old Documentation) format. There are
- a number of ways you might gain access to this documentation:
+ a number of ways you might gain access to this documentation:</para>
<itemizedlist mark="bullet">
@@ -145,7 +159,6 @@
</listitem>
</itemizedlist>
- </para>
</answer>
</qandaentry>
@@ -163,7 +176,8 @@
possible that someone has already solved it and published their module
on CPAN. This will allow you to ignore the details of the XML layer
and start working at a higher level. Here's a random selection of
- CPAN modules which work with XML data but provide a higher level API:
+ CPAN modules which work with XML data but provide a higher level
+ API:</para>
<itemizedlist mark="bullet">
<listitem><para>If you want to use XML to transmit data across a network
@@ -187,9 +201,9 @@
</itemizedlist>
- There are dozens of other examples of existing Perl modules which work
- with XML data in domain-specific formats and allow you to get on with the
- job of using that data. Remember, <ulink
+ <para>There are dozens of other examples of existing Perl modules which
+ work with XML data in domain-specific formats and allow you to get on
+ with the job of using that data. Remember, <ulink
url="http://search.cpan.org">search.cpan.org</ulink> is your friend.
</para>
@@ -203,8 +217,8 @@
<answer>
<para>If you really do need to work with data in XML format, you need to
- select a parser module and there many to chose from. Most modules can
- be classified as using either a 'tree' or a 'stream' model.</para>
+ select a parser module and there are many to chose from. Most modules
+ can be classified as using either a 'tree' or a 'stream' model.</para>
<para>A <emphasis>tree</emphasis> based parser will typically parse the
whole XML document and return you a data structure made up of 'nodes'
@@ -324,7 +338,9 @@
<para>If you're looking for a more powerful tree based approach, try
<classname>XML::XPath</classname>. This module offers a DOM style API
- with the added bonus of XPath support.</para>
+ with the added bonus of XPath support. If speed is critical, you'll
+ find that <classname>XML::LibXML</classname> is much faster but a bit
+ more 'bleeding edge'.</para>
<para>If you've decided to use a stream based approach, head
directly for SAX. The <classname>XML::SAX</classname> distribution
@@ -661,7 +677,7 @@
]]></programlisting>
<para>There are lots of other goodies as well. You can read about
- some of them in the following articles by Kip Hampton:
+ some of them in the following articles by Kip Hampton:</para>
<itemizedlist mark="bullet">
@@ -674,7 +690,6 @@
XML::SAX::Machines, Part Two</ulink></para></listitem>
</itemizedlist>
- </para>
</answer>
</qandaentry>
@@ -902,7 +917,7 @@
url="http://www.axkit.org/">AxKit</ulink>. AxKit is a Perl-based
(actually mod_perl-based) XML Application server for <ulink
url="http://www.apache.org/httpd.html">Apache</ulink>. Here are some
- of AxKit's key features:
+ of AxKit's key features:</para>
<itemizedlist mark="bullet">
@@ -927,8 +942,6 @@
</itemizedlist>
- </para>
-
</answer>
</qandaentry>
@@ -1025,7 +1038,7 @@
Latin1 characters (the first 256 characters) are represented as normal
but with a preceding 0x00 byte. Although UTF-16 is conceptually simpler
than UTF-8 (and is the native encoding used by Java), two major drawbacks
- mean it is not the preferred format for C or Perl:
+ mean it is not the preferred format for C or Perl:</para>
<itemizedlist>
@@ -1035,7 +1048,7 @@
<listitem><para>The 0x00 bytes are not compatible with C's null terminated
strings.</para></listitem>
- </itemizedlist></para>
+ </itemizedlist>
<para>For more information, visit the <ulink
url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ
@@ -1593,6 +1606,28 @@
<classname>XML::LibXML</classname>'s diagnostic messages are not as
helpful.</para>
+ <para>The libxml2 distribution (which underlies
+ <classname>XML::LibXML</classname>) includes a command line validation
+ tool, written in C, called xmllint. You can use it like this:</para>
+
+ <programlisting><![CDATA[
+xmllint --valid --noout filename.xml
+ ]]></programlisting>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="validation_xerces">
+ <question>
+ <para>W3C Schema Validation With <classname>XML::Xerces</classname></para>
+ </question>
+ <answer>
+
+ <para><classname>XML::Xerces</classname> provides a wrapper around the
+ Apache project's Xerces parser library. Installing Xerces can be
+ challenging and the documentation for the Perl API is not great, but it's
+ the only tool offering Schema validation from Perl.</para>
+
</answer>
</qandaentry>
@@ -2082,7 +2117,9 @@
<para></para>
</question>
<answer>
+
<para></para>
+
</answer>
</qandaentry>
|
|
From: Grant M. <gr...@us...> - 2002-04-23 19:55:44
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv28907
Modified Files:
perl-xml-faq.xml
Log Message:
- added writeup for XML::PYX
- added section on XSLT (XML::XSLT, XML::Sablotron, XML::LibXSLT,
XML::Filter::XSLT
- fixed URL for Kip's article on validation using XPath
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- perl-xml-faq.xml 19 Apr 2002 20:38:47 -0000 1.5
+++ perl-xml-faq.xml 23 Apr 2002 19:55:39 -0000 1.6
@@ -535,6 +535,47 @@
</answer>
</qandaentry>
+ <qandaentry id="xml_pyx">
+ <question>
+ <para><classname>XML::PYX</classname></para>
+ </question>
+ <answer>
+
+ <para>Matt Sergeant's <classname>XML::PYX</classname> comes with
+ some wrapper scripts for working with XML files using command line
+ pipelines. The PYX notation allows you to apply commands like
+ <command>grep</command> and <command>sed</command> to specific parts of
+ the XML document (eg: element names, attribute values, text content).
+ For example, this one-liner provides a report of how many times each
+ type of element is used in a document:</para>
+
+ <programlisting><![CDATA[
+pyx doc.xml | sed -n 's/^(//p' | sort | uniq -c
+ ]]></programlisting>
+
+ <para>This one creates a copy of an XML document with all
+ attributes stripped out:</para>
+
+ <programlisting><![CDATA[
+pyx doc1.xml | grep -v '^A' | pyxw > doc2.xml
+ ]]></programlisting>
+
+ <para>And this one spell checks the text content of a document skipping
+ over markup text such as element names and attributes:</para>
+
+ <programlisting><![CDATA[
+pyx talk.xml | sed -ne 's/^-//p' | ispell -l | sort -u
+ ]]></programlisting>
+
+ <para>Sean McGrath has written <ulink
+ url="http://www.xml.com/pub/a/2000/03/15/feature/index.html">an article
+ introducing PYX</ulink> on XML.com. PYX can be addictive - especially
+ if you're an awk or sed wizard, but if you find you're using Perl in
+ your pipelines you should consider switching to SAX.</para>
+
+ </answer>
+ </qandaentry>
+
<qandaentry id="xml_sax">
<question>
<para><classname>XML::SAX</classname></para>
@@ -751,6 +792,149 @@
</qandadiv>
+<qandadiv id="xslt"><title>XSLT Support</title>
+
+ <para>This section attempts to summarise the current state of Perl-related
+ XSLT solutions.</para>
+
+ <para>If you're looking for an introduction to <ulink
+ url="http://www.w3.org/TR/xslt">XSLT</ulink>, take a look at <ulink
+ url="http://www.ibiblio.org/xml/books/bible2/chapters/ch17.html">Chapter
+ 17</ulink> of the <ulink url="http://www.ibiblio.org/xml/books/bible2/">XML
+ Bible</ulink>.</para>
+
+ <qandaentry id="xml_xslt">
+ <question>
+ <para><classname>XML::XSLT</classname></para>
+ </question>
+ <answer>
+
+ <para>This module aims to implement XSLT in Perl, so the good news is
+ that so long as you have <classname>XML::Parser</classname> working you
+ won't need to compile anything to install this module. The bad news is
+ that it is not a complete implementation of the XSLT spec, it is still in
+ 'alpha' state and it's not clear whether it is under active development.
+ The <classname>XML::XSLT</classname> distribution includes a script you
+ can use from the command line like this:</para>
+
+ <programlisting><![CDATA[
+xslt-parser -s toc-links.xsl perl-xml-faq.xml > toc.html
+ ]]></programlisting>
+
+ <para>Egon Willighagen has written <ulink
+ url="http://www.linuxfocus.org/English/July2000/article156.shtml">An
+ Introduction to Perl's XML::XSLT module</ulink> at <ulink
+ url="http://www.linuxfocus.org/">linuxfocus.org</ulink>.</para>
+
+ <para>Some people have experienced difficulty installing the latest
+ version of this module - possibly since maintenance has been handled by
+ multiple people. At the time of writing, the latest version was
+ <filename>J/JS/JSTOWE/XML-XSLT-0.40.tar.gz</filename> although CPAN.pm
+ would only find
+ <filename>B/BR/BRONG/XML-XSLT-0.32.tar.gz</filename>.</para>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="xml_sablotron">
+ <question>
+ <para><classname>XML::Sablotron</classname></para>
+ </question>
+ <answer>
+
+ <para><ulink
+ url="http://www.gingerall.com/charlie/ga/xml/p_sab.xml">Sablotron</ulink>
+ is an XSLT processor written in C++ and developed as an open source
+ project by <ulink url="http://www.gingerall.com/">Ginger
+ Alliance</ulink>. Since the XSLT engine is written in C++ and uses
+ <classname>expat</classname> for XML parsing, it's pretty quick. The
+ XSLT implementation is almost complete and the product is under active
+ development. <ulink
+ url="http://www.gingerall.com/charlie/ga/xml/x_sabperl.xml"><classname>XML::Sablotron</classname></ulink>
+ is a Perl module which provides full access to the Sablotron API
+ (including a DOM with XPath support).</para>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="xml_libxslt">
+ <question>
+ <para><classname>XML::LibXSLT</classname></para>
+ </question>
+ <answer>
+
+ <para>Matt Sergeant's <classname>XML::LibXSLT</classname> is a Perl
+ wrapper for the GNOME project's <ulink
+ url="http://xmlsoft.org/XSLT/">libxslt</ulink> library. The XSLT
+ implementation is almost complete and the project is under active
+ development. The library is written in C and uses libxml2 for XML
+ parsing. Matt's testing found that it was about twice as fast as
+ Sablotron.</para>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="xml_filter_xslt">
+ <question>
+ <para><classname>XML::Filter::XSLT</classname></para>
+ </question>
+ <answer>
+
+ <para>Matt has also written <classname>XML::Filter::XSLT</classname>
+ which allows you to do XSLT transformations in a SAX pipeline. It
+ currently requires <classname>XML::LibXSLT</classname> but it is intended
+ to work with other XSLT processors in the future. In case you're
+ wondering, yes it does build a DOM of your complete document which it
+ transforms and then serialises back to SAX events. For this reason, it
+ might not be appropriate for multi-gigabyte documents.</para>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="axkit">
+ <question>
+ <para>AxKit</para>
+ </question>
+ <answer>
+
+ <para>If you're doing a lot of XML transformations (particularly for
+ web-based clients), you should take a long hard look at <ulink
+ url="http://www.axkit.org/">AxKit</ulink>. AxKit is a Perl-based
+ (actually mod_perl-based) XML Application server for <ulink
+ url="http://www.apache.org/httpd.html">Apache</ulink>. Here are some
+ of AxKit's key features:
+
+ <itemizedlist mark="bullet">
+
+ <listitem><para> Data can come from XML or any SAX data source (such as
+ a database query using <classname>XML::Generator::DBI</classname>)
+ </para></listitem>
+
+ <listitem><para>stylesheets can be selected
+ based on just about anything (file suffix, UserAgent, QueryString,
+ cookies, phase of the moon ...)</para></listitem>
+
+ <listitem><para>transformations can be specified
+ using a variety of languages including XSLT (LibXSLT or Sablotron),
+ XPathScript (a Perl-based transformation language) and XSP (a tag-based
+ language)</para></listitem>
+
+ <listitem><para>output formats can be anything you want (including HTML,
+ WAP, PDF etc)</para></listitem>
+
+ <listitem><para>caching of transformed documents can be handled
+ automatically or using your own custom scheme</para></listitem>
+
+ </itemizedlist>
+
+ </para>
+
+ </answer>
+ </qandaentry>
+
+</qandadiv>
+
+
<qandadiv id="encodings"><title>Encodings</title>
<qandaentry id="encodings_why">
@@ -1419,9 +1603,9 @@
<answer>
<para>Kip Hampton has written <ulink
- url="http://www.xml.com/pub/au/83">an article</ulink> describing how a
- combination of Perl and XPath can provide a quick, lightweight solution
- for validating documents.</para>
+ url="http://www.xml.com/pub/a/2000/11/08/perl/index.html">an
+ article</ulink> describing how a combination of Perl and XPath can
+ provide a quick, lightweight solution for validating documents.</para>
</answer>
</qandaentry>
|
|
From: Edwin P. <edp...@us...> - 2002-04-20 06:37:54
|
Update of /cvsroot/perl-xml/xalan-p
In directory usw-pr-cvs1:/tmp/cvs-serv22647
Modified Files:
Makefile.PL Xalan.pm Xalan.xs
Log Message:
debug printing now depends on env DEBUG_XALAN
Index: Makefile.PL
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/Makefile.PL,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Makefile.PL 18 Apr 2002 03:37:39 -0000 1.1.1.1
+++ Makefile.PL 20 Apr 2002 06:37:51 -0000 1.2
@@ -111,7 +111,8 @@
-L/usr/local/lib
LIBS
$config{DEFINE} = '-DLINUX -D_REENTRANT -DNDEBUG -D_EXPERIMENTAL' .
- (check_ver() ? ' -D_USE_UTF8' : '');
+ (check_ver() ? ' -D_USE_UTF8' : '') .
+ ($ENV{DEBUG_XALAN} ? ' -DDEBUG_XALAN' : '');
$config{CC} = 'c++';
$config{LD} = 'g++';
$config{CCFLAGS} = '-instances=static';
Index: Xalan.pm
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/Xalan.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Xalan.pm 18 Apr 2002 03:37:38 -0000 1.1.1.1
+++ Xalan.pm 20 Apr 2002 06:37:51 -0000 1.2
@@ -44,7 +44,7 @@
unless ($CHILD_EXIT_HANDLER_INSTALLED) {
Apache->push_handlers(
PerlChildExitHandler => sub {
- print STDERR "Terminating inside exit handler..\n";
+ #print STDERR "Terminating inside exit handler..\n";
XML::Xalan::Transformer::terminate();
});
++$CHILD_EXIT_HANDLER_INSTALLED;
@@ -53,7 +53,7 @@
END {
unless ($ENV{MOD_PERL}) {
- print STDERR "Terminating..\n";
+ #print STDERR "Terminating..\n";
XML::Xalan::Transformer::terminate();
}
}
Index: Xalan.xs
===================================================================
RCS file: /cvsroot/perl-xml/xalan-p/Xalan.xs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Xalan.xs 18 Apr 2002 03:37:41 -0000 1.1.1.1
+++ Xalan.xs 20 Apr 2002 06:37:51 -0000 1.2
@@ -438,12 +438,16 @@
PROTOTYPES: DISABLE
BOOT:
+#ifdef DEBUG_XALAN
PerlIO_printf(PerlIO_stderr(), "Bootstrapping Xalan\n");
+#endif
if (is_initialized == 0) {
XMLPlatformUtils::Initialize();
XalanTransformer::initialize();
- }
- PerlIO_printf(PerlIO_stderr(), "is_initialized: %d\n", ++is_initialized);
+ } else ++is_initialized;
+#ifdef DEBUG_XALAN
+ PerlIO_printf(PerlIO_stderr(), "is_initialized: %d\n", is_initialized);
+#endif
XalanTransformer*
XalanTransformer::new()
@@ -458,6 +462,9 @@
void
terminate()
CODE:
+#ifdef DEBUG_XALAN
+ PerlIO_printf(PerlIO_stderr(), "Inside terminate()..\n");
+#endif DEBUG_XALAN
/* I don't know why this doesn't work with perl 5.005_03 */
/* Commented out at this moment seems to cause no harm */
//XalanTransformer::terminate();
|
|
From: Grant M. <gr...@us...> - 2002-04-19 20:39:55
|
Update of /cvsroot/perl-xml/perl-xml-faq In directory usw-pr-cvs1:/tmp/cvs-serv8842 Added Files: toc-links.xsl Log Message: - stylesheet for generating toc.html --- NEW FILE: toc-links.xsl --- <?xml version='1.0'?> <xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="article"> <html> <head> <link rel="stylesheet" href="faq.css" type="text/css" /> <title><xsl:value-of select="./articleinfo/title" /></title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="articleinfo"> <h1><xsl:value-of select="./title" /></h1> </xsl:template> <xsl:template match="qandaset"> <ol> <xsl:apply-templates/> </ol> </xsl:template> <xsl:template match="qandadiv"> <li><xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="@id" /></xsl:attribute> <xsl:value-of select="./title" /> </xsl:element></li> <ol> <xsl:apply-templates/> </ol> </xsl:template> <xsl:template match="qandaentry"> <li><xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="@id" /></xsl:attribute> <xsl:value-of select="./question/para" /> </xsl:element> <xsl:apply-templates/></li> </xsl:template> <xsl:template match="answer/formalpara"> <br />- <xsl:element name="a"> <xsl:attribute name="href">index.html#<xsl:value-of select="../@id" /></xsl:attribute> <xsl:value-of select="./title" /> </xsl:element> </xsl:template> <!-- <xsl:template match="section" /> --> <!-- Suppress text content for any elements not specifically matched --> <xsl:template match="text()" /> </xsl:stylesheet> |
|
From: Grant M. <gr...@us...> - 2002-04-19 20:38:51
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv8157
Modified Files:
perl-xml-faq.xml
Log Message:
- fixed CDATA typo
- Added regex from Andreas Koenig
- Added question on 'invalid character number'
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- perl-xml-faq.xml 17 Apr 2002 20:45:49 -0000 1.4
+++ perl-xml-faq.xml 19 Apr 2002 20:38:47 -0000 1.5
@@ -1027,9 +1027,22 @@
</formalpara>
<programlisting><![CDATA[
+use utf8;
+
s/([\x{80}-\x{FFFF}])/'&#' . ord($1) . ';'/gse;
]]></programlisting>
+ <para>Andreas Koenig has supplied an alternative regular
+ expression:</para>
+
+ <programlisting><![CDATA[
+s/([^\x20-\x7F])/'&#' . ord($1) . ';'/gse;
+ ]]></programlisting>
+
+ <para>This version does not require 'use utf8'; does not require a
+ version of Perl which recognises \x{NN} and handles characters
+ outside the 0x80-0xFFFF range.</para>
+
<para>Even if you are outputting Latin1, you will need to use a technique
like this for all characters beyond position 255 (eg: the Euro symbol)
since there is no other way to represent them in Latin1.</para>
@@ -1731,6 +1744,29 @@
</answer>
</qandaentry>
+ <qandaentry id="invalid_char_num">
+ <question>
+ <para>'reference to invalid character number'</para>
+ </question>
+ <answer>
+
+ <para>The XML spec defines <ulink
+ url="http://www.w3.org/TR/1998/REC-xml-19980210.html#NT-Char">legal
+ characters</ulink> as tab (0x09), carriage return (0x0D), line feed
+ (0x0A) and the legal graphic characters of Unicode. This specifically
+ excludes control characters, so this would not be well-formed:</para>
+
+ <programlisting><![CDATA[
+<char></char>
+ ]]></programlisting>
+
+ <para>Their really is no easy or standard way to include control
+ characters in XML - binary data must be encoded (for example using
+ <classname>MIME::Base64</classname>).</para>
+
+ </answer>
+ </qandaentry>
+
<qandaentry id="using_cdata">
<question>
<para>Embedding Arbitrary Text in XML</para>
@@ -1745,11 +1781,11 @@
example, this XML document ...</para>
<programlisting><![CDATA[
-<code><![CDATA[
+<code><![CDATA[
if($qty < 1) {
print "<p>Invalid quantity!</p>";
}
-]]></code>
+]]>]]><![CDATA[</code>
]]></programlisting>
<para>is equivalent to this document ...</para>
|
|
From: Edwin P. <edp...@us...> - 2002-04-18 03:37:46
|
Update of /cvsroot/perl-xml/xalan-p In directory usw-pr-cvs1:/tmp/cvs-serv26159 Log Message: initial import Status: Vendor Tag: edpratomo Release Tags: start N xalan-p/MANIFEST N xalan-p/Changes N xalan-p/Xalan.pm N xalan-p/wrappers.cpp N xalan-p/XSv.hpp N xalan-p/xs.xpath N xalan-p/README N xalan-p/Makefile.PL N xalan-p/XSv.cpp N xalan-p/xs.dom N xalan-p/Xalan.xs N xalan-p/typemap N xalan-p/Xalan.hpp N xalan-p/t/11leak_data.t N xalan-p/t/08external.t N xalan-p/t/03error.t N xalan-p/t/01simple.t N xalan-p/t/12sv.t N xalan-p/t/02handler.t N xalan-p/t/07param.t N xalan-p/t/14sax2_content_leak.t N xalan-p/t/16nodeset.t N xalan-p/t/18ext_err.t N xalan-p/t/13sax2_content.t N xalan-p/t/17sv_context.t N xalan-p/t/09leak.t N xalan-p/t/05repeat.t N xalan-p/t/15ext_ctx.t N xalan-p/t/00base.t N xalan-p/t/04compiled.t N xalan-p/t/10pi.t N xalan-p/t/06parsed.t N xalan-p/samples/docs/sax2.xml N xalan-p/samples/docs/foo8.xml N xalan-p/samples/docs/pi.xml N xalan-p/samples/docs/foo9.xml N xalan-p/samples/docs/foo1.xml N xalan-p/samples/docs/param.xsl N xalan-p/samples/docs/foo10.xml N xalan-p/samples/docs/foo2.xml N xalan-p/samples/docs/foo.xml N xalan-p/samples/docs/foo3.xml N xalan-p/samples/docs/foo4.xml N xalan-p/samples/docs/external.xsl N xalan-p/samples/docs/bogus.xml N xalan-p/samples/docs/foo5.xml N xalan-p/samples/docs/foo.xsl N xalan-p/samples/docs/foo6.xml N xalan-p/samples/docs/foo7.xml N xalan-p/Xalan/XObjectFactory.pod N xalan-p/Xalan/DocumentBuilder.pod N xalan-p/Xalan/XObject.pod N xalan-p/Xalan/ParsedSource.pod N xalan-p/Xalan/DOM.pm N xalan-p/Xalan/Transformer.pod N xalan-p/Driver/Xalan.pm No conflicts created by this import ***** Bogus filespec: - Imported sources |
|
From: Grant M. <gr...@us...> - 2002-04-17 20:46:40
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv31656
Modified Files:
faq.css faq-style.xsl
Log Message:
- minor formatting tweaks
Index: faq.css
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/faq.css,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- faq.css 31 Mar 2002 20:00:41 -0000 1.1.1.1
+++ faq.css 17 Apr 2002 20:46:36 -0000 1.2
@@ -12,6 +12,13 @@
font-weight: normal;
}
+TH {
+ background: #FFFFFF;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ font-weight: bold;
+}
+
.programlisting {
padding-top: 10;
padding-left: 8;
@@ -33,3 +40,6 @@
border-color: #eeeeee;
}
+DIV.revhistory {
+ width: 400px;
+}
Index: faq-style.xsl
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/faq-style.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- faq-style.xsl 2 Apr 2002 21:44:24 -0000 1.2
+++ faq-style.xsl 17 Apr 2002 20:46:36 -0000 1.3
@@ -13,8 +13,8 @@
<xsl:param name="css.decoration">1</xsl:param>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
-<xsl:param name="html.stylesheet" select="'faq.css'"/>
-<xsl:param name="spacing.paras" select="'1'"/>
+<xsl:param name="html.stylesheet">faq.css</xsl:param>
+<xsl:param name="spacing.paras">1</xsl:param>
<!-- Templates to override defaults -->
@@ -26,6 +26,12 @@
<xsl:template match="answer/formalpara/title">
<br /><b><xsl:value-of select="." /></b><br />
</xsl:template>
+
+<!-- Why didn't this work?
+<xsl:template match="revhistory">
+ <p>Revision History Here</p>
+</xsl:template>
+-->
</xsl:stylesheet>
|
|
From: Grant M. <gr...@us...> - 2002-04-17 20:45:53
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv31262
Modified Files:
perl-xml-faq.xml
Log Message:
- added CVS revision keywords
- added id attributes to qandadivs
- added XML::Simple FAQ link
- added writeup on Win32::OLE + MSXML
- minor formatting tweaks
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- perl-xml-faq.xml 4 Apr 2002 21:35:22 -0000 1.3
+++ perl-xml-faq.xml 17 Apr 2002 20:45:49 -0000 1.4
@@ -13,6 +13,14 @@
<year>2002</year>
<holder>Grant McLean</holder>
</copyright>
+
+ <revhistory>
+ <revision>
+ <revnumber>$Revision$</revnumber>
+ <date>$Date$</date>
+ </revision>
+ </revhistory>
+
<legalnotice>
<para>This work is distributed under the terms of Perl's Artistic License.
@@ -28,7 +36,7 @@
<qandaset defaultlabel="number">
-<qandadiv><title>Tutorial and Reference Sources</title>
+<qandadiv id="docs"><title>Tutorial and Reference Sources</title>
<qandaentry id="tutorials">
<question>
<para>Where can I get a gentle introduction to XML and Perl?</para>
@@ -143,7 +151,7 @@
</qandaentry>
</qandadiv>
-<qandadiv><title>Selecting a Parser Module</title>
+<qandadiv id="parser_selection"><title>Selecting a Parser Module</title>
<qandaentry id="dont_parse">
<question>
@@ -338,7 +346,7 @@
</qandadiv>
-<qandadiv><title>CPAN Modules</title>
+<qandadiv id="cpan_modules"><title>CPAN Modules</title>
<para>This section attempts to summarise the most commonly used XML modules
available on CPAN. Many of the modules require that you have certain
@@ -408,7 +416,10 @@
used for more general purpose XML work too. The 'simple tree' data
structure is nothing more than standard Perl hashrefs and arrays - there
is no API for finding or transforming nodes. This module is also not
- suitable for working with 'mixed content'.</para>
+ suitable for working with 'mixed content'.
+ <classname>XML::Simple</classname> has it's own <ulink
+ url="http://web.co.nz/~grantm/cpan/xmlsimple/faq.html">frequently asked
+ questions</ulink> document.</para>
<para>Although <classname>XML::Simple</classname> uses a tree-style, the
module also supports building the tree from SAX events or using a simple
@@ -482,6 +493,48 @@
</answer>
</qandaentry>
+ <qandaentry id="msxml">
+ <question>
+ <para><classname>Win32::OLE</classname> and MSXML.DLL</para>
+ </question>
+ <answer>
+
+ <para>If you're using a Windows platform and you're not worried about
+ portability, Microsoft's MSXML provides a DOM implementation with
+ optional validation and support for both XPath and XSLT. MSXML is a
+ COM component and as such can be accessed from Perl using
+ <classname>Win32::OLE</classname>. Unfortunately this means you can't
+ get at the documentation with the usual <command>perldoc</command>
+ command, so here's a code snippet to get you started:</para>
+
+ <programlisting><![CDATA[
+use Win32::OLE qw(in with);
+
+my $xml_file = 'your file name here';
+my $node_name = 'element name or XPath expression';
+
+my $dom = Win32::OLE->new('MSXML2.DOMDocument.3.0') or die "new() failed";
+
+$dom->{async} = "False";
+$dom->{validateOnParse} = "False";
+$dom->Load($xml_file) or die "Parse failed";
+
+my $node_list = $dom->selectNodes($node_name);
+foreach my $node (in $node_list) {
+ print $node->{Text}, "\n";
+}
+ ]]></programlisting>
+
+ <para>Shawn Ribordy has written <ulink
+ url="http://www.perl.com/pub/a/2001/04/17/msxml.html">an article about
+ using MSXML from Perl</ulink> at <ulink
+ url="http://www.perl.com">www.perl.com</ulink>. You can find reference
+ documentation for the MSXML API on <ulink
+ url="msdn.microsoft.com">MSDN</ulink>.</para>
+
+ </answer>
+ </qandaentry>
+
<qandaentry id="xml_sax">
<question>
<para><classname>XML::SAX</classname></para>
@@ -698,7 +751,7 @@
</qandadiv>
-<qandadiv><title>Encodings</title>
+<qandadiv id="encodings"><title>Encodings</title>
<qandaentry id="encodings_why">
<question>
@@ -1119,7 +1172,7 @@
</answer>
- <answer id="sax_encodeto">
+ <answer id="sax_writer">
<formalpara>
<title>XML::SAX::Writer</title>
@@ -1231,7 +1284,7 @@
</qandadiv>
-<qandadiv><title>Validation</title>
+<qandadiv id="validation"><title>Validation</title>
<para>The XML Recommendation says that an XML document is 'valid' if it
has an associated document type declaration and if the document complies
@@ -1284,7 +1337,7 @@
<!ELEMENT email (#PCDATA)>
]]></programlisting>
- <para>Here's an XML document that refer's to the DTD:</para>
+ <para>Here's an XML document that refers to the DTD:</para>
<programlisting><![CDATA[
<?xml version="1.0" ?>
@@ -1377,7 +1430,7 @@
</qandadiv>
-<qandadiv><title>Common Coding Problems</title>
+<qandadiv id="coding_problems"><title>Common Coding Problems</title>
<qandaentry id="error_handling">
<question>
@@ -1510,7 +1563,7 @@
</qandadiv>
-<qandadiv><title>Common XML Problems</title>
+<qandadiv id="xml_problems"><title>Common XML Problems</title>
<para>The error messages and questions listed in this section are not really
Perl-specific problems, but they are commonly encountered by people new to
@@ -1560,7 +1613,7 @@
</answer>
</qandaentry>
- <qandaentry id="no_quotes">
+ <qandaentry id="not_well_formed">
<question>
<para>'not well-formed (invalid token)'</para>
</question>
@@ -1571,7 +1624,7 @@
</answer>
- <answer>
+ <answer id="no_quotes">
<formalpara>
<title>Unquoted attributes</title>
@@ -1593,7 +1646,7 @@
</answer>
- <answer>
+ <answer id="bad_encoding_decl">
<formalpara>
<title>Bad encoding declaration</title>
@@ -1643,16 +1696,15 @@
<programlisting><![CDATA[
<!DOCTYPE doc [
- <!ENTITY eacute "é" >
- <!ENTITY euro "€" >
+ <!ENTITY eacute "é" >
+ <!ENTITY euro "€" >
]>
-
<doc>Combien avez-vous payé? 125 €</doc>
]]></programlisting>
<para>You can find the definitions for <ulink
url="http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_XHTML_Latin_1_Character_Entities"
- >HTML Latin 1 characters entities</ulink> on the W3c Site.</para>
+ >HTML Latin 1 characters entities</ulink> on the W3C Site.</para>
<para>You can include all these character entities into your DTD, so that
you won't have to worry about it anymore:</para>
@@ -1724,7 +1776,7 @@
</qandadiv>
-<qandadiv><title>Miscellaneous</title>
+<qandadiv id="misc"><title>Miscellaneous</title>
<qandaentry id="mailing_list">
<question>
@@ -1783,7 +1835,7 @@
</qandaset>
-<section><title>Corrections, Contributions and Acknowledgements</title>
+<section id="corrections_etc"><title>Corrections, Contributions and Acknowledgements</title>
<para>This document is a 'work in progress'. A number of questions are
still being worked on and will be added when they are complete.</para>
|
|
From: Grant M. <gr...@us...> - 2002-04-04 21:35:26
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv24884
Modified Files:
perl-xml-faq.xml
Log Message:
- more stuff on validation
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- perl-xml-faq.xml 2 Apr 2002 21:42:35 -0000 1.2
+++ perl-xml-faq.xml 4 Apr 2002 21:35:22 -0000 1.3
@@ -1274,9 +1274,51 @@
you would use <classname>XML::Parser</classname>. It works the same
way except that it performs DTD validation.</para>
-<!--
-FIXME: XML::Checker sample code
--->
+ <para>Here's a short example to get you going. Here's a DTD saved
+ in a file called <filename>/opt/xml/xcard.dtd</filename>:</para>
+
+ <programlisting><![CDATA[
+<!ELEMENT xcard (firstname,lastname,email?)>
+<!ELEMENT firstname (#PCDATA)>
+<!ELEMENT lastname (#PCDATA)>
+<!ELEMENT email (#PCDATA)>
+ ]]></programlisting>
+
+ <para>Here's an XML document that refer's to the DTD:</para>
+
+ <programlisting><![CDATA[
+<?xml version="1.0" ?>
+<!DOCTYPE xcard SYSTEM "file:/opt/xml/xcard.dtd" >
+<xcard>
+<firstname>Joe</firstname>
+<lastname>Bloggs</lastname>
+<email>jo...@bl...</email>
+</xcard>
+ ]]></programlisting>
+
+ <para>And here's a code snippet to validate the document:</para>
+
+ <programlisting><![CDATA[
+use XML::Checker::Parser;
+
+my $xp = new XML::Checker::Parser ( Handlers => { } );
+
+eval {
+ $xp->parsefile($xml_file);
+};
+if ($@) {
+ # ... your error handling code here ...
+ print "$xml_file failed validation!\n";
+ die "$@";
+}
+print "$xml_file passed validation\n";
+ ]]></programlisting>
+
+ <para>You can play around with adding and removing elements from the
+ document to get a idea of what happens when validation errors
+ occur. You'll also want to refer to the documentation for the
+ 'SkipExternalDTD' option for more robust handling of external
+ DTDs.</para>
</answer>
</qandaentry>
@@ -1295,6 +1337,12 @@
$parser->validation(1);
]]></programlisting>
+ <para>Validation using <classname>XML::LibXML</classname> is much faster
+ than with <classname>XML::Checker</classname> but if you want to know why
+ a document fails validation you'll find that
+ <classname>XML::LibXML</classname>'s diagnostic messages are not as
+ helpful.</para>
+
</answer>
</qandaentry>
@@ -1308,6 +1356,21 @@
url="http://www.xml.com/pub/au/83">an article</ulink> describing how a
combination of Perl and XPath can provide a quick, lightweight solution
for validating documents.</para>
+
+ </answer>
+ </qandaentry>
+
+ <qandaentry id="validation_schematron">
+ <question>
+ <para><classname>XML::Schematron</classname></para>
+ </question>
+ <answer>
+
+ <para>Kip has also written the <classname>XML::Schematron</classname>
+ module which can be used with either <classname>XML::XPath</classname> or
+ <classname>XML::Sablotron</classname> to implement validation based on
+ Rick Jelliffe's <ulink
+ url="http://www.ascc.net/xml/resource/schematron/">Schematron</ulink>.</para>
</answer>
</qandaentry>
|
|
From: Grant M. <gr...@us...> - 2002-04-03 00:30:15
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv23301
Modified Files:
faq-style.xsl
Log Message:
- changed path to DocBook XSL distribution
Index: faq-style.xsl
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/faq-style.xsl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- faq-style.xsl 31 Mar 2002 20:00:41 -0000 1.1.1.1
+++ faq-style.xsl 2 Apr 2002 21:44:24 -0000 1.2
@@ -4,7 +4,10 @@
xmlns="http://www.w3.org/TR/xhtml1/transitional"
exclude-result-prefixes="#default">
-<xsl:import href="../../docbook/docbook-xsl-1.49/html/docbook.xsl"/>
+<!-- This is where I chose to install the DocBook XSL Stylesheets -->
+<!-- from: http://docbook.sourceforge.net/projects/xsl/index.html -->
+
+<xsl:import href="/usr/share/xml/docbook/xslt/html/docbook.xsl"/>
<!-- Parameter settings -->
|
|
From: Grant M. <gr...@us...> - 2002-04-03 00:29:23
|
Update of /cvsroot/perl-xml/perl-xml-faq
In directory usw-pr-cvs1:/tmp/cvs-serv22640
Modified Files:
perl-xml-faq.xml
Log Message:
- integrated patch from Per Einar Ellefsen
Index: perl-xml-faq.xml
===================================================================
RCS file: /cvsroot/perl-xml/perl-xml-faq/perl-xml-faq.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- perl-xml-faq.xml 31 Mar 2002 20:00:56 -0000 1.1.1.1
+++ perl-xml-faq.xml 2 Apr 2002 21:42:35 -0000 1.2
@@ -53,6 +53,10 @@
<listitem><para><ulink
url="http://www.xml.com/pub/a/2001/06/13/perlxml.html">Perl XML
Quick Start: Convenience Modules</ulink></para></listitem>
+
+ <listitem><para><ulink
+ url="http://www.xml.com/pub/a/2001/11/14/xml-libxml.html">XML::LibXML
+ - An XML::Parser Alternative</ulink></para></listitem>
<listitem><para><ulink
url="http://www.xml.com/pub/au/83">List of all Kip's articles</ulink>
@@ -117,6 +121,12 @@
ActivePerl</guisubmenu></menuchoice>. If your distribution does not
include the HTML files, you can create them using
<command>pod2html</command></para></listitem>
+
+ <listitem><para>HTML documentation for various Perl modules is also
+ provided on various Internet sites. You can try searching for XML on
+ <ulink url="http://www.perldoc.com/">Perldoc.com</ulink> or on <ulink
+ url="http://search.cpan.org">search.cpan.org</ulink> for a list of XML
+ documentation.</para></listitem>
<listitem><para>If all else fails, you can locate the module and open
it directly in a text editor. Once again, using
@@ -370,10 +380,11 @@
</question>
<answer>
- <para>Enno Derksen's <classname>XML::DOM</classname> implements the W3C
- DOM Level 1 tree structure and API (DOM Level 1 does not include
- namespace support). Although you can find nodes in the tree by tag name,
- you can't use XPath expressions.</para>
+ <para>Enno Derksen's <classname>XML::DOM</classname> implements the
+ <ulink url="http://www.w3.org/TR/REC-DOM-Level-1/">W3C DOM Level 1</ulink>
+ tree structure and API (DOM Level 1 does not include namespace support).
+ Although you can find nodes in the tree by tag name, you can't use XPath
+ expressions.</para>
<para>The distribution includes
<classname>XML::DOM::ValParser</classname> which performs validation
@@ -1008,7 +1019,7 @@
<answer id="perl_5_6_tr">
<formalpara>
- <title>Perl 5.6 tr/// operator - deprecated</title>
+ <title>Perl 5.6 tr/// operator (deprecated)</title>
<para>Perl 5.6 offers a way of converting between UTF-8 and Latin1 8 bit
byte strings using the 'tr' operator. This will no longer work in
@@ -1508,7 +1519,7 @@
</formalpara>
<programlisting><![CDATA[
-item name="widget"></item>
+<item name="widget"></item>
]]></programlisting>
<para>while this would not:</para>
@@ -1568,12 +1579,39 @@
in your DTD or in an 'internal subset' of a DTD. For example:</para>
<programlisting><![CDATA[
-FIXME: Internal DTD subset example
+<!DOCTYPE doc [
+ <!ENTITY eacute "é" >
+ <!ENTITY euro "€" >
+]>
+
+<doc>Combien avez-vous payé? 125 €</doc>
]]></programlisting>
<para>You can find the definitions for <ulink
url="http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_XHTML_Latin_1_Character_Entities"
>HTML Latin 1 characters entities</ulink> on the W3c Site.</para>
+
+ <para>You can include all these character entities into your DTD, so that
+ you won't have to worry about it anymore:</para>
+
+ <programlisting><![CDATA[
+<!DOCTYPE doc [
+<!ENTITY % HTMLlat1 PUBLIC
+ "-//W3C//ENTITIES Latin 1 for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
+%HTMLlat1;
+
+<!ENTITY % HTMLspecial PUBLIC
+ "-//W3C//ENTITIES Special for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
+%HTMLspecial;
+
+<!ENTITY % HTMLsymbol PUBLIC
+ "-//W3C//ENTITIES Symbols for XHTML//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
+%HTMLsymbol;
+]>
+ ]]></programlisting>
</answer>
</qandaentry>
|
|
From: Grant M. <gr...@us...> - 2002-03-31 20:08:05
|
Update of /cvsroot/perl-xml/perl-xml-faq In directory usw-pr-cvs1:/tmp/cvs-serv16383 Log Message: Perl XML FAQ Status: Vendor Tag: grantm Release Tags: start N perl-xml-faq/faq.css N perl-xml-faq/faq-style.xsl N perl-xml-faq/perl-xml-faq.xml No conflicts created by this import ***** Bogus filespec: - Imported sources |