By genome - Thursday, April 7, 2005
|
From Topic6403-59-1.aspx#1335
I was interested in this discussion on VBScript to convert the xml to svg and followed the instructions ie: made text box, downloaded the two files vbs and xsl, renamed my xml file to match after down loading the viewer but on clicking on the vbs I get an error :- Script: C:\Complete Family Trees\complete tree\test\gnoxml2svg.vbs Line: 7 Char: 1 Error: Object required: 'xml' Code : 800A01A8 Source: Microsoft VBScript runtime error I am obviously missing something, but as I am a bit of a novice in this stuff I've got a bit lost. Any ideas where I went wrong.
Sorry Iain, I haven't tested the VBScript for some time (I use msxsl.exe) and you've found the line I slipped in without testing! (slapped wrist :oops: ) Change line 7 fromxml.preserveWhiteSpace = false | to xsltTree.preserveWhiteSpace = false | . I'll update web page shortly.
P.S. you will also need the 'gzipped' Ecmascript file (gnoxml2svg.esz) that can also be downloaded from my tools page.
|
By maru-san - Thursday, August 18, 2005
|
First of all thanks to Ron for providing these tools.
Have successfully created a svg file from xml. Unfortunately it stopps opening half way. I can see the frame, the text lines below and above, but inside nothing, since it stopps there. Will your tool work only for Windows XP? I have ME. First I thought it could be because of the viewer version 3.0. I changed to 6.0, same result. Or because of japanese characters (vertical) for some persons?
When selecting a genomap receive following message:
svgdoc.getElementByld(...)* is null or not an object
line: 111, column 15
In another instance the line was 115 and column 8
Checked these lines, but they are empty lines.
|
By genome - Thursday, August 18, 2005
|
When selecting a genomap receive following message:
svgdoc.getElementByld(...)* is null or not an object line: 111, column 15 |
The line numbers refer to the Ecma/Javascript gnoxml2svg.es(z). This error one line 115 generally occurs when you have not added the bounding text label box to your GenoMap, as described in http://myweb.tiscali.co.uk/ronsweb/genealogy/tools.htm#tool4 or when the ONLY text within it is not EXACTLY the same as the GenoMap name. Please double check and let me know the result. The xsl gets a list of the GenoMaps and then looks for Labels to size the initial zoom. If no matching label is found then no SVG objects will be generated for that map.
The inner frame will be empty until a valid map is selected. Selecting an invalid map will stop other valid ones from being selected subsequently, as the script then tries to hide the missing invalid map and fails with the error on line 111.
I'll see if I can trap these errors in the next version to give a more meaningful error message.
If you manage to get a valid SVG file, it should display in IE with an Adobe SVG plug-in on any Windows OS or even Apple MAC.
|
By maru-san - Thursday, August 18, 2005
|
Thanks for your prompt reply. Followed the instructions this time properly and received the result I wanted. The svg file shows up.
In order to make this tool universal the font needs to be a valid unicode, since in my case I have a mixture of german and japanese names. Is this too much to ask for? The german names horizontal, the japanese vertical. Sorry for asking.
|
By GenoProSupport - Thursday, August 18, 2005
|
Good news for all of you. This morning, I added a new tag named "boundary_rect". All you have to do is open your genealogy tree and visit each GenoMap once. GenoPro computes the boundary rectangle before displaying the GenoMap, so I am using this trick to update "boundary_rect" tag. Then save (or export) your family tree to have the "boundary_rect" tag will be written to the XML file. Here is a sample code of the "boundary_rect" tag:
<GenoMap name="GenoMap1" zoom="80" position="-1047,671" boundary_rect="(-2023,1933),(244,202)"/> |
This fix will be available in Beta 13 8)
|
By genome - Thursday, August 18, 2005
|
Thanks for sorting that so quickly Dan, but see also below. I'll change my XSL to use it once I can get my hands on Beta 13.
maru-san, 1st the good news: yes displaying other language characters wasn't a problem, I just switched font-family to 'Arial Unicode MS'. I have updated the download page. Let me know if you find differently.
And now the bad news: Vertical text is a problem at present because the GenoPro beta XML files don't indicate the text direction! This can be shown by opening your .xml files in GenoPro instead of the .gno ones. You will notice all vertical text reverts to horizontal.
So a request to Dan for another SVG fix in Beta 13: Can you put a text direction attribute or element in the .xml file as well as in the .gno if vertical text is ticked?
|
By GenoProSupport - Thursday, August 18, 2005
|
And now the bad news: Vertical text is a problem at present because the GenoPro beta XML files don't indicate the text direction! Thanks for finding this bug. I added the vertical text as last minute feature in Beta12g and forgot to update the code in the XML import/export module. The fix will be in Beta 13 too.
The flag for vertical text can be found under the letter v in the enable attribute.
<Individual id="ind00001"> <name>Daniel Morin <display lines="1" format="%F">Daniel</display> <first>Daniel</first> <last>Morin</last> </name> <position size="X">-280,-160</position> <display> <flags enable="v" /> </display> <gender>M</gender> </Individual>
|
The enable attribute can have multiple flags. For instance the <flags enable="bpv" /> means border aroud the object, pregnancy symbol and vertical text.
|
By maru-san - Thursday, August 18, 2005
|
Have created a svg file with 4 genomaps, linked via hyperlinks.
Realized a similar problem on some persons as mentioned under Printing a GenoGram to a virtual PDF printer.Since this is apparently a problem of genopro, I will mention it here, however I am not quite sure whether Dan will accept to test something, which was not created by GenoPro in this forum, since there are more items which needs to be modified and tested in the tools made by Ron. This is especially true since Ron is offering his tools for other GenoPro users as well. I have tried some of them and I think he is on the right pass, but they should be coordinated by GenoPro in order to get the full potential out of GenoPro. Ron, if you like to have my additonal comments, please let me know. I like to help.
|
By GenoProSupport - Thursday, August 18, 2005
|
I don't mind people creating tools and making money if they can. I am very willing to add features to GenoPro to make it easy for users to develop tools, however I don't want to spend too much time testing other's tools. As for testing those tools, my time is limited as I want to finish GenoPro 2.0 :!:.
|
By genome - Thursday, August 18, 2005
|
I am happy to receive any comments, complimentary, constructive or critical. So thanks for letting me know of the problem.
The problem you describe, that of pedigree lines appearing under text associated with an individual, is not, in my opinion, a problem or bug in GenoPro. GenoPro defines a pedigree line that terminates at the centre of the gender symbol, which I believe is the correct way to do it. Any text that overlays these lines should obscure these lines. The generated SVG uses a couple of techniques, one being a flood filter suggested by 'honyk' of this forum, to achieve this. I thought this was working correctly now. If you can send an example SVG to the email address at the bottom of my tools page, I will see if I can fix it.
My original purpose in writing these VBScripts was to achieve more compatiblilty in the Gedcom export to allow better interworking with other packages. Dan has his own ideas on this which did not match my requirements hence the gnoxml2ged.vbs script.
I then started thinking about how to present my family tree on the web and when SVG was mentioned here I took up the challenge. By the way, I liked your use of 'zoomify' on your website, Maru-san, to add pictures to the genograms. I believe Dan is going to add a facility to have images on GenoMaps in the future. However in the mean time I am going to look into the possiblity of using text Labels to define image areas with the text specifying the GenoPro picture elements to use in the SVG.
In bringing my scripts to this forum my intention is to make them available to all who want to try them and to get feedback to improve their usefulness. So in a way their develoment is 'coordinated' by this GenoPro forum.
I am concious of the fact that we are all waiting for the full release of GenoPro 2.0. Dan has hectic timetable to get the things he wants implemented. I would not want his timetable to slip due to side issues such as my tools. Dan's decision to use XML gives GenoPro tremendous flexibility, as he has hinted at with the new report writer. I am also taking advantage of that flexibility.
|
By IainTait - Thursday, August 18, 2005
|
From Sorry Iain, I haven't tested the VBScript for some time (I use msxsl.exe) and you've found the line I slipped in without testing! (slapped wrist :oops: ) Change line 7 from xml.preserveWhiteSpace = false |
to xsltTree.preserveWhiteSpace = false |
. I'll update web page shortly. P.S. you will also need the 'gzipped' Ecmascript file (gnoxml2svg.esz) that can also be downloaded from my tools page.
I did as you suggested and the svg was created like an html and opens with Internet Explorer. I tried first with the whole tree (4000 names) without success and then with a very small test tree with the same results. When I open the .svg , after a delay I get the bottom line with aclnowledgements, the top bar with select map etc and the beginnings of a smaller box on the right top corner, but then nothing else happens and no image appears. So it appears that there is still a problem somewhere and I don't know how to use the .exe that you said you use. I opened your demo and found the idea very usefull as the tree becomes visible without having Genopro installed. I still a bit lost!
|
By genome - Thursday, August 18, 2005
|
Firstly, the SVG generated by my XSL translation will probably not handle as many as 4000 names in one GenoMap. I find it best to break the tree down into smaller GenoMaps, joined by hyperlinks. I tend to break mine down such that each GenoMap is readable when printed on a single landscape A4 page. This size also suits the SVG files, as the names are just readable without having to zoom in. The SVG viewer may still be quite slow with that many individuals in one file. I will be looking at a way to implement GenoPro's external hyperlink facility so that more one than one file can be used with hyperlinks between them.
Secondly I notice Adobe SVG Viewer 6 is more particular over errors in the SVG, and can end up with a window much as you describe when errors are present. Using Adobe version 3 will probably allow you to view the GenoMap, but note no image will appear with either ASV3 or ASV6 until you select a GenoMap. There is a batch file available that allows switching between SVG viewers here http://www.carto.net/papers/svg/utils/SVGSwitch.shtml.
I still will need to determine what the error is. I know there was a problem if your GenoPro file has borders around individuals with a transparent fill. I have posted an updated xsl file on my site that corrects this. If you still have problems let me know. (you can e-mail me at the address at the bottom of the tools page)
|
By IainTait - Thursday, August 18, 2005
|
I did have boxes round the people even on the small test tree so I removed them , but still get the same result with this very small tree. As for trying Perl!- This is getting too complicated and I wouldn't know where to begin and what to do to to get this svg switcher. I went to the link but was non the wiser. I am into family trees and web sites and can find my way round html more or less, have managed to personalise the php for the message forum on my site with some difficulty.(no one has ever used it!) and I can get my head round some java script as long as it is a case of copy-paste. but I need to learn to walk before I can gallop! I am way out of my depth but would like to learn to swim! My site is at http://www.beath.net/tree/index.htm and there you can see my amateur efforts!
|
By genome - Thursday, August 18, 2005
|
If you are getting the same incomplete display with a simple tree I suggest the reason is you have not downloaded the ecmascript gnoxml2svg.esz (see http://myweb.tiscali.co.uk/ronsweb/genealogy/scripts/gnoxml2svg.esz) and placed it in the same folder as the .svg file.
I had a peep at your site and it doesn't look that amateur to me!
The SVGswitch command was not Perl but a simple Windows batch file. Below is a slightly modified version I use, but you can ignore it and stick with the one viewer (Adobe version 6 is best) @echo off cls echo SVGSwitcher by Georg Held October, 2003 :a echo. echo ___________________________________ echo. echo CHOOSE PLUG-IN (after closing all IE/Browser Windows): echo. echo. echo (1) Corel SVG Viewer 2.1 echo. echo (2) Adobe SVG Viewer 3.01 echo. echo (3) Adobe SVG Viewer 6 pre alpha echo. echo Press 'e' to exit echo. echo select 1,2 or 3 set /P choice= if %choice%==1 goto CSV if %choice%==2 goto ASV3 if %choice%==3 goto ASV6 if "%choice%"=="e" goto end cls goto a
:ASV3 %SYSTEMROOT%\system32\regsvr32.exe "%SYSTEMROOT%\system32\Adobe\SVG Viewer 3.0\NPSVG3.dll" echo. echo you are running ASV3 ! echo. goto a
:ASV6 %SYSTEMROOT%\system32\regsvr32.exe "D:\Program Files\Common Files\Adobe\SVG Viewer 6.0\NPSVG6.dll" echo. echo you are running ASV6 ! echo. goto a
:CSV %SYSTEMROOT%\system32\regsvr32.exe "D;\Program Files\Corel\Corel SVG Viewer\NPViewerPlugin.dll" echo. echo you are running CSV 2_1 ! echo. goto a :end |
|
By IainTait - Thursday, August 18, 2005
|
Thanks for the code which I will try later and continue with version 6 for the moment.
I noticed that the gnoxml2svg.esz had been downloaded as gnoxml2svg.esz.htm by error and obviously wouldn't work.
Now it is corrected ,and the sgv window opens completely now, but when I click on genogram1 I get the error:-
'svg.doc.getElementById(...)' is null or not an object
Line:115, Column: 8
So I am getting closer but not yet there.
|
By genome - Thursday, August 18, 2005
|
This looks like the same issue as 'maru-san' reported earlier in this thread. Please see above for cause & remedy.
|
By IainTait - Thursday, August 18, 2005
|
Thanks for the reply, but I had noticed the other message after posting mine. I have the text box with the name " skin test tree.gno " which was copied from the file of that name and I have removed all individual boxes which were color coded for each generation. The test tree includes five small generations of my father's family with only 18 people. The gnoxml2svg.vbs file contains the following code:-
set xmlTree = CreateObject("Msxml2.DOMDocument") xmlTree.async=false xmlTree.load "skin test tree.xml"set xsltTree= CreateObject("Msxml2.DOMDocument") xsltTree.async = false xsltTree.preserveWhiteSpace = false xsltTree.load "gnoxml2svg.xsl" set svgTree= CreateObject("Msxml2.DOMDocument") svgTree.async = false svgTree.validateOnParse = True xmlTree.transformNodetoObject xsltTree, svgTree svgTree.save "skin test tree.svg" |
but I still get the same error when I click on GenoMap1
|
By genome - Thursday, August 18, 2005
|
The text box must contain the name of the GenoMap not the GenoPro file! In your case you say you have a GenoMap called GenoMap1, so the text box on that GenoMap should have the text GenoMap1 and nothing else, no extra spaces no newline etc.
|
By IainTait - Thursday, August 18, 2005
|
I tried this and the viewer sticks like before and won't open completely.
The full title on the top of my file seems to be
GenoPro Beta [skin test tree.gno @ GenoMap1]
With skin test tree.gno as the text, the viewer opens with the error I described when I try GenoMap1, but with GenoMap1 as the text it doesn't even open correctly.
I am getting confused here as I only ever use one GenoMap i.e. GenoMap1
|
By genome - Thursday, August 18, 2005
|
So now I'm confused :? I just tried a simple example and it worked fine. This game of ping pong is getting us nowhere so please email me your genopro xml file and the generated svg file so that I can see the problem directly. Address for now is in.cognito(at)tiscali.co.uk (with the obvious substitution)
|
By genome - Thursday, August 18, 2005
|
I have now updated the xslt and ecmascript files to fix some bugs including the above and add new features:
1. You can now include backgrounds, photos,images etc. on the generated SVG file.
2. Objects are rendered in the correct order so that overlapping objects appear as in the GenoPro rendering (i.e. same layering)
3. Long comments in the information box are wrapped.
See http://myweb.tiscali.co.uk/ronsweb/genealogy/tools.htm#tool4 for more information.
|