[PATCH] DLD upload
Dirk Hohndel
dirk at hohndel.org
Fri Mar 15 10:47:52 PDT 2013
Miika Turkia <miika.turkia at gmail.com> writes:
> I have attached my version of the patch (that is effectively exactly
> same what Sergey sent, but that is what I already had in my xslt file
> at the time).But as said I am not sure if this is the right way to go.
> At least I would like to get input from Rainer first to hear his
> opinion about the kind of double-encoding issue.
So here's an XML (4.xml) that came from the DLD export of the current
subsurfacetest dive log:
<?xml version="1.0" encoding="iso-8859-1"?>
<DIVELOGSDATA>
<DIVELOGSDIVENUMBER>4</DIVELOGSDIVENUMBER>
<DIVELOGSID>607980</DIVELOGSID>
<DATE>03.03.2013</DATE>
<TIME>10:30:00</TIME>
<DIVETIMESEC>2700</DIVETIMESEC>
<SURFACETIME>0</SURFACETIME>
<MAXDEPTH>30.5</MAXDEPTH>
<MEANDEPTH>24.4</MEANDEPTH>
<LOCATION><![CDATA[красивый остров]]></LOCATION>
<SITE><![CDATA[Некотор&]]></SITE>
<WEATHER><![CDATA[отл]]></WEATHER>
<WATERVIZIBILITY><![CDATA[отли&#]]></WATERVIZIBILITY>
<AIRTEMP>31.1</AIRTEMP>
<WATERTEMPMAXDEPTH>29.4</WATERTEMPMAXDEPTH>
<WATERTEMPATEND>30.6</WATERTEMPATEND>
<PARTNER><![CDATA[Дмитрий]]></PARTNER>
<BOATNAME><![CDATA[открыти&]]></BOATNAME>
<CYLINDERDESCRIPTION><![CDATA[алюмиl]]></CYLINDERDESCRIPTION>
<DBLTANK>0</DBLTANK>
<CYLINDERSIZE>10.96</CYLINDERSIZE>
<CYLINDERSTARTPRESSURE>206.70</CYLINDERSTARTPRESSURE>
<CYLINDERENDPRESSURE>68.90</CYLINDERENDPRESSURE>
<WORKINGPRESSURE>206.70</WORKINGPRESSURE>
<WEIGHT>4.54</WEIGHT>
<O2PCT>36.0</O2PCT>
<LOGNOTES><![CDATA[Это тест погружения, который пытается использовать символы кириллицы в стольких местах, как это возможно.]]></LOGNOTES>
<LAT>-3.878241</LAT>
<LNG>-32.456017</LNG>
<GOOGLEMAPSZOOMLEVEL>14</GOOGLEMAPSZOOMLEVEL>
<SAMPLEINTERVAL></SAMPLEINTERVAL>
</DIVELOGSDATA>
if I run
xsltproc -o 4a.xml xslt/divelogs.xslt 4.xml
I get
<?xml version="1.0"?>
<divelog program="subsurface-import" version="2">
<dives>
<dive number="4" date="03.03.2013" time="10:30:00" duration="45:00 min">
<depth max="30.5 m" mean="24.4 m"/>
<location>красивый остров / Некотор&</location>
<gps>-3.878241 -32.456017</gps>
<temperature air="31.1" water="29.4"/>
<buddy>Дмитрий</buddy>
<cylinder o2="36.0" start="206.70" end="68.90" size="10.96" workpressure="206.70" description="алюмиl"/>
<weightsystem description="unknown" weight="4.54 kg"/>
<notes>Это тест погружения, который пытается использовать символы кириллицы в стольких местах, как это возможно.</notes>
</dive>
</dives>
</divelog>
which looks really sane (well, it looks like it parses correctly).
But if I do
./subsurface 4.xml
and then save to 4b.xml this is what I get:
<divelog program='subsurface' version='2'>
<settings>
</settings>
<dives>
<dive number='4' date='2013-03-03' time='10:30:00' duration='45:00 min'>
<location gps='-3.878241 -32.456017'/>
<cylinder size='10.96 l' workpressure='206.7 bar' description='алюмиl' o2='36.0%' start='206.7 bar' end='68.9 bar' />
<weightsystem weight='4.54 kg' description='unknown' />
<divecomputer>
<depth max='30.5 m' mean='24.4 m' />
<temperature air='31.1 C' water='29.4 C' />
</divecomputer>
</dive>
</dives>
</divelog>
Which is clearly bogus. I tried to check if the correct xslt stylesheet
was used and yes, that's confirmed.
This is missing location name, buddy name, etc... and then escapes the
'&' (I haven't done that part of the code, yet - first trying to track
down why this doesn't work right to begin with)
/D
More information about the subsurface
mailing list