Re: [xml] How to disable Attribute value normalization





Daniel Veillard wrote:
On Fri, Sep 06, 2002 at 09:16:17AM +0800, Mike Lei wrote:
  
Hi,
I want to keep all content of attribute value untouched so that my
application can interpret it other way . How can I do that ? it seems
xmlBlanksDefaut(1) only work for content of element node . If I retrieve
the attribute value by xmlGetProp, I get the normalized result . How can
I get the raw information ?
    

  Well, you can't ... The XML specification is quite clear:

  http://www.w3.org/TR/REC-xml#AVNormalize

"Before the value of an attribute is passed to the application or checked
 for validity, the XML processor must normalize the attribute value by
 applying the algorithm below, or by using some other method such that
 the value passed to the application is the same as that produced by
 the algorithm."

 It's a MUST, not subject to user option.
Thank you ! I know it.  But if element content can avoid normalizing,  why attribute value cannot ?  It seems unreasonable and not symmetric.  In some case , it's better if element content is used as attribute value or vice verse without any data loss.

Regards,
Mike


  What it probably means is that you decided to put in attribute text
which should really go into element content, because all compliant XML
parser will have to do the exact same modification of the character string
before passing it to the application.

Daniel

  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]