Re: [xml] xmlValidNormalizeAttributeValue trouble

On Mon, Sep 29, 2003 at 07:59:18PM +0200, Petr Novak wrote:
I have trouble with xmlValidNormalizeAttributeValue. It returns me always
NULL (in older version of libxml2 it return something different, but it is
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...

  yes and ? Don't stop at the first block of a function.
  if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name);

maybe this should be

  yes and ? Don't stop at the first block of a function.
  if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  if (attrDecl == NULL)
      attrDecl = xmlGetDtdAttrDesc(doc->intSubset, elem->name, name);

  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.

  I would still like an reproduceable example.
    xmllint --valid should be able to show the problem with a correct source.

Anyway the attribute normalization has been reworked, it should be done
before teh attribute is passed to SAX. Anyway I would like an
example to reproduce the problem, in order to fix it.
  The bug reporting guidelines aren't that hard, I don't understand
why you prefer going through N round trip of mails instead of giving
upfront all the informations needed to reproduce and fix the problem...


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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