[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
Gephi forums •[SOLVED] xmlns:xsi and xsi:schemaLocation are valid xml ?
Page 1 of 1

[SOLVED] xmlns:xsi and xsi:schemaLocation are valid xml ?

Posted: 02 Apr 2010 12:41
by paul
I am using the lxml 2.0 library in Ptyhon to generate gexf.
This library returns warning when declaring both attributes containing a semicolon :
/home/pom/trunk/gexf.py:33: TagNameWarning: Tag names must not contain ':', lxml 2.0 will enforce well-formed tag names as required by the XML specification.
gexfXML.set("xmlns:xsi",self.xsi)
/home/pom/trunk/gexf.py:34: TagNameWarning: Tag names must not contain ':', lxml 2.0 will enforce well-formed tag names as required by the XML specification.
gexfXML.set("xsi:schemaLocation",self.schemaLocation)
It's not a big deal since only a warning but it claims it not correct regarding XMl specification which I don't know.

Paul

Re: xmlns:xsi and xsi:schemaLocation are valid xml ?

Posted: 02 Apr 2010 13:20
by admin
This is incredible, but I discovered that xsi:schemaLocation make the XML file invalid. You can browse the Web to find the exact reason of this issue, but it seems to be something the consortium who made the specifications have just...forgotten. Remove this line to hide this warning.

Re: xmlns:xsi and xsi:schemaLocation are valid xml ?

Posted: 12 May 2010 11:34
by paul
Actually I just discovered the notion of namespace in xml.

For people using lxml and python here is hte right way to write the gexf tag :

Code: Select all

xmlns="http://www.gephi.org/gexf/1.1draft"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemaLocation="http://www.gephi.org/gexf/1.1draft http://gephi.org/gexf/1.1draft.xsd"
viz="http://www.gexf.net/1.1draft/viz"
version="1.1"
gexfXML = etree.Element("{"+xmlns+"}gexf",version=version,nsmap={None:xmlns,'viz':viz,'xsi':xsi})
gexfXML.set("{xsi}schemaLocation",schemaLocation)
I am still working on a libgexf pure python. I will release it soon and post a topic in the forum.

P