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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: oasis_graphics_01.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-07-11 10:14:45 $
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 : wolfram.garten@sun.com
36 '* short description : Library 01 for OASIS OpenDocument File Format (Presentation and Drawing) test
38 '************************************************************************
40 ' #1 talien_attributes ' Verification that alian attributes will be stored in document.
41 ' #1 t_all_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
42 ' #1 t_no_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
43 ' #1 t_no_header_footer_master_elements ' http://specs.openoffice.org/impress/header_and_footer.sxw
44 ' #1 t_some_header_footer ' http://specs.openoffice.org/impress/header_and_footer.sxw
46 '\***********************************************************************
48 testcase talien_attributes
50 Dim AttrNameInDOM as string
51 Dim sPropertyElement as string
52 Dim sLogAttributeName as string
53 Dim sAttributeSearch(9) as string
54 Dim sAttributeValue(9) as string
56 printlog "+- Presentation: alien.odp"
57 '/// Opening alien.sxi. ///
58 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\alien_attributes\alien_attributes_presentation.odp"))
59 '/// Saving document. ///
60 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp") , "impress8") = TRUE then
61 '/// Closing document. ///
63 '/// Unpacking the compressed (ZIP) archive.
64 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\") )
65 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
66 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
67 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\styles.xml")) = TRUE then
68 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\meta.xml")) = TRUE then
69 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\content.xml")) = TRUE then
70 '/// Opening exported document (GPF check). ///
71 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation.odp")
73 '/// Closing document. ///
76 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\content.xml"))
77 printlog "-----------------"
78 printlog "Hidden Namespaces"
79 printlog "-----------------"
80 '/// <u><b>content.xml</u></b>
81 '/// <u>Hidden attributes in namespaces</u>
82 '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien"
83 '-------------------------------------------------------------------------
84 sAttributeSearch(1) = "xmlns:alien"
85 sAttributeValue(1) = "http://openoffice.org/2000/alien"
86 printlog "++ Feature(s) to be searched for:"
88 '-------------------------------------------------------------------------
89 SAXSeekElement("office:document-content")
90 printlog " +- " & sAttributeSearch(1)
91 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
92 warnlog "Hidden attributes (in namespace): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
96 '/// <u>hidden attributes</u>
97 '///+<ol><li><b>in a drawing-page style</b></li>
98 '///+<li><b>in a graphics style</b></li>
99 '///+<li><b>in a paragraph style (twice)</b></li>
100 '///+<li><b>in a text style</b></li></ol>
101 '///+ Searching for: alien:key="page"
102 '///+ Searching for: alien:key="shape"
103 '///+ Searching for: alien:key="para"
104 '///+ Searching for: alien:key="shape-text"
105 '///+ Searching for: alien:key="text"
107 'The number behind the string variable is the position
108 'in the DOM-tree. The search is hard coded because the
109 'export of the same file should not change in the lifetime
112 sAttributeSearch(1) = "alien:key"
113 sAttributeValue(1) = "page"
115 sAttributeSearch(3) = "alien:key"
116 sAttributeValue(3) = "shape"
118 sAttributeSearch(6) = "alien:key"
119 sAttributeValue(6) = "para"
121 sAttributeSearch(7) = "alien:key"
122 sAttributeValue(7) = "shape-text"
124 sAttributeSearch(9) = "alien:key"
125 sAttributeValue(9) = "text"
126 '-------------------------------------------------------------------------
127 printlog "++ Feature(s) to be searched for:"
129 '-------------------------------------------------------------------------
132 case 1 : printlog "-----------------------------------------"
133 printlog "Hidden attributes in a drawing-page style"
134 printlog "-----------------------------------------"
135 sPropertyElement = "style:drawing-page-properties"
136 sLogAttributeName = "drawing-page"
137 case 3 : printlog "-------------------------------------"
138 printlog "Hidden attributes in a graphics style"
139 printlog "-------------------------------------"
140 sPropertyElement = "style:graphic-properties"
141 sLogAttributeName = "graphics"
142 case 6, 7 : printlog "-------------------------------------------"
143 printlog "Hidden attributes in a paragraph style (" & i-4 & ")"
144 printlog "-------------------------------------------"
145 sPropertyElement = "style:paragraph-properties"
146 sLogAttributeName = "paragraph"
147 case 9 : printlog "---------------------------------"
148 printlog "Hidden attributes in a text style"
149 printlog "---------------------------------"
150 sPropertyElement = "style:text-properties"
151 sLogAttributeName = "text"
153 if i = 1 or i = 3 or i = 6 or i = 7 or i = 9 then
154 'The hidden attributes are in a known sequence included,
155 'so the same routine will be used for different styles!
157 SAXSeekElement("office:document-content")
158 SAXSeekElement("office:automatic-styles")
159 SAXSeekElement("style:style" , i )
160 AttrNameInDOM = SAXGetAttributeValue("style:name")
161 printlog " + style:style position in DOM: " & i & ". Attribute name: " & AttrNameInDOM
164 'It depends on the type of element (drawing-page, paragraphic, graphics, ...)
165 'which is the next element. That is a difference to OOo XML 1.0 where everything
166 'called 'style:properties'.
168 SAXSeekElement(sPropertyElement)
169 printlog " +- " & sAttributeSearch(i)
170 if SAXGetAttributeValue(sAttributeSearch(i)) <> sAttributeValue(i) then
171 warnlog "Hidden attributes (in a " & sLogAttributeName & " style): " & sAttributeSearch(i) & " is not " & sAttributeValue(i) & "!"
177 '-------------------------------------------------------------------------
178 '/// Closing the XML DOM.
180 '/// Opening the DOM of styles.xml.
181 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\alien_attributes_presentation\styles.xml"))
182 '-------------------------------------------------------------------------
183 printlog "-------------------"
184 printlog "s t y l e s . x m l"
185 printlog "-------------------"
186 printlog "-----------------"
187 printlog "Hidden Namespaces"
188 printlog "-----------------"
189 '/// <u><b>styles.xml</u></b>
190 '/// <u>Hidden attributes in namespaces</u>
191 '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien"
192 '-------------------------------------------------------------------------
193 sAttributeSearch(1) = "xmlns:alien"
194 sAttributeValue(1) = "http://openoffice.org/2000/alien"
195 printlog "++ Feature(s) to be searched for:"
197 '-------------------------------------------------------------------------
198 SAXSeekElement("office:document-styles")
199 printlog " +- " & sAttributeSearch(1)
200 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
201 warnlog "Hidden attributes (in namespace): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
205 printlog "----------------------------------------"
206 printlog "Hidden attributes in a master-page style"
207 printlog "----------------------------------------"
208 '-------------------------------------------------------------------------
209 '/// <u>hidden attributes</u>
210 '///+<ol><li><b>in a master-page style</b></li></ol>
211 '///+ Searching for: alien:key="master-page"
212 '-------------------------------------------------------------------------
213 sAttributeSearch(1) = "alien:key"
214 sAttributeValue(1) = "master-page"
215 printlog "++ Feature(s) to be searched for:"
217 '-------------------------------------------------------------------------
218 SAXSeekElement("office:document-styles")
219 SAXSeekElement("office:automatic-styles")
220 SAXSeekElement("style:style")
221 SAXSeekElement("style:drawing-page-properties")
222 printlog " +- " & sAttributeSearch(1)
223 if SAXGetAttributeValue(sAttributeSearch(1)) <> sAttributeValue(1) then
224 warnlog "Hidden attributes (in master-page style): " & sAttributeSearch(1) & " is not " & sAttributeValue(1) & "!"
227 '-------------------------------------------------------------------------
230 warnlog "One of the XML files not well formed!"
235 warnlog "It was not possible to save the document as XML!"
239 '-------------------------------------------------------------------------
241 testcase t_all_header_footer
242 Dim iPresAttr as integer
243 Dim sAttributeSearch(4) as string
244 Dim sAttributeValue(4) as string
245 Dim sHeaderInNotes as string
247 printlog "+- Presentation: allheaderfooter_fixed.odp"
248 '/// Opening <i>xml\required\input\graphics\header_footer\allheaderfooter_fixed.odp</i>.
249 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\allheaderfooter_fixed.odp"))
250 '/// Saving document as <i>user\work\xml\graphics\update\allheaderfooter_fixed.odp</i> with default presentation document name.
251 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp") , "impress8") = TRUE then
252 '/// Closing document.
254 '/// Unpacking the compressed (ZIP) archive. Putting the content to <i>user\work\xml\graphics\update\allheaderfooter_fixed\</i>"
255 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\") )
256 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
257 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
258 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\styles.xml")) = TRUE then
259 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\meta.xml")) = TRUE then
260 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\content.xml")) = TRUE then
261 '/// Opening exported document (GPF check). ///
262 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed.odp")
264 '/// Closing document. ///
267 '/// <u><b>content.xml</u></b>
268 '/// Opening user\work\xml\graphics\update\allheaderfooter_fixed\content.xml with SAX parser.
269 '/// Searching for <ul>
270 '///+<li><presentation:header-decl presentation:name="hdr1">Header in notes/handout powered by QA</presentation:header-decl>
271 '///+<li><presentation:footer-decl presentation:name="ftr1">footer powered by QA</presentation:footer-decl>
272 '///+<li><presentation:footer-decl presentation:name="ftr2">Footer notes/handout powered by QA</presentation:footer-decl>
273 '///+<li><presentation:date-time-decl presentation:name="dtd1" presentation:source="fixed">09.12.2001</presentation:date-time-decl></ul>
274 sAttributeSearch(1) = "presentation:header-decl"
275 sAttributeValue(1) = "Header in notes/handout powered by QA"
276 sAttributeSearch(2) = "presentation:footer-decl"
277 sAttributeValue(2) = "footer powered by QA"
278 sAttributeSearch(3) = "presentation:footer-decl"
279 sAttributeValue(3) = "Footer notes/handout powered by QA"
280 sAttributeSearch(4) = "presentation:date-time-decl"
281 sAttributeValue(4) = "09.12.2001"
283 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\allheaderfooter_fixed\content.xml"))
284 for iPresAttr = 1 to 4
285 '/// Parsing to office:document-content
286 SAXSeekElement("office:document-content")
287 '/// Parsing to office:body
288 SAXSeekElement("office:body")
289 '/// Parsing to office:presentation
290 SAXSeekElement("office:presentation")
291 '/// Parsing to <ol><li>presentation:header-decl</li>
292 '///+ <li>presentation:footer-decl</li>
293 '///+ <li>presentation:footer-decl</li>
294 '///+ <li>presentation:date-time-decl</li></ol>
295 if iPresAttr = 3 then
296 'To reach the second 'presentation:footer-decl'-element an additional parameter is needed.
297 SAXSeekElement(sAttributeSearch(iPresAttr) , 2)
299 SAXSeekElement(sAttributeSearch(iPresAttr))
301 '/// Parsing 1 node deeper (to get the CharNode)
303 '/// Reading the characters of the CharNode and verifying it against the reference.
304 ' Initializing the variable (empty)
306 sHeaderInNotes = SAXGetChars
307 if sHeaderInNotes <> sAttributeValue(iPresAttr) then
308 warnlog "Failed! - Attribute '" & sAttributeSearch(iPresAttr) & "' has the value '" & sHeaderInNotes & "' but it has to be '" & sAttributeValue(iPresAttr) & "'."
310 printlog "Passed. - Attribute '" & sAttributeSearch(iPresAttr) & "' has the correct value '" & sHeaderInNotes & "'."
316 warnlog "One of the XML files not well formed!"
321 warnlog "It was not possible to save the document as XML!"
325 '-------------------------------------------------------------------------
327 testcase t_no_header_footer
328 Dim sDrawName as string
329 Dim sElementName as string
330 Dim sAttributeSearch(3) as string
331 Dim sAttributeValue as string
333 Dim iChildsOfAutomaticStyles as integer
334 printlog "+- Presentation: noheaderfooter.odp"
335 '/// Opening <i>xml\required\input\graphics\header_footer\noheaderfooter.odp</i>.
336 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\noheaderfooter.odp"))
337 '/// Saving document as <i>user\work\xml\graphics\update\noheaderfooter.odp</i> with default presentation document name.
338 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp") , "impress8") = TRUE then
339 '/// Closing document. ///
341 '/// Unpacking the compressed (ZIP) archive.
342 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\") )
343 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
344 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
345 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\styles.xml")) = TRUE then
346 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\meta.xml")) = TRUE then
347 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\content.xml")) = TRUE then
348 '/// Opening exported document (GPF check). ///
349 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter.odp")
351 '/// Closing document. ///
354 '/// Opening user\work\xml\graphics\update\noheaderfooter\content.xml with SAX-parser.
355 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\noheaderfooter\content.xml"))
357 '///+<li> Parsing to office:document-content
358 SAXSeekElement("office:document-content")
359 '///+ Parsing to office:body
360 SAXSeekElement("office:body")
361 '///+ Parsing to office:presentation
362 SAXSeekElement("office:presentation")
363 '///+ Parsing to draw:page
364 SAXSeekElement("draw:page")
365 '///+ Get value of draw:style-name
367 sDrawName = SAXGetAttributeValue ("draw:style-name")
368 '///+ Get back to the top of DOM</li>
370 '///+<li> Parsing to office:document-content
371 SAXSeekElement("office:document-content")
372 '///+ Parsing to office:automatic-styles
373 SAXSeekElement("office:automatic-styles")
374 '///+ Look where the style:style element is where the style:name is the same as it was for draw:name
375 iChildsOfAutomaticStyles = SAXGetChildCount
376 'The count of style:style nodes is normaly 7 but the 8th is a text:list-style where
377 'the searched attributes won't be included.
378 for i = 1 to (iChildsOfAutomaticStyles-1)
379 SAXSeekElement("style:style" , i)
380 sElementName = SAXGetAttributeValue("style:name")
381 if sElementName = sDrawName then
382 '///+ If found the named attribute (e.g. dp1) parsing to style:drawing-page-properties.
383 SAXSeekElement("style:drawing-page-properties")
386 if i = iChildsOfAutomaticStyles then
387 '///+ If the style:name is not found a warnlog will be written into the log and the test will be stopped.
388 warnlog "Failed! The style:style='" & sDrawName & "' has not been found in the automatic-styles! Test will be aborted here!"
392 'Go one node to the parent node.
395 '///+Parsing to <ol><li>presentation:display-footer</li>
396 '///+ <li>presentation:footer-decl</li>
397 '///+ <li>presentation:display-page-number</li>
398 '///+ <li>presentation:display-date-time</li></ol>
399 sAttributeSearch(1) = "presentation:display-footer"
400 sAttributeSearch(2) = "presentation:display-page-number"
401 sAttributeSearch(3) = "presentation:display-date-time"
403 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
404 '///+ Verifying that the value of each attribute is 'false'.</li></ol>
405 if sAttributeValue <> "false" then
406 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
408 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
413 warnlog "One of the XML files not well formed!"
418 warnlog "It was not possible to save the document as XML!"
422 '-------------------------------------------------------------------------
424 testcase t_no_header_footer_master_elements
425 printlog "+- Presentation: nomasterelements.odp"
426 '/// Opening <i>xml\required\input\graphics\header_footer\nomasterelements.odp</i>.
427 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\nomasterelements.odp"))
428 '/// Saving document as <i>user\work\xml\graphics\update\nomasterelements.odp</i> with default presentation document name.
429 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp") , "impress8") = TRUE then
430 '/// Closing document. ///
432 '/// Unpacking the compressed (ZIP) archive.
433 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\") )
434 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
435 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
436 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\styles.xml")) = TRUE then
437 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\meta.xml")) = TRUE then
438 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements\content.xml")) = TRUE then
439 '/// Opening exported document (GPF check). ///
440 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\nomasterelements.odp")
442 '/// Closing document. ///
446 warnlog "One of the XML files not well formed!"
451 warnlog "It was not possible to save the document as XML!"
455 '-------------------------------------------------------------------------
457 testcase t_some_header_footer
458 Dim sDrawName as string
459 Dim sElementName as string
460 Dim sAttributeSearch(4) as string
461 Dim sAttributeValue as string
463 Dim iChildsOfAutomaticStyles as integer
464 Dim iLoopSearch as integer
465 printlog "+- Presentation: someheaderfooter_varible.odp"
466 '/// Opening <i>xml\required\input\graphics\header_footer\someheaderfooter_varible.odp</i>.
467 call hFileOpen (gTesttoolPath & ConvertPath("xml\required\input\graphics\header_footer\someheaderfooter_varible.odp"))
468 '/// Saving document as <i>user\work\xml\graphics\update\someheaderfooter_varible.odp</i> with default presentation document name.
469 if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp") , "impress8") = TRUE then
470 '/// Closing document. ///
472 '/// Unpacking the compressed (ZIP) archive.
473 UnpackStorage( gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp") , gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\") )
474 '/// Verifying the well-formness of styles.xml, content.xml and meta.xml.
475 '///+ Only if the three XML files are well formed the next checks (GPF-check, attribute-search) will be started.
476 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\styles.xml")) = TRUE then
477 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\meta.xml")) = TRUE then
478 if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\content.xml")) = TRUE then
479 '/// Opening exported document (GPF check). ///
480 call hFileOpen (gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible.odp")
482 '/// Closing document. ///
485 '/// Opening user\work\xml\graphics\update\noheaderfooter\content.xml with SAX-parser.
486 SAXReadFile(gOfficePath & ConvertPath("user\work\xml\graphics\update\someheaderfooter_varible\content.xml"))
488 '///+<li> Parsing to office:document-content
489 For iLoopSearch = 1 to 2
490 SAXSeekElement("office:document-content")
491 '///+ Parsing to office:body
492 SAXSeekElement("office:body")
493 '///+ Parsing to office:presentation
494 SAXSeekElement("office:presentation")
495 '///+ Parsing to draw:page
496 SAXSeekElement("draw:page")
497 '///+ In second loop enter <i>presentation:notes</i> node
498 if iLoopSearch = 2 then
499 SAXSeekElement("presentation:notes")
501 '///+ Get value of draw:style-name
503 sDrawName = SAXGetAttributeValue ("draw:style-name")
504 '///+ Get back to the top of DOM
506 '///+<li> Parsing to office:document-content
507 SAXSeekElement("office:document-content")
508 '///+ Parsing to office:automatic-styles
509 SAXSeekElement("office:automatic-styles")
510 '///+ Look where the style:style element is where the style:name is the same as it was for draw:name
511 iChildsOfAutomaticStyles = SAXGetChildCount
512 'The count of style:style nodes is normaly 7 but the 8th is a text:list-style where
513 'the searched attributes won't be included.
514 for i = 1 to (iChildsOfAutomaticStyles-1)
515 SAXSeekElement("style:style" , i)
516 sElementName = SAXGetAttributeValue("style:name")
517 if sElementName = sDrawName then
518 '///+ If found the named attribute (e.g. dp1) parsing to style:drawing-page-properties.
519 SAXSeekElement("style:drawing-page-properties")
522 if i = iChildsOfAutomaticStyles then
523 '///+ If the style:name is not found a warnlog will be written into the log and the test will be stopped.
524 warnlog "Failed! The style:style='" & sDrawName & "' has not been found in the automatic-styles! Test will be aborted here!"
528 'Go one node to the parent node.
531 if iLoopSearch = 1 then
533 '///+ <li>presentation:display-footer</li>
534 '///+ <li>presentation:footer-decl</li>
535 '///+ <li>presentation:display-page-number</li>
536 '///+ <li>presentation:display-date-time</li></ol>
537 sAttributeSearch(1) = "presentation:display-footer"
538 sAttributeSearch(2) = "presentation:display-page-number"
539 sAttributeSearch(3) = "presentation:display-date-time"
541 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
542 '/// Verifying that the value of <i>presentation:display-footer</i> attribute is 'false'.
544 if sAttributeValue <> "false" then
545 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
547 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
550 '///+ Verifying that the values of <i>presentation:display-page-number</i> and <i>presentation:display-date-time</i> attribute are 'true'.
551 if sAttributeValue <> "true" then
552 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'true'!"
554 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'true'."
558 '///+ Get back to the top of DOM
561 if iLoopSearch = 2 then
562 '///+Parsing to second page-style attributes <ol>
563 '///+ <li>presentation:display-header</li>
564 '///+ <li>presentation:display-footer</li>
565 '///+ <li>presentation:display-page-number</li>
566 '///+ <li>presentation:display-date-time</li></ol>
567 sAttributeSearch(1) = "presentation:display-header"
568 sAttributeSearch(2) = "presentation:display-footer"
569 sAttributeSearch(3) = "presentation:display-page-number"
570 sAttributeSearch(4) = "presentation:display-date-time"
572 sAttributeValue = SAXGetAttributeValue(sAttributeSearch(i))
573 '/// Verifying that the value of <i>presentation:display-page-number</i> and <i>presentation:display-date-time</i> attributes is 'false'.
574 if i = 3 OR i = 4 then
575 if sAttributeValue <> "false" then
576 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'false'!"
578 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'false'."
581 '///+ Verifying that the values of <i>presentation:display-header</i> and <i>presentation:display-footer</i> attribute are 'true'.
582 if sAttributeValue <> "true" then
583 warnlog "Failed! The value of '" & sAttributeSearch(i) & "' is NOT 'true'!"
585 printlog "Passed. The value of '" & sAttributeSearch(i) & "' is 'true'."
593 warnlog "One of the XML files not well formed!"
598 warnlog "It was not possible to save the document as XML!"
602 '-------------------------------------------------------------------------