Hi, Kapil.

Kapil <[EMAIL PROTECTED]> wrote on 2007-08-13 10:18:58 AM:
> Am converting HTML to XML using XALAN tranformer. The HTML contains 
element
> having attribute value with white spaces, for example
> <span attr1="There is double  space here">
> The attr1 value contains two white spaces. When I convert this to XML 
using
> XSLT, the extra white space is stripped. . How can I preserve extra
> whitespaces for attribute value for all elements. The white spaces are
> preserved if I do the tranformation using XML Spy.

Is your input HTML or XHTML?  If it's HTML, in what form are you getting 
the input to the Xalan?

Is the attribute name here really attr1 or is that just an example?  I'm 
just speculating that the attribute-value normalization rules of XML might 
be getting applied; the declared type of an attribute would have an 
impact.  According to section 3.3.3 of the XML Recommendation,[1] "If the 
attribute type is not CDATA, then the XML processor MUST further process 
the normalized attribute value by discarding any leading and trailing 
space (#x20) characters, and by replacing sequences of space (#x20) 
characters by a single space (#x20) character."

Thanks,

Henry
[1] http://www.w3.org/TR/2006/REC-xml-20060816/#AVNormalize
------------------------------------------------------------------
Henry Zongaro      XSLT Processors Development
IBM SWS Toronto Lab   T/L 969-6044;  Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]

Reply via email to