Problems with elements.xml

View: New views
3 Messages — Rating Filter:   Alert me  

Problems with elements.xml

by Bugzilla from hdevalence@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm working on a little personal project (basically, a printed periodic table
of the elements on some large A size, like A1 or A2) that involves the use of
data on chemical elements.

However when I try to use the XML file in either python, using pyxml, or in
ruby, using xmlsimple, I get errors.
When I try this python script:

import sys
from xml.dom.ext.reader import Sax2
from xml.dom.ext import *

reader = Sax2.Reader()
inputfile = open("elements.xml")
doc = reader.fromStream( inputfile )

PrettyPrint( doc, sys.stdout )

I get an "xml.dom.NamespaceErr: Invalid or illegal namespace operation", and
when I try this ruby script:

require 'rubygems'
require 'xmlsimple'
data = XmlSimple.xml_in( 'elements.xml', { 'KeyAttr' => 'name' } ) #line 5
print data

I get this output: http://pastebin.ca/1415981

Also, running xmllint --valid gives:
elements.xml:15: validity error : Validation failed: no DTD found !
                     http://bibtexml.sf.net/       ../schemas/bibtexml.xsd"

Is this a problem with the XML file itself or am I just doing something wrong?

Thanks in advance,
Henry de Valence
_______________________________________________
Kalzium mailing list
Kalzium@...
https://mail.kde.org/mailman/listinfo/kalzium

Re: Problems with elements.xml

by Carsten Niehaus-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Am Donnerstag, den 07.05.2009, 23:28 -0400 schrieb Henry de Valence:
> I'm working on a little personal project (basically, a printed periodic table
> of the elements on some large A size, like A1 or A2) that involves the use of
> data on chemical elements.
>
> However when I try to use the XML file in either python, using pyxml, or in
> ruby, using xmlsimple, I get errors.

<snip>

May I ask you to download

http://sourceforge.net/project/showfiles.php?group_id=189199

and try again?

Kalzium is using a local copy of those files. If it doesn't work with
that download it is a bug that I will take care of.

Please report back.


By the way: Posterprinting sounds cool and could be integrated in
Kalzium itself!

Carsten


_______________________________________________
Kalzium mailing list
Kalzium@...
https://mail.kde.org/mailman/listinfo/kalzium

signature.asc (204 bytes) Download Attachment

Re: Problems with elements.xml

by Bugzilla from hdevalence@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri May 8 2009 4:42:28 am Carsten Niehaus wrote:

> Am Donnerstag, den 07.05.2009, 23:28 -0400 schrieb Henry de Valence:
> > I'm working on a little personal project (basically, a printed periodic
> > table of the elements on some large A size, like A1 or A2) that involves
> > the use of data on chemical elements.
> >
> > However when I try to use the XML file in either python, using pyxml, or
> > in ruby, using xmlsimple, I get errors.
>
> <snip>
>
> May I ask you to download
>
> http://sourceforge.net/project/showfiles.php?group_id=189199
>
> and try again?
>
> Kalzium is using a local copy of those files. If it doesn't work with
> that download it is a bug that I will take care of.
>
> Please report back.
>
>
> By the way: Posterprinting sounds cool and could be integrated in
> Kalzium itself!
>
> Carsten

I get the same error using that download.
By the way, is it possible to extract from one of those files (I looked in
isotopes.xml but didn't see what I was looking for) the number of stable
isotopes and the number of naturally occurring isotopes? It seems as though
stable isotopes are indicated with half-life of -1, but I didn't see something
indicating natural occurrence.

Henry de Valence

P.S. With regard to the posterprinting, I'm not sure if it would really be
workable to integrate into Kalzium; basically my process is as follows:
1. Create one item as an SVG file in Inkscape (I'm using Uuq, since it has a
long name, so if the text fits for Uuq, it's likely to fit for the other
elements)
2. Replace all the text with easily-distinguishable placeholders (e.g. SYMB,
ELEMENT_NAME, ATM_NUM etc)
3. Use some script which I have yet to write to fill in the data and place all
the boxes
4. Combine in Inkscape and add stuff like title, legend, etc

Basically I am using a script to do the easy stuff and do the hard stuff
(design) in Inkscape. So I don't know how one would add that to Kalzium.
_______________________________________________
Kalzium mailing list
Kalzium@...
https://mail.kde.org/mailman/listinfo/kalzium