From: Shaun M. <sh...@gn...> - 2004-10-13 05:02:31
|
On Tue, 2004-10-12 at 19:00 -0400, Mikhail S Grushinskiy wrote: > It looks like it is normal behaviour. > Line breaks within attribute values are replaced by spaces by correct XML > parser. > If you want to have attribute values with line breaks you have to encode > line breaks > in original input XML. for example > > I would say it is a bug in the application which creates your XML. Quite right. See section 3.3.3 of the recommendation: http://www.w3.org/TR/2004/REC-xml-20040204/#AVNormalize > >i am trying to use the xmlstarlet to delete some of the nodes from an xml > >file. > > there are some attributes containing cr-lf s .(something like : > > <doc><element name="test > > 123" /></doc> > > ) > > this is required because the attribute contains a piece of vb code. > > the attributes are not deleted, but the CR-LF pair is lost. > > Is this a bug, or is there a parameter i can use to avoid this problem ? Daniel, any application that requires content like this in an attribute value is poorly designed. Attribute values are not content, and should never be treated as such. The alt attribute on the img element in HTML is an excellent example of what you should never do with attributes. -- Shaun |