XAS::Lib::XML - A class to manipulate XML documents
use XAS::Lib::XML; my $xpath; my $buffer = <STDIN>; my $filename = 'schemna.xsd', my $xml = XAS::Lib::XML->new( -xsd => $filename, ); $xml->load($buffer); if ($xml->is_valid) { $xpath = '//sif:SIF_Header/sif:SIF_SourceId'; printf("value: %s\n", $xml->get_item($xpath)); }
This module is able to load, parse and validate a xml document.
This method initialize the module and takes these parameters:
The XML Schema to validate against.
The default namespace to use, defaults to 'def'.
This method loads and parses a XML document.
The XML to load.
This method validates the document to the XSD. If valid returns TRUE, otherwise throws an exception.
This method will return the string valuse of the Xpath.
The Xpath string.
This method will return an array of nodes for the given Xpath.
This method will return the node associated with the xpath.
A class method to return the full XML error string.
Kevin L. Esteb, <kevin@kesteb.us>
Copyright (C) 2014 Kevin L. Esteb
This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.
To install XAS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAS
CPAN shell
perl -MCPAN -e shell install XAS
For more information on module installation, please visit the detailed CPAN module installation guide.