I use SSAX-SXML to work with a tree structure that simply mimics the encoding of XML data. So I decided to use the SXML view directly as a data structure for the job. Everything works very well, and I get all the functionality of the default accessories and XPath, which I found very useful.
But I have a problem. XML represents everything as strings, so I need to constantly convert from string to numbers and vice versa. It will kill productivity and just a bad design idea. I was thinking of taking an SXML list and converting all the strings to numbers in one pass. But is there a way that SXML directly or in some way communicates via XML that something should be represented as a number, not a string?
This is my SXML list:
((wall (@ (uid "2387058723")) (pt (@ (y "2.0") (x "1.0"))) (pt (@ (y "4.0") (x "3.0")))) (wall (@ (uid "5493820876")) (pt (@ (y "0.0") (x "0.0"))) (pt (@ (y "100.0") (x "0.0"))) (window (@ (to "0.4") (from "0.2"))) (window (@ (size "1.0") (from "0.2"))) (door (@ (size "1.0") (from "0.2")))) (pilar (@ (uid "692034802")) (center (@ (y "5.0") (x "5.0"))) (dim (@ (b "0.45") (a "0.3")))) (room (@ (label "salon")) (wall (@ (uid "2387058723"))) (wall (@ (uid "5493820876"))) (wall (@ (uid "5394501263"))) (wall (@ (uid "0034923049")))) (entry (@ (doorNumber "0")) (wall (@ (uid "5493820876")))) (num "0,9") (pipe (@ (y "8.0") (x "10.0"))))
From an XML that looks like this (extract):
<wall uid="2387058723"> <pt x="1.0" y="2.0"/> <pt x="3.0" y="4.0"/> </wall>
Thanks.
xml scheme
alvatar
source share