Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
CSV(3)		      User Contributed Perl Documentation		CSV(3)

NAME
	   XML::SAXDriver::CSV - SAXDriver for converting CSV files to XML

SYNOPSIS
	     use XML::SAXDriver::CSV;
	     my	$driver	= XML::SAXDriver::CSV->new(%attr);
	     $driver->parse(%attr);

DESCRIPTION
	   XML::SAXDriver::CSV was developed as	a compliment to	XML::CSV, though it provides a SAX
	   interface, for gained performance and efficiency, to	CSV files.  Specific object attributes
	   and handlers	are set	to define the behavior of the parse() method.  It does not matter where
	   you define your attributes.	If they	are defined in the new() method, they will apply to all
	   parse() calls.  You can override in any call	to parse() and it will remain local to that
	   function call and not effect	the rest of the	object.

XML::SAXDriver::CSV properties
	   Source - (Reference to a String, ByteStream,	SystemId)

	       String -	Contains literal CSV data. Ex (Source => {String => $foo})

	       ByteStream - Contains a filehandle reference.  Ex. (Source => {ByteStream => \*STDIN})

	       SystemId	- Contains the path to the file	containing the CSV data. Ex (Source => {SystemId => '../csv/foo.csv'})

	   Handler - Contains the object to be used as a XML print handler

	   Declaration

	       Version - Specifies an XML version for declaration.  Defaults to	'1.0'.

	       Encoding	- Specifies the	endcoding in XML declaration.  Omitted by default.

	       Standalone - Specifies the standalone attribute.	 Omitted by default.

	   DTDHandler -	Contains the object to be used as a XML	DTD handler.
			****There is no	DTD support available at this time.
			I'll make it available in the next version.****

	   SubChar - Specifies the character(s)	to use to substitute illegal chars in xml tag names, that
		     will be generated from the	first row, but setting the Dynamic_Col_Headings.

	   Col_Headings	- Reference to the array of column names to be used for	XML tag	names.

	   Dynamic_Col_Headings	- Should be set	if you want the	XML tag	names generated	dynamically
				  from the first row in	CSV file.  **Make sure that the	number of columns
				  in your first	row is equal to	the largest row	in the document.  You
				  don't	generally have to worry	about if you are submitting valid CSV
				  data,	where each row will have the same number of columns, even if
				  they are empty.

	   Headings_Handler - Should be	used along with	Dynamic_Col_Headings to	provide	a heading
				normalization handler, to conform the headings to the XML 1.0
				specifications.	 If not	provided, a default will be used that only
				works with ASCII chars,	therefore any other character sets need	to
				provide	a custom handler!  The handler sub will	be passed the heading
				string as the first argument.

AUTHOR
       Ilya Sterin (isterin@cpan.org)

       Originally written by Matt Sergeant, matt@sergeant.org Modified and
       maintained by Ilya Sterin, isterin@cpan.org

SEE ALSO
       XML::CSV.

perl v5.32.1			  2021-08-27				CSV(3)

NAME | SYNOPSIS | DESCRIPTION | XML::SAXDriver::CSV properties | AUTHOR | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=XML::SAXDriver::CSV&sektion=3&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help