Re: [xml] xmlValidNormalizeAttributeValue trouble



I have trouble with xmlValidNormalizeAttributeValue. It returns me always
NULL (in older version of libxml2 it return something different, but it is
"nothing").
I take a look at libxml2 valid source code and it looks, that this function
works only if namespace is defined. Is it true? I don't find anybody about 
this in API documentation.

I had not time to read all sources but in valid.c is:

if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {

I thought that it pertinents to namespaces...


  namespace ?

I thing that now may be "New_Value" in newValue variable, but there is NULL.
What is wrong?

I used non-valid attribute value too, but it returns NULL too. For example
"newline" character(s) as a CR, LF or CRLF may be compensated by space.
Tabulators and other whitespace characters too.  Byt if I try set value to 
(for example): "a\nb\t\t\nc", it returns NULL too. This value is not valid.


  You didn't read the doc

 * returns a new normalized string if normalization is needed, NULL otherwise
 *      the caller must free the returned value.

 "if normalization is needed" ... your value is already normalized !

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

-- 

Petr Novak, Liberouter Project (www.liberouter.org)
E-mail: novak merlot ics muni cz




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