merge the formfield patch from ooo-build
[ooovba.git] / testautomation / xml / optional / includes / sxw7_01a.inc
blob51ec997203516a10ce59f534045cbf8281add515
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* 
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: sxw7_01a.inc,v $
11 '* $Revision: 1.2 $
13 '* last change: $Author: rt $ $Date: 2008-07-11 07:34:36 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org.  If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : XML Writer Include File
38 '\***********************************************************************************
39    Dim Isliste(250) as string
40    Dim OutputPath as string
42 sub sxw7_01a
44    printlog "-------------------------- SXW7_01a.INC ------------------------------"
46    printlog "---------------------------------------------------------------------"
47    call tfields
48    call tfootnotes
50 end sub
52 '-------------------------------------------------------------------------
53    
54 testcase tfields
55     Dim a as integer
56     Dim i as integer
57     Dim AttributeSearch(60) as string
58     Dim AttributeValue(60) as string
59     Dim sXMLNodename(50) as string
60     Dim sPathToAttributes as string
62     printlog "+- fields.sdw"
63     '/// Opening file fields.sdw from input-directory.
64     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fields.sdw"))
65     '/// Saving the document in OOo XML 1.0 format.
66     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw") , "StarOffice XML (Writer)") then    
67         '/// Closing the document also if there is a verification dialog.    
68         call hCloseDocument()    
69         sleep(3)
70         '/// Unpack the complete content of the file (ZIP-archieve) into a seperate directory.
71         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fields") )        
72         '/// Checking the well formness of content.xml, styles.xml and meta.xml.
73         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\meta.xml")) = FALSE then
74             warnlog "XML-file 'meta.xml' not well formed!"
75         end if   
76         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\styles.xml")) = FALSE then
77             warnlog "XML-file 'styles.xml' not well formed!"
78         end if
79         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\content.xml")) = FALSE then
80             warnlog "XML-file 'content.xml' not well formed!"
81         else
82             '/// Opening the exported file (GPF check).
83             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw"))
84             sleep(2)
85             '/// Closing the document.
86             call hCloseDocument
87             sleep(2)
88             SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\content.xml"))
89             printlog "    ---------------------"
90             printlog "    c o n t e n t . x m l"
91             printlog "    ---------------------"
92             printlog "----------"
93             printlog "  fields  "
94             printlog "----------"    
95             '-------------------------------------------------------------------------
96             '/// <u><b>CONTENT.XML</u></b>
97             printlog "++ Feature(s) to be searched for:"
98             printlog " |"     
99             '-------------------------------------------------------------------------
100             '/// Searching for: &lt;text:sender-firstname text:fixed=&quot;false&quot;&gt; 
101             '/// Searching for: &lt;text:sender-lastname text:fixed=&quot;false&quot;&gt;
102             sXMLNodename(1) = "text:sender-firstname"
103             sXMLNodename(2) = "text:sender-lastname"
104             AttributeSearch(1) = "text:fixed"
105             AttributeValue(1) = "false"    
106             '/// Searching for: &lt;text:date text:date-value=&quot;2000-11-30T16:14:56&quot; 
107             '/// Searching for: &lt;text:time text:time-value=&quot;[not null]&quot;  
108             sXMLNodename(3) = "text:date"     
109             AttributeSearch(3) = "text:date-value"
110             AttributeValue(3) = "2000-11-30T16:14:56"
111             sXMLNodename(4) = "text:time"
112             AttributeSearch(4) = "text:time-value"
113             AttributeValue(4) = ""     
114             '/// Searching for: &lt;text:word-count style:num-format=&quot;1&quot;&gt;75&lt;/text:word-count&gt;   
115             '/// Searching for: &lt;text:character-count style:num-format=&quot;1&quot;&gt;788&lt;/text:character-count&gt;
116             sXMLNodename(5) = "text:word-count"
117             'TODO: JSI: Rotine needed for char XML node
118             'CharNode = 75
119             sXMLNodename(6) = "text:character-count"
120             'TODO: JSI: Rotine needed for char XML node
121             'CharNode = 788    
122             AttributeSearch(5) = "style:num-format" 
123             AttributeValue(5) = "1"    
124             '/// Searching for: &lt;text:reference-mark-start text:name=&quot;ref&quot;/&gt;I am a reference&lt;text:reference-mark-end text:name=&quot;ref&quot;/&gt;
125             sXMLNodename(7) = "text:reference-mark-start"    
126             sXMLNodename(8) = "text:reference-mark-end"
127             AttributeSearch(7) = "text:name"
128             AttributeValue(7) = "ref"
129             '/// Searching for: &lt;text:reference-ref text:reference-format=&quot;page&quot; text:ref-name=&quot;ref&quot;&gt;1&lt;/text:reference-ref&gt; Chapter: &lt;text:reference-ref text:reference-format=&quot;chapter&quot; text:ref-name=&quot;ref&quot;&gt;1&lt;/text:reference-ref&gt; Location: &lt;text:reference-ref text:reference-format=&quot;direction&quot; text:ref-name=&quot;ref&quot;&gt;above&lt;/text:reference-ref&gt;
130             sXMLNodename(9)  = "text:reference-ref"
131             'TODO: JSI: Rotine needed for char XML node
132             'CharNode: 1 [9]
133             'CharNode: 1 [10]
134             'CharNode: above [11]
135             AttributeSearch(9) = "text:reference-format"
136             AttributeValue(9) = "page"
137             AttributeValue(10) = "chapter"    
138             AttributeValue(11) = "direction"    
139             'All three have this attribute and -value:
140             AttributeSearch(12) = "text:ref-name"
141             AttributeValue(12)  = "ref"    
142             '/// Searching for: &lt;text:variable-set text:name=&quot;x&quot; text:value-type=&quot;float&quot; text:value=&quot;1&quot; style:data-style-name=&quot;N0&quot;&gt;1&lt;/text:variable-set&gt;    
143             sXMLNodename(13) = "text:variable-set"
144             AttributeSearch(13) = "text:name"
145             AttributeValue(13)  = "x"
146             AttributeSearch(14) = "text:value-type"
147             AttributeValue(14) = "float"
148             AttributeSearch(15) = "text:value"
149             AttributeValue(15) = "1" 
150             AttributeSearch(16) = "style:data-style-name" 
151             AttributeValue(16) = "N0"
152             'TODO: JSI: Rotine needed for char XML node
153             'CharNode: 1
154             '/// Searching for: &lt;text:user-field-get text:name=&quot;I_am_a_user_field&quot;&gt;Content of the user field&lt;/text:user-field-get&gt;
155             sXMLNodename(17) = "text:user-field-get"
156             AttributeSearch(17) = "text:name" 
157             AttributeValue(17) = "I_am_a_user_field"
158             'TODO: JSI: Rotine needed for char XML node
159             'CharNode: Content of the user field
160             '/// Searching for: &lt;text:conditional-text text:condition=&quot;x==1&quot; text:string-value-if-true=&quot;x = 1&quot; text:string-value-if-false=&quot;x &amp;lt;&amp;gt; 1&quot;&gt;x = 1&lt;/text:conditional-text&gt; 
161             sXMLNodename(18) = "text:conditional-text" 
162             AttributeSearch(18) = "text:condition"
163             AttributeValue(18) = "x==1"
164             AttributeSearch(19) = "text:string-value-if-true"
165             AttributeValue(19) = "x = 1"
166             AttributeSearch(20) = "text:string-value-if-false"
167             AttributeValue(20) = "x <> 1"
168             'TODO: JSI: Rotine needed for char XML node
169             'CharNode: x = 1
170             '/// Searching for: &lt;text:hidden-text text:condition=&quot;x==1&quot; text:string-value=&quot;x is not equal to 1&quot;/&gt;
171             sXMLNodename(21) = "text:hidden-text"
172             AttributeSearch(21) = "text:condition"
173             AttributeValue(21) = "x==1"
174             AttributeSearch(22) = "text:string-value"
175             AttributeValue(22) = "x is not equal to 1"    
176             '/// Searching for: &lt;text:hidden-paragraph text:condition=&quot;x==1&quot; text:is-hidden=&quot;true&quot;/&gt;I am hidden if x=1&lt;/text:p&gt;
177             sXMLNodename(23) = "text:hidden-paragraph"
178             AttributeSearch(23) = "text:condition"
179             AttributeValue(23) = "x==1"
180             AttributeSearch(24) = "text:is-hidden"
181             AttributeValue(24) = "true"
182             'TODO: JSI: Rotine needed for char XML node
183             'CharNode: I am hidden if x=1     
184             '/// Searching for: &lt;text:creation-date style:data-style-name=&quot;N36&quot;&gt;15/11/2000&lt;/text:creation-date&gt;
185             sXMLNodename(25) = "text:creation-date"
186             AttributeSearch(25) = "style:data-style-name"
187             AttributeValue(25) = "N108"   
188             '/// Searching for: &apos;&lt;text:editing-cycles&gt;0&lt;/text:editing-cycles&gt;
189             'sXMLNodename(?) = text:editing-cycles
190             'TODO: JSI: Rotine needed for char XML node
191             'CharNode: 0   
192             '/// Searching for: &lt;text:modification-date style:data-style-name=&quot;N81&quot;&gt;6. mars 2003&lt;/text:modification-date&gt;
193             sXMLNodename(26) = "text:modification-date"
194             AttributeSearch(26) = "style:data-style-name"
195             AttributeValue(26) = "N76"
196             'TODO: JSI: Rotine needed for char XML node
197             'CharNode: 6. mars 2003
198             '/// Searching for: &lt;text:database-display text:database-name=&quot;Bibliography&quot; text:table-name=&quot;biblio&quot; text:table-type=&quot;table&quot; text:column-name=&quot;Author&quot;&gt;&amp;lt;Author&amp;gt;&lt;/text:database-display&gt;
199             sXMLNodename(27) = "text:database-display"
200             AttributeSearch(27) = "text:database-name"
201             AttributeValue(27) = "Bibliography"
202             AttributeSearch(28) = "text:table-name"
203             AttributeValue(28) = "biblio"
204             AttributeSearch(29) = "text:table-type"
205             AttributeValue(29) = "table"
206             AttributeSearch(30) = "text:column-name"
207             AttributeValue(30) = "Author"   
208             'TODO: JSI: Rotine needed for char XML node
209             'CharNode: <Author>   
210             '/// Searching for: &lt;text:database-next text:database-name=&quot;Bibliography&quot; text:table-name=&quot;biblio&quot; text:table-type=&quot;table&quot; text:condition=&quot;TRUE&quot;/&gt;
211             sXMLNodename(31) = "text:database-next"
212             AttributeSearch(31) = "text:database-name"
213             AttributeValue(31) = "Bibliography"
214             AttributeSearch(32) = "text:table-name"
215             AttributeValue(32) = "biblio"
216             AttributeSearch(33) = "text:table-type"
217             AttributeValue(33) = "table"
218             AttributeSearch(34) = "text:condition"
219             AttributeValue(34) = "TRUE" 
220             '/// Searching for: &lt;text:database-display text:database-name=&quot;Bibliography&quot; text:table-name=&quot;biblio&quot; text:table-type=&quot;table&quot; text:column-name=&quot;Author&quot;&gt;&amp;lt;Author&amp;gt;&lt;/text:database-display&gt;
221             sXMLNodename(35) = "text:database-display"
222             AttributeSearch(35) = "text:database-name"
223             AttributeValue(35) = "Bibliography"
224             AttributeSearch(36) = "text:table-name"
225             AttributeValue(36) = "biblio"
226             AttributeSearch(37) = "text:table-type"
227             AttributeValue(37) = "table"
228             AttributeSearch(38) = "text:column-name"
229             AttributeValue(38) = "Author" 
230             'TODO: JSI: Rotine needed for char XML node
231             'CharNode: <Author>     
232             '/// Searching for: &lt;text:database-row-number text:database-name=&quot;Bibliography&quot; text:table-name=&quot;biblio&quot; text:table-type=&quot;table&quot; style:num-format=&quot;1&quot; text:value=&quot;3&quot;&gt;3&lt;/text:database-row-number&gt;
233             sXMLNodename(39) = "text:database-row-number"
234             AttributeSearch(39) = "text:database-name"
235             AttributeValue(39) = "Bibliography"
236             AttributeSearch(40) = "text:table-name"
237             AttributeValue(40) = "biblio"
238             AttributeSearch(41) = "text:table-type"
239             AttributeValue(41) = "table"
240             AttributeSearch(42) = "style:num-format"
241             AttributeValue(42) = "1"
242             AttributeSearch(43) = "text:value"
243             AttributeValue(43) = "3"
244             'TODO: JSI: Rotine needed for char XML node
245             'CharNode: 3  
246             '/// Searching for: &lt;text:database-name text:database-name=&quot;Bibliography&quot; text:table-name=&quot;biblio&quot; text:table-type=&quot;table&quot;&gt;Bibliography.biblio&lt;/text:database-name&gt;
247             sXMLNodename(44) = "text:database-name"
248             AttributeSearch(44) = "text:database-name"
249             AttributeValue(44) = "Bibliography"
250             AttributeSearch(45) = "text:table-name"
251             AttributeValue(45) = "biblio"
252             AttributeSearch(46) = "text:table-type"
253             AttributeValue(46) = "table"
254             'TODO: JSI: Rotine needed for char XML node
255             'CharNode: Bibliography.biblio    
256             for a = 1 to 46       
257                 select case a
258                     case 1 , 2 :
259                         ' Two nodes have the same attributes and -values as the first one          
260                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a))
261                         SAXSeekElement(sPathToAttributes)
262                         printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(1)           
263                         if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then
264                             warnlog "Field: " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!"
265                         end if         
266                         SAXSeekElement("/")
267                     case 5 , 6  :
268                         ' Two nodes have the same attributes and -values as the first one
269                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a))
270                         SAXSeekElement(sPathToAttributes)          
271                         printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(5)           
272                         if SAXGetAttributeValue(AttributeSearch(5)) <> AttributeValue(5) then
273                             warnlog "Field: " & AttributeSearch(5) & " is not " & AttributeValue(5) & "!"
274                         end if         
275                         SAXSeekElement("/")
276                     case 7 , 8  : ' Two nodes have the same attributes and -values as the first one                               
277                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a))
278                         SAXSeekElement(sPathToAttributes)            
279                         printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(7)           
280                         if SAXGetAttributeValue(AttributeSearch(7)) <> AttributeValue(7) then
281                             warnlog "Field: " & AttributeSearch(7) & " is not " & AttributeValue(7) & "!"
282                         end if         
283                         SAXSeekElement("/")
284                     case 3, 4 :
285                         ' The attribute is language dependent and should NOT be NULL
286                         ' The if-then-else inquiry is another than in the other inquiries!
287                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a))
288                         SAXSeekElement(sPathToAttributes)            
289                         printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(a)           
290                         if SAXGetAttributeValue(AttributeSearch(a)) = AttributeValue(a) then
291                             warnlog "Field: " & AttributeSearch(a) & " is null empty!"
292                         end if         
293                         SAXSeekElement("/")          
294                     case 9 , 10, 11:
295                         ' Three times the same element name but not the same XML node
296                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(9) , a-8)                      
297                         SAXSeekElement(sPathToAttributes)
298                         printlog " +- [Element: " & sXMLNodename(9) & "] Attribute: " & AttributeSearch(9) & "=" & AttributeValue(a)           
299                         if SAXGetAttributeValue(AttributeSearch(9)) <> AttributeValue(a) then
300                             warnlog "Field: " & AttributeSearch(9) & " is not " & AttributeValue(a) & "!"
301                         end if
302                         SAXSeekElement("/")                    
303                     case 12:                
304                         for i = 1 to 3
305                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(9) , i) 
306                         SAXSeekElement(sPathToAttributes)                     
307                         printlog " +- [Element: " & sXMLNodename(9) & " (" & i & ")] Attribute: " & AttributeSearch(12) & "=" & AttributeValue(12)
308                         if SAXGetAttributeValue(AttributeSearch(12)) <> AttributeValue(12) then
309                             warnlog "Field: " & AttributeSearch(12) & " is not " & AttributeValue(12) & "!"
310                         end if                       
311                         SAXSeekElement("/")
312                         next i
313                     case 21, 22 :
314                         ' One node has two attributes          
315                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(21))
316                         SAXSeekElement(sPathToAttributes)                      
317                         printlog " +- [Element: " & sXMLNodename(21) & "]" & AttributeSearch(a)           
318                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
319                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
320                         end if         
321                         SAXSeekElement("/")
322                     case 23, 24 :
323                         ' One node has two attributes          
324                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(23))
325                         SAXSeekElement(sPathToAttributes)                      
326                         printlog " +- [Element: " & sXMLNodename(23) & "]" & AttributeSearch(a)           
327                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
328                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
329                         end if         
330                         SAXSeekElement("/")                       
331                     case 18, 19, 20 :
332                         ' One node has three attributes          
333                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(18))
334                         SAXSeekElement(sPathToAttributes)                      
335                         printlog " +- [Element: " & sXMLNodename(18) & "]" & AttributeSearch(a)           
336                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
337                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
338                         end if         
339                         SAXSeekElement("/")
340                     case 44, 45, 46 :
341                         ' One node has three attributes          
342                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(44))
343                         SAXSeekElement(sPathToAttributes)                      
344                         printlog " +- [Element: " & sXMLNodename(44) & "]" & AttributeSearch(a)           
345                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
346                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
347                         end if         
348                         SAXSeekElement("/")                       
349                     case 13, 14, 15, 16  :
350                         ' One node has four attributes          
351                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(13))
352                         SAXSeekElement(sPathToAttributes)                      
353                         printlog " +- [Element: " & sXMLNodename(13) & "]" & AttributeSearch(a)           
354                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
355                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
356                         end if         
357                         SAXSeekElement("/")                                 
358                     case 27, 28, 29, 30 :
359                         ' One node has four attributes          
360                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(27))
361                         SAXSeekElement(sPathToAttributes)                      
362                         printlog " +- [Element: " & sXMLNodename(27) & "]" & AttributeSearch(a)           
363                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
364                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
365                         end if         
366                         SAXSeekElement("/")                                                           
367                     case 31, 32, 33, 34 :
368                         ' One node has four attributes          
369                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(31))
370                         SAXSeekElement(sPathToAttributes)                      
371                         printlog " +- [Element: " & sXMLNodename(31) & "]" & AttributeSearch(a)           
372                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
373                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
374                         end if         
375                         SAXSeekElement("/")
376                     case 35, 36, 37, 38 :
377                         ' One node has four attributes          
378                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(35))
379                         SAXSeekElement(sPathToAttributes)                      
380                         printlog " +- [Element: " & sXMLNodename(35) & "]" & AttributeSearch(a)           
381                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
382                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
383                         end if         
384                         SAXSeekElement("/")
385                     case 39, 40, 41, 42, 43 :
386                         ' One node has five attributes          
387                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(39))
388                         SAXSeekElement(sPathToAttributes)                      
389                         printlog " +- [Element: " & sXMLNodename(39) & "]" & AttributeSearch(a)           
390                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
391                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
392                         end if         
393                         SAXSeekElement("/")
394                     case 25, 26     : 
395                         'skipping (evaluating different style names under different operating systems
396                         SAXSeekElement("/")
397                     case else   :
398                         sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a))
399                         SAXSeekElement(sPathToAttributes)                      
400                         printlog " +- [Element: " & sXMLNodename(a) & "]" & AttributeSearch(a)           
401                         if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then
402                             warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!"
403                         end if         
404                         SAXSeekElement("/")          
405                 end select
406                 printlog " |"                       
407             next a      
408             SAXRelease()
409             printlog "    * * *"
410         end if
411     else
412         call hCloseDocument
413     end if
414 endcase
416 '-------------------------------------------------------------------------
418 testcase tfootnotes 
419     Dim a as integer
420     Dim i as integer
421     Dim AttributeSearch(60) as string
422     Dim AttributeValue(60) as string
423     Dim sXMLNodename(50) as string
424     Dim sPathToAttributes as string
426     printlog "+- footnotes.sdw"
427     '/// Opening file footnotes.sdw from input-directory.
428     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\footnotes.sdw"))
429     '/// Saving the document in OOo XML 1.0 format.
430     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw") , "StarOffice XML (Writer)") then    
431         '/// Closing the document also if there is a verification dialog.    
432         call hCloseDocument()    
433         sleep(3)
434         '/// Unpack the complete content of the file (ZIP-archieve) into a seperate directory.
435         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes") )
436         '/// Checking the well formness of content.xml, styles.xml and meta.xml.
437         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\meta.xml")) = FALSE then
438             warnlog "XML-file 'meta.xml' not well formed!"
439         end if
440         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\styles.xml")) = FALSE then
441             warnlog "XML-file 'styles.xml' not well formed!"
442         end if
443         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\content.xml")) = FALSE then
444             warnlog "XML-file 'content.xml' not well formed!"
445         else
446             '/// Opening the exported file (GPF check).
447             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw"))
448             sleep(2)
449             '/// Closing the document.
450             call hCloseDocument     
451         end if
452     else
453         call hCloseDocument
454     end if
455 endcase