Re: Read/Write file, break lines at 256 (or more) but NOT elements

Michael Ludwig <[email protected]> Mon, 21 Mar 2011 19:34:39 +0100
Newsgroups gmane.comp.lang.perl.xml
Message-ID <20110321183439.GB3392@wladimir>
You replied off-list; please keep replies on-list.

Charlie Hanpru schrieb am 21.03.2011 um 07:49 (-0400):
>  
> I have thought about using XSLT but this Perl script is to run on a
> Un*x platform and IT won't install a XSLT processor like Saxon.

They can install libxml2 and the Perl interface.

> Can what I want be easily done with just Perl?

I'd say no: it seems to me that it's not worth the effort.

Michael

> > Date: Fri, 18 Mar 2011 21:47:09 +0100
> > From: [email protected]
> > To: [email protected]
> > Subject: Re: Read/Write file, break lines at 256 (or more) but NOT elements
> > 
> > Charlie Hanpru schrieb am 17.03.2011 um 08:55 (-0400):
> > > 
> > > I have Perl script that reads in a xml file. Adds carriage returns
> > > in fron of specific elements then write the results to a TMP file.
> > > The problem I am having is if there is a tag with multiple
> > > attributes it will get broken in the middle which I can't have.
> > > How do I break the lines at 256 characters (or more) but NOT a
> > > tag?
> > 
> > You're using a non-XML tool (Text::Wrap) to process XML.
> > 
> > To achieve what you want, use XSLT (@strip-space and @indent set),
> > call it from a Perl script where you register a hook to process the
> > text nodes and apply the formatting you want.
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs