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: Petr P. <pa...@us...> - 2003-03-14 16:12:45
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv15544 Modified Files: XPathContext.xs XPathContext.pm Log Message: added variable lookup support Index: XPathContext.xs =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.xs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- XPathContext.xs 14 Mar 2003 14:32:00 -0000 1.1.1.1 +++ XPathContext.xs 14 Mar 2003 16:12:39 -0000 1.2 @@ -60,6 +60,126 @@ SvREFCNT_dec(sv); } +/* **************************************************************** + * Variable Lookup + * **************************************************************** */ +xmlXPathObjectPtr +LibXML_generic_variable_lookup(void* varLookupData, + const xmlChar *name, + const xmlChar *ns_uri) +{ + xmlXPathObjectPtr ret; + SV * lookup_func; + SV * lookup_data; + I32 count; + STRLEN n_a; + SV * perl_result; + AV * array_result; + xmlNodePtr tmp_node, tmp_node1; + dSP; + char * tmp_string; + double tmp_double; + int tmp_int; + SV * data = (SV *) varLookupData; + + if (varLookupData == NULL || + SvTYPE(SvRV(data)) != SVt_PVAV) { + croak("LibXML: lost data structure for variable lookup.\n"); + } + + lookup_func = *(av_fetch((AV *) SvRV(data),0,0 )); + lookup_data = *(av_fetch((AV *) SvRV(data),1,0 )); + + ENTER; + SAVETMPS; + PUSHMARK(SP); + + XPUSHs(lookup_data); + XPUSHs(sv_2mortal(C2Sv(name,NULL))); + XPUSHs(sv_2mortal(C2Sv(ns_uri,NULL))); + PUTBACK ; + + count = perl_call_sv(lookup_func, G_SCALAR|G_EVAL); + + SPAGAIN; + if (SvTRUE(ERRSV)) { + POPs; + croak("LibXML: error coming back from variable lookup function. %s\n", SvPV(ERRSV, n_a)); + } + if (count != 1) croak("LibXML: variable lookup function returned more than one argument!\n"); + + perl_result = POPs; + if (!SvOK(perl_result)) { + ret = (xmlXPathObjectPtr)xmlXPathNewCString(""); + goto FINISH; + } + /* convert perl result structures to LibXML structures */ + if (sv_isobject(perl_result) && + (SvTYPE(SvRV(perl_result)) == SVt_PVMG || + SvTYPE(SvRV(perl_result)) == SVt_PVAV)) + { + if (sv_isa(perl_result, "XML::LibXML::NodeList")) { + int i = 0; + int len; + /* warn("result is a node list\n"); */ + ret = (xmlXPathObjectPtr) xmlXPathNewNodeSet((xmlNodePtr) NULL); + array_result = (AV*)SvRV(perl_result); + len = av_len(array_result); + for( i; i <= len ; i++ ) { + tmp_node = (xmlNodePtr)PmmSvNode(*(av_fetch(array_result,i,0))); + xmlXPathNodeSetAdd(ret->nodesetval, tmp_node); + } + goto FINISH; + } + else if (sv_isa(perl_result, "XML::LibXML::Node") || + sv_isa(perl_result, "XML::LibXML::Element") || + sv_isa(perl_result, "XML::LibXML::Attr") || + sv_isa(perl_result, "XML::LibXML::Text") || + sv_isa(perl_result, "XML::LibXML::Comment") || + sv_isa(perl_result, "XML::LibXML::Document") || + sv_isa(perl_result, "XML::LibXML::PI")) { + /* warn("result is a node\n"); */ + ret = (xmlXPathObjectPtr)xmlXPathNewNodeSet(NULL); + tmp_node = (xmlNodePtr)PmmSvNode(perl_result); + xmlXPathNodeSetAdd(ret->nodesetval,tmp_node); + goto FINISH; + } + else if (sv_isa(perl_result, "XML::LibXML::Boolean")) { + /* warn("result is a boolean\n"); */ + tmp_int = SvIV(SvRV(perl_result)); + ret = (xmlXPathObjectPtr)xmlXPathNewBoolean(tmp_int); + goto FINISH; + } + else if (sv_isa(perl_result, "XML::LibXML::Literal")) { + /* warn("result is a literal\n"); */ + tmp_string = SvPV(SvRV(perl_result), n_a); + ret = (xmlXPathObjectPtr)xmlXPathNewCString(tmp_string); + goto FINISH; + } + else if (sv_isa(perl_result, "XML::LibXML::Number")) { + /* warn("result is a number\n"); */ + tmp_double = SvNV(SvRV(perl_result)); + ret = (xmlXPathObjectPtr)xmlXPathNewFloat(tmp_double); + goto FINISH; + } + } else if (SvNOK(perl_result) || SvIOK(perl_result)) { + /* warn("result is an unblessed number\n"); */ + ret = (xmlXPathObjectPtr)xmlXPathNewFloat(SvNV(perl_result)); + } else { + /* warn("result is an unblessed string\n"); */ + ret = (xmlXPathObjectPtr)xmlXPathNewCString(SvPV(perl_result, n_a)); + } + + +FINISH: + + PUTBACK; + FREETMPS; + LEAVE; + return ret; +} + + MODULE = XML::LibXML::XPathContext PACKAGE = XML::LibXML::XPathContext SV* @@ -108,6 +228,10 @@ if (ctxt->namespaces != NULL) { xmlFree( ctxt->namespaces ); } + if (ctxt->varLookupData != NULL + && SvTYPE(SvRV((SV *)ctxt->varLookupData)) == SVt_PVAV) { + SvREFCNT_dec((SV *)ctxt->varLookupData); + } xmlXPathFreeContext(ctxt); } @@ -130,6 +254,60 @@ if(ret == -1) { croak( "cannot register ns" ); } + +SV* +getVarLookupData( self ) + SV * self + INIT: + xmlXPathContextPtr ctxt = (xmlXPathContextPtr)SvIV(SvRV(self)); + CODE: + if (ctxt->varLookupData != NULL + && SvTYPE(SvRV((SV *)ctxt->varLookupData)) == SVt_PVAV) { + RETVAL = *(av_fetch((AV *) SvRV((SV*)ctxt->varLookupData),1,0 )); + SvREFCNT_inc(RETVAL); + } else { + RETVAL = &PL_sv_undef; + } + + OUTPUT: + RETVAL + + + +void +registerVarLookupFunc( pxpath_context, lookup_func, lookup_data ) + SV * pxpath_context + SV * lookup_func + SV * lookup_data + PREINIT: + xmlXPathContextPtr ctxt = NULL; + SV* pfdr; + INIT: + ctxt = (xmlXPathContextPtr)SvIV(SvRV(pxpath_context)); + if ( ctxt == NULL ) { + croak( "missing xpath context" ); + } + if ( SvTYPE(SvRV(lookup_func)) == SVt_PVCV ) { + pfdr = newRV_inc((SV*) newAV()); + av_push((AV *)SvRV(pfdr), SvREFCNT_inc(lookup_func)); + av_push((AV *)SvRV(pfdr), SvREFCNT_inc(lookup_data)); + } else { + croak( "1st argument is not a CODE reference" ); + } + if (ctxt->varLookupData != NULL) { + if (SvTYPE(SvRV((SV *)ctxt->varLookupData)) == SVt_PVAV) { + SvREFCNT_dec((SV *)ctxt->varLookupData); + ctxt->varLookupData = NULL; + ctxt->varLookupFunc = NULL; + } else { + croak("can't register: varLookupData slot already occupied\n"); + } + } + PPCODE: + xmlXPathRegisterVariableLookup(ctxt, LibXML_generic_variable_lookup, pfdr); + if (ctxt->varLookupData==NULL || ctxt->varLookupData != pfdr) { + croak( "registrating failed\n" ); + } void Index: XPathContext.pm =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/XPathContext.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- XPathContext.pm 14 Mar 2003 14:32:04 -0000 1.1.1.1 +++ XPathContext.pm 14 Mar 2003 16:12:40 -0000 1.2 @@ -87,6 +87,20 @@ Registers namespace I<$prefix> to I<$namespace_uri>. +=item B<registerVarLookupFunc($callback, $data)> + +Registers variable lookup function I<$prefix>. The registered function +is executed by the XPath engine each time an XPath variable is +evaluated. It takes three arguments: I<$data>, variable name, and +variable ns-URI and must return one value: a number or string or any +XML::LibXML object that can be a result of findnodes: Boolean, +Literal, Number, Node (e.g. Document, Element, etc.), or NodeList. + +=item B<getVarLookupData()> + +Returns the data associated with a variable lookup function during a +previous call to I<registerVarLookupFunc>. + =item B<findnodes($xpath)> Performs the xpath statement on the current node and returns the |
From: Petr P. <pa...@us...> - 2003-03-14 16:12:10
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv15280 Modified Files: MANIFEST Log Message: add t/01-variables.t Index: MANIFEST =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-XPathContext/MANIFEST,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- MANIFEST 14 Mar 2003 14:32:02 -0000 1.1.1.1 +++ MANIFEST 14 Mar 2003 16:12:04 -0000 1.2 @@ -12,6 +12,7 @@ perl-libxml-sax.h ppport.h t/00-xpathcontext.t +t/01-variables.t typemap xpath.c xpath.h |
From: Petr P. <pa...@us...> - 2003-03-14 16:11:33
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext/t In directory sc8-pr-cvs1:/tmp/cvs-serv14823/t Added Files: 01-variables.t Log Message: Initial commit --- NEW FILE: 01-variables.t --- use Test; BEGIN { plan tests => 30 }; use IO::File; use XML::LibXML; use XML::LibXML::XPathContext; autoflush STDERR; autoflush STDOUT; my $doc = XML::LibXML->new->parse_string(<<'XML'); <foo><bar a="b">Bla</bar><bar/></foo> XML my %variables = ( 'a' => XML::LibXML::Number->new(2), 'b' => "b", ); sub get_variable { my ($data, $name, $uri)=@_; return exists($data->{$name}) ? $data->{$name} : undef; } # $c: nodelist $variables{c} = XML::LibXML::XPathContext->new($doc)->findnodes('//bar'); ok($variables{c}->isa('XML::LibXML::NodeList')); ok($variables{c}->size() == 2); ok($variables{c}->get_node(1)->nodeName eq 'bar'); # $d: a single element node $variables{d} = XML::LibXML::XPathContext->new($doc)->findnodes('/*')->pop; ok($variables{d}->nodeName() eq 'foo'); # $e: a single text node $variables{e} = XML::LibXML::XPathContext->new($doc)->findnodes('//text()'); ok($variables{e}->get_node(1)->data() eq 'Bla'); # $f: a single attribute node $variables{f} = XML::LibXML::XPathContext->new($doc)->findnodes('//@*')->pop; ok($variables{f}->nodeName() eq 'a'); ok($variables{f}->value() eq 'b'); # $f: a single document node $variables{g} = XML::LibXML::XPathContext->new($doc)->findnodes('/')->pop; ok($variables{g}->nodeType() == XML::LibXML::XML_DOCUMENT_NODE); # test registerVarLookupFunc() and getVarLookupData() my $xc = XML::LibXML::XPathContext->new($doc); ok(!defined($xc->getVarLookupData)); $xc->registerVarLookupFunc(\&get_variable,\%variables); ok(defined($xc->getVarLookupData)); my $h1=$xc->getVarLookupData; my $h2=\%variables; ok("$h1" eq "$h2" ); ok($h1 eq $xc->getVarLookupData); # test values returned by XPath queries ok($xc->find('$a') == 2); ok($xc->find('$b') eq "b"); ok($xc->findnodes('//@a[.=$b]')->size() == 1); ok($xc->findnodes('//@a[.=$b]')->size() == 1); ok($xc->findnodes('$c')->size() == 2); ok($xc->findnodes('$c')->size() == 2); ok($xc->findnodes('$c[1]')->pop->isSameNode($variables{c}->get_node(1))); ok($xc->findnodes('$c[@a="b"]')->size() == 1); ok($xc->findnodes('$d')->size() == 1); ok($xc->findnodes('$d/*')->size() == 2); ok($xc->findnodes('$d')->pop->isSameNode($variables{d})); ok($xc->findvalue('$e') eq 'Bla'); ok($xc->findnodes('$e')->pop->isSameNode($variables{e}->get_node(1))); ok($xc->findnodes('$c[@*=$f]')->size() == 1); ok($xc->findvalue('$f') eq 'b'); ok($xc->findnodes('$f')->pop->nodeName eq 'a'); ok($xc->findnodes('$f')->pop->isSameNode($variables{f})); ok($xc->findnodes('$g')->pop->isSameNode($variables{g})); |
From: Ilya M. <m_...@us...> - 2003-03-14 14:32:12
|
Update of /cvsroot/perl-xml/XML-LibXML-XPathContext In directory sc8-pr-cvs1:/tmp/cvs-serv26037 Log Message: Import first draft of XML::LibXML::XPathContext Status: Vendor Tag: ilya Release Tags: ilya-0-01 N XML-LibXML-XPathContext/Makefile.PL N XML-LibXML-XPathContext/XPathContext.xs N XML-LibXML-XPathContext/xpath.c N XML-LibXML-XPathContext/perl-libxml-mm.c N XML-LibXML-XPathContext/ppport.h N XML-LibXML-XPathContext/xpath.h N XML-LibXML-XPathContext/perl-libxml-sax.h N XML-LibXML-XPathContext/LICENSE N XML-LibXML-XPathContext/MANIFEST N XML-LibXML-XPathContext/perl-libxml-sax.c N XML-LibXML-XPathContext/perl-libxml-mm.h N XML-LibXML-XPathContext/XPathContext.pm N XML-LibXML-XPathContext/typemap N XML-LibXML-XPathContext/dom.h N XML-LibXML-XPathContext/dom.c N XML-LibXML-XPathContext/README N XML-LibXML-XPathContext/t/00-xpathcontext.t No conflicts created by this import ***** Bogus filespec: - Imported sources |
From: Christian G. <phi...@us...> - 2003-02-27 18:33:04
|
Update of /cvsroot/perl-xml/XML-LibXML-Common In directory sc8-pr-cvs1:/tmp/cvs-serv22148 Modified Files: Changes Common.pm Common.xs test.pl Log Message: Modified Files: Changes Common.pm + version updates Common.xs + fixed the UTF16 decoding bug. now the entire string is copied to the SV* test.pl + utf16 tests Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/Changes,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Changes 12 Nov 2002 10:41:29 -0000 1.5 +++ Changes 27 Feb 2003 18:32:59 -0000 1.6 @@ -1,4 +1,10 @@ Revision history for Perl extension XML::LibXML::Common. +0.13 + - fixed the UTF16 decoding bug (now the entire string is available) + +0.12_1 Sat Nov 16 11:30:00 2002 + - removed japanese test from default tests. + (solaris cannot handle it by default) 0.12 Tue Nov 12 12:00:00 2002 - Encoding fix provided by Daisuke Maki Index: Common.pm =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/Common.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Common.pm 15 Nov 2002 20:10:13 -0000 1.4 +++ Common.pm 27 Feb 2003 18:32:59 -0000 1.5 @@ -14,7 +14,7 @@ @ISA = qw(DynaLoader Exporter); -$VERSION = '0.12'; +$VERSION = '0.13'; bootstrap XML::LibXML::Common $VERSION; Index: Common.xs =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/Common.xs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Common.xs 12 Nov 2002 10:41:29 -0000 1.4 +++ Common.xs 27 Feb 2003 18:32:59 -0000 1.5 @@ -121,7 +121,7 @@ croak( "return value missing!" ); } - len = xmlStrlen( tstr ); + len = xmlStrlen( tstr ); RETVAL = newSVpvn( (const char *)tstr, len ); #ifdef HAVE_UTF8 SvUTF8_on(RETVAL); @@ -191,7 +191,8 @@ out = xmlBufferCreate(); xmlBufferCCat( in, realstring ); if ( xmlCharEncOutFunc( coder, out, in ) >= 0 ) { - tstr = xmlStrdup(out->content); + len = xmlBufferLength(out); + tstr = (xmlChar*)xmlBufferContent(out); } xmlBufferFree( in ); @@ -207,7 +208,7 @@ } } - len = xmlStrlen( tstr ); + /* len = xmlStrlen( tstr ); */ RETVAL = newSVpvn( (const char *)tstr, len ); #ifdef HAVE_UTF8 if ( enc == XML_CHAR_ENCODING_UTF8 ) { Index: test.pl =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/test.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- test.pl 2 Sep 2002 09:15:16 -0000 1.1.1.1 +++ test.pl 27 Feb 2003 18:32:59 -0000 1.2 @@ -6,12 +6,14 @@ # change 'tests => 1' to 'tests => last_test_to_print'; use Test; -BEGIN { plan tests => 5 }; +BEGIN { plan tests => 8 }; use XML::LibXML::Common qw( :libxml :encoding ); use constant TEST_STRING_GER => "Hänsel und Gretel"; use constant TEST_STRING_GER2 => "täst"; use constant TEST_STRING_UTF => 'test'; +use constant TEST_STRING_JP => 'À¸ÇþÀ¸ÊÆÀ¸Íñ'; + ok(1); # If we made it this far, we're ok. ######################### @@ -35,8 +37,32 @@ TEST_STRING_UTF ); +my $u16 = decodeFromUTF8( 'UTF-16', + encodeToUTF8('UTF-8', TEST_STRING_UTF ) ); +ok( length($u16), 2*length(TEST_STRING_UTF)); + +my $u16be = decodeFromUTF8( 'UTF-16BE', + encodeToUTF8('UTF-8', TEST_STRING_UTF ) ); +ok( length($u16be), 2*length(TEST_STRING_UTF)); + +my $u16le = decodeFromUTF8( 'UTF-16LE', + encodeToUTF8('UTF-8', TEST_STRING_UTF ) ); +ok( length($u16le), 2*length(TEST_STRING_UTF)); +#bad encoding name test. eval { - my $str = encodeToUTF8( "EUC-JP" ,"Föö" ); + my $str = encodeToUTF8( "foo" , TEST_STRING_GER2 ); }; ok( length( $@ ) ); + +# here should be a test to test badly encoded strings. but for some +# reasons i am unable to create an apropriate test :( + + + +# uncomment these lines if your system is capable to handel not only i +# so latin 1 +#ok( decodeFromUTF8('EUC-JP', +# encodeToUTF8('EUC-JP', +# TEST_STRING_JP ) ), +# TEST_STRING_JP ); |
From: Grant M. <gr...@us...> - 2003-01-20 07:49:02
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv19607/t Modified Files: 1_XMLin.t Log Message: - for release 2.03 Index: 1_XMLin.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/1_XMLin.t,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- 1_XMLin.t 15 Dec 2002 08:10:52 -0000 1.9 +++ 1_XMLin.t 20 Jan 2003 07:48:59 -0000 1.10 @@ -21,8 +21,8 @@ $@ = ''; eval "use XML::Simple;"; is($@, '', 'Module compiled OK'); -unless($XML::Simple::VERSION eq '2.02') { - diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.02)"); +unless($XML::Simple::VERSION eq '2.03') { + diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.03)"); } |
From: Grant M. <gr...@us...> - 2003-01-20 07:49:02
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv19607 Modified Files: Changes README Log Message: - for release 2.03 Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/Changes,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Changes 15 Dec 2002 08:09:37 -0000 1.7 +++ Changes 20 Jan 2003 07:48:59 -0000 1.8 @@ -1,5 +1,9 @@ Revision history for Perl module XML::Simple +2.03 Jan 20 2003 + - fixed circular reference check which was incorrectly catching + 'parallel' references (patch from Theo Lengyel) + 2.02 Dec 15 2002 - changed Storable calls to use locking (reported by Randal Schwarz) Index: README =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/README,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- README 15 Dec 2002 08:09:37 -0000 1.7 +++ README 20 Jan 2003 07:48:59 -0000 1.8 @@ -56,13 +56,16 @@ STATUS - This version (2.02) is the current stable release. + This version (2.03) is the current stable release. Please send any feedback to the author: gr...@cp... NEW IN THIS RELEASE + - fixed circular reference check which was incorrectly catching + 'parallel' references (patch from Theo Lengyel) + New in Version 2.03: - changed Storable calls to use locking New in Version 2.01: @@ -84,7 +87,7 @@ COPYRIGHT - Copyright 1999-2002 Grant McLean <gr...@cp...> + Copyright 1999-2003 Grant McLean <gr...@cp...> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
From: Grant M. <gr...@us...> - 2003-01-20 07:48:13
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv19094/t Modified Files: 2_XMLout.t Log Message: - fixed circular reference check (patch from Theo Lengyel) Index: 2_XMLout.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/2_XMLout.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- 2_XMLout.t 16 Oct 2002 09:43:35 -0000 1.4 +++ 2_XMLout.t 20 Jan 2003 07:48:10 -0000 1.5 @@ -5,7 +5,7 @@ use Test::More; use IO::File; -plan tests => 172; +plan tests => 174; ############################################################################## # S U P P O R T R O U T I N E S @@ -310,6 +310,23 @@ ok(!defined($_), 'caught circular data structure'); like($@, qr/circular data structures not supported/, 'with correct error message'); + + +# Try encoding a repetitive (but non-circular) data structure and confirm that +# it does not fail + +$_ = eval { + my $a = { alpha => 1 }; + my $ref = { a => $a, b => $a }; + XMLout($ref); +}; +ok(defined($_), 'repetitive (non-circular) data structure not fatal'); +like($_, qr{^ +<opt> + \s*<a\s+alpha="1"\s*/> + \s*<b\s+alpha="1"\s*/> +\s*</opt> +}xs, 'and encodes as expected'); # Try encoding a blessed reference and confirm that it fails |
From: Grant M. <gr...@us...> - 2003-01-20 07:48:13
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv19094/lib/XML Modified Files: Simple.pm Log Message: - fixed circular reference check (patch from Theo Lengyel) Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Simple.pm 15 Dec 2002 08:08:19 -0000 1.9 +++ Simple.pm 20 Jan 2003 07:48:08 -0000 1.10 @@ -52,7 +52,7 @@ @ISA = qw(Exporter); @EXPORT = qw(XMLin XMLout); -$VERSION = '2.02'; +$VERSION = '2.03'; $PREFERRED_PARSER = undef; my $StrictMode = 0; @@ -514,7 +514,10 @@ # Encode the hashref and write to file if necessary - my $xml = $self->value_to_xml($ref, $self->{opt}->{rootname}, {}, ''); + $self->{_ancestors} = []; + my $xml = $self->value_to_xml($ref, $self->{opt}->{rootname}, ''); + delete $self->{_ancestors}; + if($self->{opt}->{xmldecl}) { $xml = $self->{opt}->{xmldecl} . "\n" . $xml; } @@ -993,7 +996,6 @@ # Arguments expected are: # - the data structure to be encoded (usually a reference) # - the XML tag name to use for this item -# - a hashref of references already encoded (to detect circular structures) # - a string of spaces for use as the current indent level # @@ -1003,7 +1005,7 @@ # Grab the other arguments - my($ref, $name, $encoded, $indent) = @_; + my($ref, $name, $indent) = @_; my $named = (defined($name) and $name ne '' ? 1 : 0); @@ -1013,8 +1015,9 @@ # Convert to XML if(ref($ref)) { - croak "circular data structures not supported" if($encoded->{$ref}); - $encoded->{$ref} = $ref; + croak "circular data structures not supported" + if(grep($_ == $ref, @{$self->{_ancestors}})); + push @{$self->{_ancestors}}, $ref; } else { if($named) { @@ -1125,7 +1128,7 @@ } if(ref($value) or $self->{opt}->{noattr}) { push @nested, - $self->value_to_xml($value, $key, $encoded, "$indent "); + $self->value_to_xml($value, $key, "$indent "); } else { $value = $self->escape_value($value) unless($self->{opt}->{noescape}); @@ -1179,12 +1182,12 @@ '</', $name, ">\n"; } elsif(UNIVERSAL::isa($value, 'HASH')) { - push @result, $self->value_to_xml($value, $name, $encoded, $indent); + push @result, $self->value_to_xml($value, $name, $indent); } else { push @result, $indent, '<', $name, ">\n", - $self->value_to_xml($value, 'anon', $encoded, "$indent "), + $self->value_to_xml($value, 'anon', "$indent "), $indent, '</', $name, ">\n"; } } @@ -1194,6 +1197,9 @@ croak "Can't encode a value of type: " . ref($ref); } + + pop @{$self->{_ancestors}} if(ref($ref)); + return(join('', @result)); } @@ -2416,7 +2422,7 @@ =head1 STATUS -This version (2.02) is the current stable version. +This version (2.03) is the current stable version. =head1 SEE ALSO @@ -2428,7 +2434,7 @@ =head1 COPYRIGHT -Copyright 1999-2002 Grant McLean E<lt>gr...@cp...E<gt> +Copyright 1999-2003 Grant McLean E<lt>gr...@cp...E<gt> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
From: Grant M. <gr...@us...> - 2002-12-18 09:28:01
|
Update of /cvsroot/perl-xml/file-find-rule-xpath/lib/File/Find/Rule In directory sc8-pr-cvs1:/tmp/cvs-serv31819/lib/File/Find/Rule Modified Files: XPath.pm Log Message: - fixed POD typo Index: XPath.pm =================================================================== RCS file: /cvsroot/perl-xml/file-find-rule-xpath/lib/File/Find/Rule/XPath.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- XPath.pm 18 Dec 2002 09:21:18 -0000 1.1.1.1 +++ XPath.pm 18 Dec 2002 09:27:58 -0000 1.2 @@ -101,7 +101,7 @@ Matches XML files which contain one or more nodes matching the given XPath expression. Files which are not 'well formed' XML are silently skipped. -If not XPath expression is supplied, the value '/' is used. This will match +If no XPath expression is supplied, the value '/' is used. This will match all files which are well formed XML. =head1 AUTHOR |
From: Grant M. <gr...@us...> - 2002-12-18 09:21:22
|
Update of /cvsroot/perl-xml/file-find-rule-xpath In directory sc8-pr-cvs1:/tmp/cvs-serv29884 Log Message: File::Find::Rule::XPath Status: Vendor Tag: grantm Release Tags: start N file-find-rule-xpath/Changes N file-find-rule-xpath/Makefile.PL N file-find-rule-xpath/MANIFEST N file-find-rule-xpath/README N file-find-rule-xpath/t/0_config.t N file-find-rule-xpath/t/1_basics.t N file-find-rule-xpath/t/2_cleanup.t N file-find-rule-xpath/lib/File/Find/Rule/XPath.pm No conflicts created by this import ***** Bogus filespec: - Imported sources |
From: Grant M. <gr...@us...> - 2002-12-15 08:10:55
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv16667/t Modified Files: 1_XMLin.t Log Message: - bumped version number for release 2.02 Index: 1_XMLin.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/1_XMLin.t,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- 1_XMLin.t 11 Dec 2002 01:50:19 -0000 1.8 +++ 1_XMLin.t 15 Dec 2002 08:10:52 -0000 1.9 @@ -21,8 +21,8 @@ $@ = ''; eval "use XML::Simple;"; is($@, '', 'Module compiled OK'); -unless($XML::Simple::VERSION eq '2.01') { - diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.01)"); +unless($XML::Simple::VERSION eq '2.02') { + diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.02)"); } |
From: Grant M. <gr...@us...> - 2002-12-15 08:09:40
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv15629 Modified Files: Changes README Log Message: - for release 2.02 Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/Changes,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Changes 11 Dec 2002 01:54:05 -0000 1.6 +++ Changes 15 Dec 2002 08:09:37 -0000 1.7 @@ -1,5 +1,9 @@ Revision history for Perl module XML::Simple +2.02 Dec 15 2002 + - changed Storable calls to use locking (reported by Randal + Schwarz) + 2.01 Dec 11 2002 - fixed bug whereby :strict mode required forcearray on XMLout() (reported by Ville Skytta) Index: README =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/README,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- README 11 Dec 2002 01:54:05 -0000 1.6 +++ README 15 Dec 2002 08:09:37 -0000 1.7 @@ -56,13 +56,16 @@ STATUS - This version (2.01) is the current stable release. + This version (2.02) is the current stable release. Please send any feedback to the author: gr...@cp... NEW IN THIS RELEASE + - changed Storable calls to use locking + + New in Version 2.01: - fixed bug whereby :strict mode required forcearray on XMLout() New in Version 2.00: |
From: Grant M. <gr...@us...> - 2002-12-15 08:08:23
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv14572/lib/XML Modified Files: Simple.pm Log Message: - changed Storable calls to use locking Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Simple.pm 11 Dec 2002 01:50:19 -0000 1.8 +++ Simple.pm 15 Dec 2002 08:08:19 -0000 1.9 @@ -52,7 +52,7 @@ @ISA = qw(Exporter); @EXPORT = qw(XMLin XMLout); -$VERSION = '2.01'; +$VERSION = '2.02'; $PREFERRED_PARSER = undef; my $StrictMode = 0; @@ -343,7 +343,7 @@ require Storable; # We didn't need it until now - Storable::nstore($data, $cachefile); + Storable::lock_nstore($data, $cachefile); } @@ -369,7 +369,7 @@ require Storable; # We didn't need it until now } - return(Storable::retrieve($cachefile)); + return(Storable::lock_retrieve($cachefile)); } @@ -2416,7 +2416,7 @@ =head1 STATUS -This version (2.01) is the current stable version. +This version (2.02) is the current stable version. =head1 SEE ALSO |
From: Grant M. <gr...@us...> - 2002-12-11 01:54:08
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv2013 Modified Files: Changes README Log Message: - for 2.01 release Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/Changes,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Changes 8 Dec 2002 04:10:19 -0000 1.5 +++ Changes 11 Dec 2002 01:54:05 -0000 1.6 @@ -1,5 +1,9 @@ Revision history for Perl module XML::Simple +2.01 Dec 11 2002 + - fixed bug whereby :strict mode required forcearray on + XMLout() (reported by Ville Skytta) + 2.00 Dec 08 2002 - first production release with SAX support - added support for 'strict mode' using :strict import tag Index: README =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/README,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- README 8 Dec 2002 04:10:19 -0000 1.5 +++ README 11 Dec 2002 01:54:05 -0000 1.6 @@ -56,13 +56,16 @@ STATUS - This version (2.00) is the current stable release. + This version (2.01) is the current stable release. Please send any feedback to the author: gr...@cp... NEW IN THIS RELEASE + - fixed bug whereby :strict mode required forcearray on XMLout() + + New in Version 2.00: - First production release with SAX support - Added support for 'strict mode' to catch common mistakes - Removed locking code (as it was incompatible with iThreads) |
From: Grant M. <gr...@us...> - 2002-12-11 01:50:22
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv538/t Modified Files: 1_XMLin.t Log Message: - bumped version to 2.01 Index: 1_XMLin.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/1_XMLin.t,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- 1_XMLin.t 17 Oct 2002 08:44:33 -0000 1.7 +++ 1_XMLin.t 11 Dec 2002 01:50:19 -0000 1.8 @@ -21,8 +21,8 @@ $@ = ''; eval "use XML::Simple;"; is($@, '', 'Module compiled OK'); -unless($XML::Simple::VERSION eq '2.00') { - diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.00)"); +unless($XML::Simple::VERSION eq '2.01') { + diag("Warning: XML::Simple::VERSION = $XML::Simple::VERSION (expected 2.01)"); } |
From: Grant M. <gr...@us...> - 2002-12-11 01:50:22
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv538/lib/XML Modified Files: Simple.pm Log Message: - bumped version to 2.01 Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Simple.pm 11 Dec 2002 01:48:00 -0000 1.7 +++ Simple.pm 11 Dec 2002 01:50:19 -0000 1.8 @@ -2416,7 +2416,7 @@ =head1 STATUS -This version (2.00) is the current stable version. +This version (2.01) is the current stable version. =head1 SEE ALSO |
From: Grant M. <gr...@us...> - 2002-12-11 01:48:31
|
Update of /cvsroot/perl-xml/xml-simple/t In directory sc8-pr-cvs1:/tmp/cvs-serv32084/t Modified Files: 9_Strict.t Log Message: - more tests for :strict mode Index: 9_Strict.t =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/t/9_Strict.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- 9_Strict.t 17 Oct 2002 08:44:33 -0000 1.2 +++ 9_Strict.t 11 Dec 2002 01:48:28 -0000 1.3 @@ -4,7 +4,7 @@ use strict; use Test::More; -plan tests => 15; +plan tests => 37; ############################################################################## @@ -108,6 +108,202 @@ isnt($@, '', 'key attribute not a scalar was a fatal error'); like($@, qr/<item> element has non-scalar 'name' key attribute/, 'with the correct error message'); + + +############################################################################## +# Now confirm that XMLout gets checked too +# + + +# Check that the basic functionality still works under :strict + +my $ref = { + person => [ + { name => 'bob' }, + { name => 'kate' }, + ] +}; + +$@ = ''; +$xml = eval { + XMLout($ref, keyattr => {}, rootname => 'list'); +}; +is($@, '', 'XMLout() did not fail'); + +like($xml, qr{ + ^\s*<list\s*> + \s*<person\s+name="bob"\s*/> + \s*<person\s+name="kate"\s*/> + \s*</list\s*>\s*$ + }xs, 'and managed to produce the expected results'); + + +# Confirm that keyattr cannot be omitted + +eval { + XMLout($ref, rootname => 'list'); +}; + +isnt($@, '', 'omitting keyattr was a fatal error'); +like($@, qr/No value specified for 'keyattr'/, + 'with the correct error message'); + + +############################################################################## +# Now repeat all that using the OO syntax +############################################################################## + +# Check that the basic functionality still works + +$xml = q(<opt name1="value1" name2="value2"></opt>); + +my $xs = XML::Simple->new(forcearray => 1, keyattr => {}); + +$@ = ''; +my $opt = eval { + $xs->XMLin($xml); +}; +is($@, '', '$xs->XMLin() did not fail'); + +my $keys = join(' ', sort keys %$opt); + +is($keys, 'name1 name2', 'and managed to produce the expected results'); + +# Confirm that forcearray cannot be omitted + +$xs = XML::Simple->new(keyattr => {}); + +$@ = ''; +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'omitting forcearray was a fatal error'); +like($@, qr/No value specified for 'forcearray'/, + 'with the correct error message'); + + +# Confirm that keyattr cannot be omitted + +$xs = XML::Simple->new(forcearray => []); + +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'omitting keyattr was a fatal error'); +like($@, qr/No value specified for 'keyattr'/, + 'with the correct error message'); + + +# Confirm that element names from keyattr cannot be omitted from forcearray + +$xs = XML::Simple->new(keyattr => { part => 'partnum' }, forcearray => 0); + +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'omitting forcearray for elements in keyattr was a fatal error'); +like($@, qr/<part> set in keyattr but not in forcearray/, + 'with the correct error message'); + + +$xs = XML::Simple->new(keyattr => { part => 'partnum' }, forcearray => ['x','y']); + +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'omitting keyattr elements from forcearray was a fatal error'); +like($@, qr/<part> set in keyattr but not in forcearray/, + 'with the correct error message'); + + +# Confirm that missing key attributes are detected + +$xml = q( +<opt> + <part partnum="12345" desc="Thingy" /> + <part partnum="67890" desc="Wotsit" /> + <part desc="Fnurgle" /> +</opt> +); + +$xs = XML::Simple->new(keyattr => { part => 'partnum' }, forcearray => 1); +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'key attribute missing from names element was a fatal error'); +like($@, qr/<part> element has no 'partnum' key attribute/, + 'with the correct error message'); + + +# Confirm that stringification of references is trapped + +$xml = q( +<opt> + <item> + <name><firstname>Bob</firstname></name> + <age>21</age> + </item> +</opt> +); + +$xs = XML::Simple->new(keyattr => { item => 'name' }, forcearray => ['item']); + +eval { + $xs->XMLin($xml); +}; + +isnt($@, '', 'key attribute not a scalar was a fatal error'); +like($@, qr/<item> element has non-scalar 'name' key attribute/, + 'with the correct error message'); + + +############################################################################## +# Now confirm that XMLout gets checked too +# + + +# Check that the basic functionality still works under :strict + +$ref = { + person => [ + { name => 'bob' }, + { name => 'kate' }, + ] +}; + +$xs = XML::Simple->new(keyattr => {}, rootname => 'list'); + +$@ = ''; +$xml = eval { + $xs->XMLout($ref); +}; +is($@, '', 'XMLout() did not fail'); + +like($xml, qr{ + ^\s*<list\s*> + \s*<person\s+name="bob"\s*/> + \s*<person\s+name="kate"\s*/> + \s*</list\s*>\s*$ + }xs, 'and managed to produce the expected results'); + + +# Confirm that keyattr cannot be omitted + +$xs = XML::Simple->new(rootname => 'list'); + +eval { + $xs->XMLout($ref); +}; + +isnt($@, '', 'omitting keyattr was a fatal error'); +like($@, qr/No value specified for 'keyattr'/, + 'with the correct error message'); + exit(0); |
From: Grant M. <gr...@us...> - 2002-12-11 01:48:04
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv31874/lib/XML Modified Files: Simple.pm Log Message: - fixed bug whereby :strict mode required forcearray on XMLout() Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Simple.pm 8 Dec 2002 02:37:40 -0000 1.6 +++ Simple.pm 11 Dec 2002 01:48:00 -0000 1.7 @@ -52,7 +52,7 @@ @ISA = qw(Exporter); @EXPORT = qw(XMLin XMLout); -$VERSION = '2.00'; +$VERSION = '2.01'; $PREFERRED_PARSER = undef; my $StrictMode = 0; @@ -668,7 +668,7 @@ } } else { - if($StrictMode) { + if($StrictMode and $dirn eq 'in') { croak "No value specified for 'forcearray' option in call to XML$dirn()"; } $opt->{forcearray} = 0; |
From: Grant M. <gr...@us...> - 2002-12-08 04:10:22
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv13129 Modified Files: README Changes Log Message: - for 2.00 release Index: README =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/README,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- README 14 Feb 2002 21:37:04 -0000 1.4 +++ README 8 Dec 2002 04:10:19 -0000 1.5 @@ -3,27 +3,39 @@ XML::Simple - Easy API to read/write XML (esp config files) - ******* WARNING ******* WARNING ******* WARNING ******* WARNING ******* - - This release (1.08_01) is a beta release to allow the new SAX code to - be tested on as many platforms as possible. Please try it out if you - can and report success/failure to the author. - - For production systems, please use the latest stable release (1.08) - - ******* WARNING ******* WARNING ******* WARNING ******* WARNING ******* - - PREREQUISITES XML::Simple requires a module capable of parsing XML - either XML::SAX or XML::Parser must be installed (if you're running ActivePerl, you'll already have XML::Parser installed). + If you have installed XML::SAX, it will be used by default. You should + consider installing XML::SAX::Expat or XML::LibXML to replace the (slower) + PurePerl parser from the XML::SAX distribution. + To generate documents with namespaces, XML::NamespaceSupport is required. The optional caching features of XML::Simple also require Storable.pm. + Note: These prerequisites cannot be resolved automatically by CPAN.pm + since you must decide whether to use XML::Parser or XML::SAX. + + +WARNING MESSAGES FROM XML::SAX + + When you use XML::Simple, you may see this warning message: + + could not find ParserDetails.ini in C:/Perl/site/lib/XML/SAX + + This means your XML::SAX installation is broken (perhaps you installed + version 0.10 from the ActiveState PPM repository). Since it's broken + anyway, the simplest way to suppress these warnings is to remove + C:/Perl/site/lib/XML/SAX.pm. + + The procedure for correctly installing the latest version of XML::SAX + is documented here: + + http://perl-xml.sourceforge.net/faq/#win32_cpan BUILDING/INSTALLING @@ -44,41 +56,24 @@ STATUS - This version (1.08_01) is a beta release - to allow testing of the new - SAX code. If you encounter any problems installing or running this - release, please email the author the complete output of 'make test' - (even if your problem does not occur at this point). - - The current stable release is version 1.08. This version is - believed to be thread-safe. + This version (2.00) is the current stable release. Please send any feedback to the author: gr...@cp... NEW IN THIS RELEASE - - fixed errors with default namespace handling - - minor POD updates - - The following additional changes have been made since the last - stable release: + - First production release with SAX support + - Added support for 'strict mode' to catch common mistakes + - Removed locking code (as it was incompatible with iThreads) + - POD updates + - Added (updated) FAQ document to distribution - - added SAX support including: - + using SAX parsers - + acting as a SAX handler - + generating SAX events from XMLout() with new Handler option - + acting as a SAX filter (via new DataHandler option) - - added $ENV{XML_SIMPLE_PREFERRED_PARSER} and - $XML::Simple::PREFERRED_PARSER for selecting a parser module - - added namespace support (SAX only) with nsexpand option for both - XMLin() and XMLout() - - searchpath now defaults to current directory - - parseropts option now officially deprecated - - removed obselete 'convert' script from distribution - - many POD updates (more to come) + See 'Changes' for a detailed history. + See 'perldoc XML::Simple' for full documentation. - See 'Changes' for a detailed history. + See 'perldoc XML::Simple::FAQ' for frequently asked questions. COPYRIGHT Index: Changes =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/Changes,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Changes 14 Feb 2002 21:37:04 -0000 1.4 +++ Changes 8 Dec 2002 04:10:19 -0000 1.5 @@ -1,5 +1,18 @@ Revision history for Perl module XML::Simple +2.00 Dec 08 2002 + - first production release with SAX support + - added support for 'strict mode' using :strict import tag + - removed locking code (as it was incompatible with iThreads) + - integrated patch for test failures from Sean Campbell + - fixed stringification of references during folding (reported + by Trond Michelsen) + - fixed incompatability with Tie::IxHash (reported by + Venkataramana Mokkapati) + - POD: alphabetised options (patch from John Borwick) + - POD: updated suppressempty (patch from Kjetil Kjernsmo) + - added FAQ.pod to distribution and added new questions + 1.08_01 Feb 14 2002 - beta release for testing SAX support - fixed errors with default namespace handling - minor POD updates |
From: Grant M. <gr...@us...> - 2002-12-08 04:07:23
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv12392 Modified Files: Makefile.PL Log Message: - added dependency for Test::More Index: Makefile.PL =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/Makefile.PL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.PL 6 Nov 2002 08:00:07 -0000 1.4 +++ Makefile.PL 8 Dec 2002 04:06:30 -0000 1.5 @@ -63,6 +63,9 @@ 'NAME' => 'XML::Simple', 'VERSION_FROM' => 'lib/XML/Simple.pm', 'DISTNAME' => 'XML-Simple', + 'PREREQ_PM' => { + Test::Simple => 0.41, + }, 'dist' => { COMPRESS => 'gzip --best', SUFFIX => 'gz' }, ($] >= 5.005 ? ( 'AUTHOR' => 'Grant McLean <gr...@cp...>', |
From: Grant M. <gr...@us...> - 2002-12-08 02:41:17
|
Update of /cvsroot/perl-xml/xml-simple In directory sc8-pr-cvs1:/tmp/cvs-serv29069 Modified Files: maketest Log Message: - put back missing File::Spec Index: maketest =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/maketest,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- maketest 14 Feb 2002 21:35:35 -0000 1.2 +++ maketest 8 Dec 2002 02:41:14 -0000 1.3 @@ -8,6 +8,7 @@ ############################################################################# use strict; +use File::Spec; use Test::Harness qw(&runtests $verbose); $verbose = 0; |
From: Grant M. <gr...@us...> - 2002-12-08 02:37:43
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv28329/lib/XML Modified Files: Simple.pm Log Message: - replaced ref() eq ?? with UNIVERSAL::isa() Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Simple.pm 8 Dec 2002 02:35:05 -0000 1.5 +++ Simple.pm 8 Dec 2002 02:37:40 -0000 1.6 @@ -479,7 +479,7 @@ # Wrap top level arrayref in a hash - if(ref($ref) eq 'ARRAY') { + if(UNIVERSAL::isa($ref, 'ARRAY')) { $ref = { anon => $ref }; } @@ -497,7 +497,7 @@ # Ensure there are no top level attributes if we're not adding root elements elsif($self->{opt}->{rootname} eq '') { - if(ref($ref) eq 'HASH') { + if(UNIVERSAL::isa($ref, 'HASH')) { my $refsave = $ref; $ref = {}; foreach (keys(%$refsave)) { @@ -845,14 +845,14 @@ # Combine duplicate attributes into arrayref if required if(exists($attr->{$key})) { - if(ref($attr->{$key}) eq 'ARRAY') { + if(UNIVERSAL::isa($attr->{$key}, 'ARRAY')) { push(@{$attr->{$key}}, $val); } else { $attr->{$key} = [ $attr->{$key}, $val ]; } } - elsif(ref($val) eq 'ARRAY') { # Handle anonymous arrays + elsif(UNIVERSAL::isa($val, 'ARRAY')) { # Handle anonymous arrays $attr->{$key} = [ $val ]; } else { @@ -879,7 +879,7 @@ my $count = 0; if($self->{opt}->{keyattr}) { while(($key,$val) = each %$attr) { - if(ref($val) eq 'ARRAY') { + if(UNIVERSAL::isa($val, 'ARRAY')) { $attr->{$key} = $self->array_to_hash($key, $val); } $count++; @@ -889,7 +889,7 @@ # Fold hashes containing a single anonymous array up into just the array - if($count == 1 and ref($attr->{anon}) eq 'ARRAY') { + if($count == 1 and UNIVERSAL::isa($attr->{anon}, 'ARRAY')) { return($attr->{anon}); } @@ -934,7 +934,9 @@ return($arrayref) unless(exists($self->{opt}->{keyattr}->{$name})); ($key, $flag) = @{$self->{opt}->{keyattr}->{$name}}; for($i = 0; $i < @$arrayref; $i++) { - if(ref($arrayref->[$i]) eq 'HASH' and exists($arrayref->[$i]->{$key})) { + if(UNIVERSAL::isa($arrayref->[$i], 'HASH') and + exists($arrayref->[$i]->{$key}) + ) { $val = $arrayref->[$i]->{$key}; if(ref($val)) { if($StrictMode) { @@ -962,7 +964,7 @@ else { ELEMENT: for($i = 0; $i < @$arrayref; $i++) { - return($arrayref) unless(ref($arrayref->[$i]) eq 'HASH'); + return($arrayref) unless(UNIVERSAL::isa($arrayref->[$i], 'HASH')); foreach $key (@{$self->{opt}->{keyattr}}) { if(defined($arrayref->[$i]->{$key})) { @@ -1030,7 +1032,7 @@ # Unfold hash to array if possible - if(ref($ref) eq 'HASH' # It is a hash + if(UNIVERSAL::isa($ref, 'HASH') # It is a hash and %$ref # and it's not empty and $self->{opt}->{keyattr} # and folding is enabled and $indent # and its not the root element @@ -1045,7 +1047,7 @@ # Handle hashrefs - if(ref($ref) eq 'HASH') { + if(UNIVERSAL::isa($ref, 'HASH')) { # Scan for namespace declaration attributes @@ -1110,7 +1112,7 @@ push @result, $indent, '<', $name, $nsdecls; } - if(%$ref) { + if(keys %$ref) { while(($key, $value) = each(%$ref)) { next if(substr($key, 0, 1) eq '-'); if(!defined($value)) { @@ -1168,7 +1170,7 @@ # Handle arrayrefs - elsif(ref($ref) eq 'ARRAY') { + elsif(UNIVERSAL::isa($ref, 'ARRAY')) { foreach $value (@$ref) { if(!ref($value)) { push @result, @@ -1176,7 +1178,7 @@ ($self->{opt}->{noescape} ? $value : $self->escape_value($value)), '</', $name, ">\n"; } - elsif(ref($value) eq 'HASH') { + elsif(UNIVERSAL::isa($value, 'HASH')) { push @result, $self->value_to_xml($value, $name, $encoded, $indent); } else { @@ -1237,7 +1239,7 @@ foreach $key (keys(%$hashref)) { $value = $hashref->{$key}; - return($hashref) unless(ref($value) eq 'HASH'); + return($hashref) unless(UNIVERSAL::isa($value, 'HASH')); if(ref($self->{opt}->{keyattr}) eq 'HASH') { return($hashref) unless(defined($self->{opt}->{keyattr}->{$parent})); |
From: Grant M. <gr...@us...> - 2002-12-08 02:35:09
|
Update of /cvsroot/perl-xml/xml-simple/lib/XML In directory sc8-pr-cvs1:/tmp/cvs-serv27849/lib/XML Modified Files: Simple.pm Log Message: - POD updates (documented suppressempty for XMLout) Index: Simple.pm =================================================================== RCS file: /cvsroot/perl-xml/xml-simple/lib/XML/Simple.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Simple.pm 17 Oct 2002 08:56:18 -0000 1.4 +++ Simple.pm 8 Dec 2002 02:35:05 -0000 1.5 @@ -24,11 +24,13 @@ my $xml = $xs->XMLout($hashref [, <options>]); -Or to catch common errors: +(or see L<"SAX SUPPORT"> for 'the SAX way'). + +To catch common errors: use XML::Simple qw(:strict); -(or see L<"SAX SUPPORT"> for 'the SAX way'). +(see L<"STRICT MODE"> for more details). =cut @@ -1951,7 +1953,7 @@ will contain only the directory in which the script itself is located. Otherwise the default searchpath will be empty. -=item suppressempty => 1 | '' | undef (B<in>) (B<handy>) +=item suppressempty => 1 | '' | undef (B<in> + B<out>) (B<handy>) This option controls what C<XMLin()> should do with empty elements (no attributes and no content). The default behaviour is to represent them as @@ -1960,6 +1962,10 @@ string will cause empty elements to be represented as the undefined value or the empty string respectively. The latter two alternatives are a little easier to test for in your code than a hash with no keys. + +The option also controls what C<XMLout()> does with undefined values. +Setting the option to undef causes undefined values to be output as +empty elements (rather than empty attributes). =item xmldecl => 1 or xmldecl => 'string' (B<out>) (B<handy>) |
From: Christian G. <phi...@us...> - 2002-11-15 20:10:25
|
Update of /cvsroot/perl-xml/XML-LibXML-Common In directory usw-pr-cvs1:/tmp/cvs-serv11643 Modified Files: Common.pm Log Message: Modified Files: Common.pm + Version updates Index: Common.pm =================================================================== RCS file: /cvsroot/perl-xml/XML-LibXML-Common/Common.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Common.pm 21 Oct 2002 16:43:16 -0000 1.3 +++ Common.pm 15 Nov 2002 20:10:13 -0000 1.4 @@ -14,7 +14,7 @@ @ISA = qw(DynaLoader Exporter); -$VERSION = '0.11'; +$VERSION = '0.12'; bootstrap XML::LibXML::Common $VERSION; @@ -215,7 +215,7 @@ 1; #-------------------------------------------------------------------------# __END__ -#-------------------------------------------------------------------------# + =head1 NAME XML::LibXML::Common - Routines and Constants common for XML::LibXML and XML::GDOME |