1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : wolfram.garten@oracle.com
30 '* short description : Library 01 for OASIS OpenDocument File Format (Presentation and Drawing) test
32 '************************************************************************
34 ' #1 talien_attributes ' Verification that alian attributes will be stored in document.
35 ' #1 t_all_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
36 ' #1 t_no_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
37 ' #1 t_no_header_footer_master_elements ' http://specs.openoffice.org/impress/header_and_footer.sxw
38 ' #1 t_some_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
40 '\***********************************************************************
42 testcase talien_attributes
44 Dim AttrNameInDOM as string
45 Dim sPropertyElement as string
46 Dim sLogAttributeName as string
47 Dim sAttributeSearch(9) as string
48 Dim sAttributeValue(9) as string
50 printlog "+- Presentation: alien.odp"
51 '/// Opening alien.sxi. ///
52 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\alien_attributes\alien_attributes_presentation.odp"))
53 '/// Saving document. ///
54 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp") , "impress8") = TRUE then
55 '/// Closing document. ///
57 '/// Unpacking the compressed (ZIP) archive.
58 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\") )
59 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
60 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
61 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\styles.xml")) = TRUE then
62 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\meta.xml")) = TRUE then
63 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\content.xml")) = TRUE then
64 '/// Opening exported document (GPF check). ///
65 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp")
67 '/// Closing document. ///
70 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\content.xml"))
71 printlog "-----------------"
72 printlog "Hidden Namespaces"
73 printlog "-----------------"
74 '/// <u><b>content.xml</u></b>
75 '/// <u>Hidden attributes in namespaces</u>
76 '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien"
77 '-------------------------------------------------------------------------
78 sAttributeSearch(1) = "xmlns:alien"
79 sAttributeValue(1) = "http://openoffice.org/2000/alien"
80 printlog "++ Feature(s) to be searched for:"
82 '-------------------------------------------------------------------------
83 SAXSeekElement("office:document-content")
84 printlog " +- " & sAttributeSearch(1)
85 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
86 warnlog "Hidden attributes (in namespace): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
90 '/// <u>hidden attributes</u>
91 '///+<ol><li><b>in a drawing-page style</b></li>
92 '///+<li><b>in a graphics style</b></li>
93 '///+<li><b>in a paragraph style (twice)</b></li>
94 '///+<li><b>in a text style</b></li></ol>
95 '///+ Searching for: alien:key="page"
96 '///+ Searching for: alien:key="shape"
97 '///+ Searching for: alien:key="para"
98 '///+ Searching for: alien:key="shape-text"
99 '///+ Searching for: alien:key="text"
101 'The number behind the string variable is the position
102 'in the DOM-tree. The search is hard coded because the
103 'export of the same file should not change in the lifetime
106 sAttributeSearch(1) = "alien:key"
107 sAttributeValue(1) = "page"
109 sAttributeSearch(3) = "alien:key"
110 sAttributeValue(3) = "shape"
112 sAttributeSearch(6) = "alien:key"
113 sAttributeValue(6) = "para"
115 sAttributeSearch(7) = "alien:key"
116 sAttributeValue(7) = "shape-text"
118 sAttributeSearch(9) = "alien:key"
119 sAttributeValue(9) = "text"
120 '-------------------------------------------------------------------------
121 printlog "++ Feature(s) to be searched for:"
123 '-------------------------------------------------------------------------
126 case 1 : printlog "-----------------------------------------"
127 printlog "Hidden attributes in a drawing-page style"
128 printlog "-----------------------------------------"
129 sPropertyElement = "style:drawing-page-properties"
130 sLogAttributeName = "drawing-page"
131 case 3 : printlog "-------------------------------------"
132 printlog "Hidden attributes in a graphics style"
133 printlog "-------------------------------------"
134 sPropertyElement = "style:graphic-properties"
135 sLogAttributeName = "graphics"
136 case 6, 7 : printlog "-------------------------------------------"
137 printlog "Hidden attributes in a paragraph style (" & i-4 & ")"
138 printlog "-------------------------------------------"
139 sPropertyElement = "style:paragraph-properties"
140 sLogAttributeName = "paragraph"
141 case 9 : printlog "---------------------------------"
142 printlog "Hidden attributes in a text style"
143 printlog "---------------------------------"
144 sPropertyElement = "style:text-properties"
145 sLogAttributeName = "text"
147 if i = 1 or i = 3 or i = 6 or i = 7 or i = 9 then
148 'The hidden attributes are in a known sequence included,
149 'so the same routine will be used for different styles!
151 SAXSeekElement("office:document-content")
152 SAXSeekElement("office:automatic-styles")
153 SAXSeekElement("style:style" , i )
154 AttrNameInDOM = SAXGetAttributeValue("style:name")
155 printlog " + style:style position in DOM: " & i & ". Attribute name: " & AttrNameInDOM
158 'It depends on the type of element (drawing-page, paragraphic, graphics, ...)
159 'which is the next element. That is a difference to OOo XML 1.0 where everything
160 'called 'style:properties'.
162 SAXSeekElement(sPropertyElement)
163 printlog " +- " & sAttributeSearch(i)
164 if SAXGetAttributeValue(sAttributeSearch(i)) <> sAttributeValue(i) then
165 warnlog "Hidden attributes (in a " & sLogAttributeName & " style): " & sAttributeSearch(i) & " is not " & sAttributeValue(i) & "!"
171 '-------------------------------------------------------------------------
172 '/// Closing the XML DOM.
174 '/// Opening the DOM of styles.xml.
175 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\styles.xml"))
176 '-------------------------------------------------------------------------
177 printlog "-------------------"
178 printlog "s t y l e s . x m l"
179 printlog "-------------------"
180 printlog "-----------------"
181 printlog "Hidden Namespaces"
182 printlog "-----------------"
183 '/// <u><b>styles.xml</u></b>
184 '/// <u>Hidden attributes in namespaces</u>
185 '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien"
186 '-------------------------------------------------------------------------
187 sAttributeSearch(1) = "xmlns:alien"
188 sAttributeValue(1) = "http://openoffice.org/2000/alien"
189 printlog "++ Feature(s) to be searched for:"
191 '-------------------------------------------------------------------------
192 SAXSeekElement("office:document-styles")
193 printlog " +- " & sAttributeSearch(1)
194 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
195 warnlog "Hidden attributes (in namespace): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
199 printlog "----------------------------------------"
200 printlog "Hidden attributes in a master-page style"
201 printlog "----------------------------------------"
202 '-------------------------------------------------------------------------
203 '/// <u>hidden attributes</u>
204 '///+<ol><li><b>in a master-page style</b></li></ol>
205 '///+ Searching for: alien:key="master-page"
206 '-------------------------------------------------------------------------
207 sAttributeSearch(1) = "alien:key"
208 sAttributeValue(1) = "master-page"
209 printlog "++ Feature(s) to be searched for:"
211 '-------------------------------------------------------------------------
212 SAXSeekElement("office:document-styles")
213 SAXSeekElement("office:automatic-styles")
214 SAXSeekElement("style:style")
215 SAXSeekElement("style:drawing-page-properties")
216 printlog " +- " & sAttributeSearch(1)
217 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
218 warnlog "Hidden attributes (in master-page style): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
221 '-------------------------------------------------------------------------
224 warnlog "One of the XML files not well formed!"
229 warnlog "It was not possible to save the document as XML!"
233 '-------------------------------------------------------------------------
235 testcase t_all_header_footer
236 Dim iPresAttr as integer
237 Dim sAttributeSearch(4) as string
238 Dim sAttributeValue(4) as string
239 Dim sHeaderInNotes as string
241 printlog "+- Presentation: allheaderfooter_fixed.odp"
242 '/// Opening <i>xml\required\input\graphics\header_footer\allheaderfooter_fixed.odp</i>.
243 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\allheaderfooter_fixed.odp"))
244 '/// Saving document as <i>user\work\xml\graphics\update\allheaderfooter_fixed.odp</i> with default presentation document name.
245 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp") , "impress8") = TRUE then
246 '/// Closing document.
248 '/// Unpacking the compressed (ZIP) archive. Putting the content to <i>user\work\xml\graphics\update\allheaderfooter_fixed\</i>"
249 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\") )
250 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
251 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
252 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\styles.xml")) = TRUE then
253 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\meta.xml")) = TRUE then
254 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\content.xml")) = TRUE then
255 '/// Opening exported document (GPF check). ///
256 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp")
258 '/// Closing document. ///
261 '/// <u><b>content.xml</u></b>
262 '/// Opening user\work\xml\graphics\update\allheaderfooter_fixed\content.xml with SAX parser.
263 '/// Searching for <ul>
264 '///+<li><presentation:header-decl presentation:name="hdr1">Header in notes/handout powered by QA</presentation:header-decl>
265 '///+<li><presentation:footer-decl presentation:name="ftr1">footer powered by QA</presentation:footer-decl>
266 '///+<li><presentation:footer-decl presentation:name="ftr2">Footer notes/handout powered by QA</presentation:footer-decl>
267 '///+<li><presentation:date-time-decl presentation:name="dtd1" presentation:source="fixed">09.12.2001</presentation:date-time-decl></ul>
268 sAttributeSearch(1) = "presentation:header-decl"
269 sAttributeValue(1) = "Header in notes/handout powered by QA"
270 sAttributeSearch(2) = "presentation:footer-decl"
271 sAttributeValue(2) = "footer powered by QA"
272 sAttributeSearch(3) = "presentation:footer-decl"
273 sAttributeValue(3) = "Footer notes/handout powered by QA"
274 sAttributeSearch(4) = "presentation:date-time-decl"
275 sAttributeValue(4) = "09.12.2001"
277 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\content.xml"))
278 for iPresAttr = 1 to 4
279 '/// Parsing to office:document-content
280 SAXSeekElement("office:document-content")
281 '/// Parsing to office:body
282 SAXSeekElement("office:body")
283 '/// Parsing to office:presentation
284 SAXSeekElement("office:presentation")
285 '/// Parsing to <ol><li>presentation:header-decl</li>
286 '///+ <li>presentation:footer-decl</li>
287 '///+ <li>presentation:footer-decl</li>
288 '///+ <li>presentation:date-time-decl</li></ol>
289 if iPresAttr = 3 then
290 'To reach the second 'presentation:footer-decl'-element an additional parameter is needed.
291 SAXSeekElement(sAttributeSearch(iPresAttr) , 2)
293 SAXSeekElement(sAttributeSearch(iPresAttr))
295 '/// Parsing 1 node deeper (to get the CharNode)
297 '/// Reading the characters of the CharNode and verifying it against the reference.
298 ' Initializing the variable (empty)
300 sHeaderInNotes = SAXGetChars
301 if sHeaderInNotes <> sAttributeValue(iPresAttr) then
302 warnlog "Failed! - Attribute '" & sAttributeSearch(iPresAttr) & "' has the value '" & sHeaderInNotes & "' but it has to be '" & sAttributeValue(iPresAttr) & "'."
304 printlog "Passed. - Attribute '" & sAttributeSearch(iPresAttr) & "' has the correct value '" & sHeaderInNotes & "'."
310 warnlog "One of the XML files not well formed!"
315 warnlog "It was not possible to save the document as XML!"
319 '-------------------------------------------------------------------------
321 testcase t_no_header_footer
322 Dim sDrawName as string
323 Dim sElementName as string
324 Dim sAttributeSearch(3) as string
325 Dim sAttributeValue as string
327 Dim iChildsOfAutomaticStyles as integer
328 printlog "+- Presentation: noheaderfooter.odp"
329 '/// Opening <i>xml\required\input\graphics\header_footer\noheaderfooter.odp</i>.
330 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\noheaderfooter.odp"))
331 '/// Saving document as <i>user\work\xml\graphics\update\noheaderfooter.odp</i> with default presentation document name.
332 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp") , "impress8") = TRUE then
333 '/// Closing document. ///
335 '/// Unpacking the compressed (ZIP) archive.
336 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\") )
337 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
338 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
339 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\styles.xml")) = TRUE then
340 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\meta.xml")) = TRUE then
341 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\content.xml")) = TRUE then
342 '/// Opening exported document (GPF check). ///
343 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp")
345 '/// Closing document. ///
348 '/// Opening user\work\xml\graphics\update\noheaderfooter\content.xml with SAX-parser.
349 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\content.xml"))
351 '///+<li> Parsing to office:document-content
352 SAXSeekElement("office:document-content")
353 '///+ Parsing to office:body
354 SAXSeekElement("office:body")
355 '///+ Parsing to office:presentation
356 SAXSeekElement("office:presentation")
357 '///+ Parsing to draw:page
358 SAXSeekElement("draw:page")
359 '///+ Get value of draw:style-name
361 sDrawName = SAXGetAttributeValue ("draw:style-name")
362 '///+ Get back to the top of DOM</li>
364 '///+<li> Parsing to office:document-content
365 SAXSeekElement("office:document-content")
366 '///+ Parsing to office:automatic-styles
367 SAXSeekElement("office:automatic-styles")
368 '///+ Look where the style:style element is where the style:name is the same as it was for draw:name
369 iChildsOfAutomaticStyles = SAXGetChildCount
370 'The count of style:style nodes is normaly 7 but the 8th is a text:list-style where
371 'the searched attributes won't be included.
372 for i = 1 to (iChildsOfAutomaticStyles-1)
373 SAXSeekElement("style:style" , i)
374 sElementName = SAXGetAttributeValue("style:name")
375 if sElementName = sDrawName then
376 '///+ If found the named attribute (e.g. dp1) parsing to style:drawing-page-properties.
377 SAXSeekElement("style:drawing-page-properties")
380 if i = iChildsOfAutomaticStyles then
381 '///+ If the style:name is not found a warnlog will be written into the log and the test will be stopped.
382 warnlog "Failed! The style:style='" & sDrawName & "' has not been found in the automatic-styles! Test will be aborted here!"
386 'Go one node to the parent node.
389 '///+Parsing to <ol><li>presentation:display-footer</li>
390 '///+ <li>presentation:footer-decl</li>
391 '///+ <li>presentation:display-page-number</li>
392 '///+ <li>presentation:display-date-time</li></ol>
393 sAttributeSearch(1) = "presentation:display-footer"
394 sAttributeSearch(2) = "presentation:display-page-number"
395 sAttributeSearch(3) = "presentation:display-date-time"
397 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
398 '///+ Verifying that the value of each attribute is 'false'.</li></ol>
399 if sAttributeValue <> "false" then
400 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
402 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
407 warnlog "One of the XML files not well formed!"
412 warnlog "It was not possible to save the document as XML!"
416 '-------------------------------------------------------------------------
418 testcase t_no_header_footer_master_elements
419 printlog "+- Presentation: nomasterelements.odp"
420 '/// Opening <i>xml\required\input\graphics\header_footer\nomasterelements.odp</i>.
421 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\nomasterelements.odp"))
422 '/// Saving document as <i>user\work\xml\graphics\update\nomasterelements.odp</i> with default presentation document name.
423 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp") , "impress8") = TRUE then
424 '/// Closing document. ///
426 '/// Unpacking the compressed (ZIP) archive.
427 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\") )
428 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
429 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
430 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\styles.xml")) = TRUE then
431 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\meta.xml")) = TRUE then
432 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\content.xml")) = TRUE then
433 '/// Opening exported document (GPF check). ///
434 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp")
436 '/// Closing document. ///
440 warnlog "One of the XML files not well formed!"
445 warnlog "It was not possible to save the document as XML!"
449 '-------------------------------------------------------------------------
451 testcase t_some_header_footer
452 Dim sDrawName as string
453 Dim sElementName as string
454 Dim sAttributeSearch(4) as string
455 Dim sAttributeValue as string
457 Dim iChildsOfAutomaticStyles as integer
458 Dim iLoopSearch as integer
459 printlog "+- Presentation: someheaderfooter_varible.odp"
460 '/// Opening <i>xml\required\input\graphics\header_footer\someheaderfooter_varible.odp</i>.
461 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\someheaderfooter_varible.odp"))
462 '/// Saving document as <i>user\work\xml\graphics\update\someheaderfooter_varible.odp</i> with default presentation document name.
463 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp") , "impress8") = TRUE then
464 '/// Closing document. ///
466 '/// Unpacking the compressed (ZIP) archive.
467 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\") )
468 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
469 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
470 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\styles.xml")) = TRUE then
471 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\meta.xml")) = TRUE then
472 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\content.xml")) = TRUE then
473 '/// Opening exported document (GPF check). ///
474 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp")
476 '/// Closing document. ///
479 '/// Opening user\work\xml\graphics\update\noheaderfooter\content.xml with SAX-parser.
480 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\content.xml"))
482 '///+<li> Parsing to office:document-content
483 For iLoopSearch = 1 to 2
484 SAXSeekElement("office:document-content")
485 '///+ Parsing to office:body
486 SAXSeekElement("office:body")
487 '///+ Parsing to office:presentation
488 SAXSeekElement("office:presentation")
489 '///+ Parsing to draw:page
490 SAXSeekElement("draw:page")
491 '///+ In second loop enter <i>presentation:notes</i> node
492 if iLoopSearch = 2 then
493 SAXSeekElement("presentation:notes")
495 '///+ Get value of draw:style-name
497 sDrawName = SAXGetAttributeValue ("draw:style-name")
498 '///+ Get back to the top of DOM
500 '///+<li> Parsing to office:document-content
501 SAXSeekElement("office:document-content")
502 '///+ Parsing to office:automatic-styles
503 SAXSeekElement("office:automatic-styles")
504 '///+ Look where the style:style element is where the style:name is the same as it was for draw:name
505 iChildsOfAutomaticStyles = SAXGetChildCount
506 'The count of style:style nodes is normaly 7 but the 8th is a text:list-style where
507 'the searched attributes won't be included.
508 for i = 1 to (iChildsOfAutomaticStyles-1)
509 SAXSeekElement("style:style" , i)
510 sElementName = SAXGetAttributeValue("style:name")
511 if sElementName = sDrawName then
512 '///+ If found the named attribute (e.g. dp1) parsing to style:drawing-page-properties.
513 SAXSeekElement("style:drawing-page-properties")
516 if i = iChildsOfAutomaticStyles then
517 '///+ If the style:name is not found a warnlog will be written into the log and the test will be stopped.
518 warnlog "Failed! The style:style='" & sDrawName & "' has not been found in the automatic-styles! Test will be aborted here!"
522 'Go one node to the parent node.
525 if iLoopSearch = 1 then
527 '///+ <li>presentation:display-footer</li>
528 '///+ <li>presentation:footer-decl</li>
529 '///+ <li>presentation:display-page-number</li>
530 '///+ <li>presentation:display-date-time</li></ol>
531 sAttributeSearch(1) = "presentation:display-footer"
532 sAttributeSearch(2) = "presentation:display-page-number"
533 sAttributeSearch(3) = "presentation:display-date-time"
535 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
536 '/// Verifying that the value of <i>presentation:display-footer</i> attribute is 'false'.
538 if sAttributeValue <> "false" then
539 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
541 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
544 '///+ Verifying that the values of <i>presentation:display-page-number</i> and <i>presentation:display-date-time</i> attribute are 'true'.
545 if sAttributeValue <> "true" then
546 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'true'!"
548 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'true'."
552 '///+ Get back to the top of DOM
555 if iLoopSearch = 2 then
556 '///+Parsing to second page-style attributes <ol>
557 '///+ <li>presentation:display-header</li>
558 '///+ <li>presentation:display-footer</li>
559 '///+ <li>presentation:display-page-number</li>
560 '///+ <li>presentation:display-date-time</li></ol>
561 sAttributeSearch(1) = "presentation:display-header"
562 sAttributeSearch(2) = "presentation:display-footer"
563 sAttributeSearch(3) = "presentation:display-page-number"
564 sAttributeSearch(4) = "presentation:display-date-time"
566 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
567 '/// Verifying that the value of <i>presentation:display-page-number</i> and <i>presentation:display-date-time</i> attributes is 'false'.
568 if i = 3 OR i = 4 then
569 if sAttributeValue <> "false" then
570 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
572 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
575 '///+ Verifying that the values of <i>presentation:display-header</i> and <i>presentation:display-footer</i> attribute are 'true'.
576 if sAttributeValue <> "true" then
577 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'true'!"
579 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'true'."
587 warnlog "One of the XML files not well formed!"
592 warnlog "It was not possible to save the document as XML!"
596 '-------------------------------------------------------------------------