[Gambas-user] Problem with Conv() and XmlWrite

Ron_1st ronstk at ...239...
Tue Dec 23 02:48:44 CET 2008


On Monday 22 December 2008, Luigi Carlotto wrote:
> sType="ACTION,ADD,ALL,ALTER,ANALYZE,AND,AS,ASC,ASENSITIVE,BEFORE,BETWEEN,BIGINT,BINARY,BIT,BLOB,BOTH,BY,CALL,CASCADE,CASE,CHANGE,CHAR,CHARACTER,CHECK,COLLATE,COLUMN,CONDITION,CONNECTION,CONSTRAINT,CONTINUE,CONVERT,CREATE,CROSS,CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,CURSOR DATABASE,DATABASES,DATE,DAY_HOUR,DAY_MICROSECOND,DAY_MINUTE,DAY_SECOND,DEC,DECIMAL,DECLARE,DEFAULT,DELAYED,DELETE,DESC,DESCRIBE,DETERMINISTIC,DISTINCT,DISTINCTROW,DIV,DOUBLE,DROP,DUAL,EACH,ELSE,ELSEIF,ENCLOSED,ENUM,ESCAPED,EXISTS,EXIT,EXPLAIN,FALSE,FETCH,FLOAT,FLOAT4,FLOAT8,FOR,FORCE,FOREIGN,FROM,FULLTEXT,GOTO,GRANT,GROUP,HAVING,HIGH_PRIORITY,HOUR_MICROSECOND,HOUR_MINUTE,HOUR_SECOND,IF,IGNORE,IN,INDEX,INFILE,INNER,INOUT,INSENSITIVE,INSERT,INT,INT1,INT2,INT3,INT4,INT8,INTEGER,INTERVAL,INTO,IS,ITERATE,JOIN,KEY,KEYS,KILL,LABEL,LEADING,LEAVE,LEFT,LIKE,LIMIT,LINES,LOAD,LOCALTIME,LOCALTIMESTAMP,LOCK,LONG,LONGBLOB,LONGTEXT,LOOP,LOW_PRIORITY,MATCH,MEDIUMBLOB,MEDIUMINT,MEDIUMTEXT,MIDDLEINT,MINUTE_MICROSECOND,MINUTE_SECOND,MOD,MODIFIES,NATURALNOT,NO,NO_WRITE_TO_BINLOG,NULL NUMERIC,ON,OPTIMIZE,OPTION,OPTIONALLY,OR,ORDER,OUT,OUTER,OUTFILE,PRECISION,PRIMARY,PROCEDURE,PURGE,READ,READS,REAL,REFERENCES,REGEXP,RELEASE,RENAME,REPEAT,REPLACE,REQUIRE,RESTRICT,RETURN,REVOKE,RIGHT,RLIKE,SCHEMA,SCHEMAS,SECOND_MICROSECOND,SELECT,SENSITIVE,SEPARATOR,SET,SHOW,SMALLINT,SONAME,SPATIAL,SPECIFIC,SQL,SQLEXCEPTION,SQLSTATE,SQLWARNING,SQL_BIG_RESULT,SQL_CALC_FOUND_ROWS,SQL_SMALL_RESULT,SSL STARTING,STRAIGHT_JOIN,TABLE TERMINATED,TEXT,THEN,TIME,TIMESTAMP,TINYBLOB,TINYINT,TINYTEXT,TO,TRAILING,TRIGGER,TRUE,UNDO,UNION,UNIQUE,UNLOCK,UNSIGNED,UPDATE,UPGRADE,USAGE,USE,USING,UTC_DATE,UTC_TIME,UTC_TIMESTAMP,VALUES,VARBINARY,VARCHAR,VARCHARACTER,VARYING,WHEN,WHERE,WHILE,WITH,WRITE,XOR,YEAR_MONTH,ZEROFILL"
> Error: Error writing XML data
> Code: -1
> Class: pgConfig
> Where: pgConfig.Save.154
> 


I see something where the wrong characters may be at the end of following lines.
First line:
	...CURSOR,CURSOR
DATABASE,

Second line:
	...,NO,NO_WRITE_TO_BINLOG,NULL
NUMERIC,ON,OPTIMIZE

Third line:
	...,SQL_SMALL_RESULT,SSL
NUMERIC,ON,

Forth line:
	...STRAIGHT_JOIN,TABLE
TERMINATED,TEXT,

In fact all items are comma seperated but a few does have a space in them. that is the reason they
are spread to several lines.
I sayd  a _space_ because it looks like that by wrapping on it.
It does not make sence to me to use spaces inside the items as the others are a continues string of
several word parts, like TINYINT and TIMESTAMP, why should 'TABLETERMINATED' split to 'TABLE TERMINAED' ?

I suggest to write a routine to show the ASCII number of all characters in the sType string to
see discrepancies in it and look carefull to the space alikes positions.
This way I would try to find why it goes wrong.


Beside of this problem I think you do something wrong here. (just personal feeling)

Beside of that it looks to me strange to have attributes with such long/big-size values.
The words in the sType string are data and should be inside elements and not 
in the element declaration itself as attribute who are telling about those 
embeded elements and/or the properties about the element itself.


<mytag stype="ACTION,ADD,..."> is IMHO fault

It should be declared as element object, attributes tells something about how to
see/handle/interpret information inside the tag and not be the data itself as sType is here.

<mytag charset="ascii">
  <stypes>
    <stype>ACTION</stype>
    <stype>ADD</stype>
    ....
  </stypes>
</mytag>

Just to clearout in html you do this

<ul charset="ascii" type="ACTION,ADD,...">
  <li>Keywords available</li>
</ul>

but mean

<ul charset="ascii">
  <li>ACTION</li>
  <li>ADD</li>
  ....
</ul>

I know this is not the best example, for the TAG input you can have value="ACTION,ADD"
but those elements are part of the FORM tag and are/have special(s) usage.
I should have used DT and DD (definition) tags instead the list tags.
As sayd before it is just a personal feeling, you circumstance can be compleet different.

Best regards,

Ron_1st

-- 




More information about the User mailing list