|
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>
|