Re: [xml] xmlschemastypes.c:1755 - supporting "Name"



So, perhaps, my real issue is the use of TODO. It seems like there is
little utility in implementing the required change. I don't need it and
it doesn't look like anyone else is going to need it for a while. So,
why should I be _forced_ to accept the output generated by TODO in all
my programs that use libxml2?

In xmlschemastypes.c the TODO macro is defined as generating an
xmlGenericError. There's no way to turn this off.  I also noticed this
in xmlReader.c and elsewhere. Is there some good reason for this? I
would like a configuration option that says "don't generate TODO errors"
which would cause the TODO macros to be null defined.

There are probably many "TODO" items that really should always generate
an error, but in this particular case, the right thing to do would be to
just ignore it since the validation succeeds.  Perhaps what we need is a
FIXME macro that works similarly to TODO but is used in cases where a
partial implementation is provided (as in this case)?

I can implement this and provide patches but just wanted to be sure that
I'm not (a) missing something or (b) about to break some golden rule of
the project.

Please advise.

Reid.

On Fri, 2004-01-02 at 12:33, Daniel Veillard wrote:
On Fri, Jan 02, 2004 at 11:08:09AM -0800, Reid Spencer wrote:
There is a "TODO" block on this line in support of the XML Schema
lexical space "Name". I'm trying to figure out what remains to be done
here. I would like to finish this implementation off but can't figure
out from the code what remains to be checked. The code looks like:

        case XML_SCHEMAS_NAME:
            ret = xmlValidateName(value, 1);
            if ((ret == 0) && (val != NULL)) {
                TODO;
            }
            goto done;
 

A zero result from xmlValidateName means the "value" validated as a
"Name". I'm not sure what needs to be done if "(val != NULL)". 

  if val != NULL, then this mean that the value should be stored,
i.e. the value from the value space should be stored in val. The problem
is that 1/ it's dependant on whitespace normalization 2/ one would
need to check that deallocation is done if needed 3/ this is not used
yet because the current code does not store PSVI values in the tree
(there is now placeholders, but I didn't had the need yet for this).
  In a nutshell, this part is unlikely to be used by any existing
code, but this would have to be done once PSVI stuff gets stored.

Daniel

Attachment: signature.asc
Description: This is a digitally signed message part



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