On Tue, Jul 13, 2010 at 10:49 AM, Barih Uri <[email protected]> wrote:
> > *Hi Sawyer * > Hi. > > THX allot for your excellent answer > No problem. :) > > Another little remark > > Now I get: > > *Document:** * > *<?xml** **version="1.0"?>* > *<books>* > *<computer/>* > *</books>* > > Actually I not need the title "*<?xml** **version="1.0"?>*" > XML's should generally have a version number, though I understand you want to strip it. Personally I don't work with XMLs much so I have no experience with XML::LibXML so I don't know how to do that. I've gone over the source (the Pure Perl and the XS) and it seems as though the version is added automatically and cannot be configured. I looked for a stripping function or some way to stringify it so does not contain the version, but alas, could not find it. Perhaps someone else on the list with more experience and knowledge in this field could advise better. Since ->toString returns the xml version on the first line with a line feed (\n), you can simply strip the first line off. ---- my @lines = split /\n/, $doc->toString; shift @lines; my $stripped_doc = join "\n", @lines; print "Document:\n$stripped_doc\n"; ----
_______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
