'encoding UTF-8 Do not remove or change this line! '************************************************************************* ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************************* '* '* short description : XML Writer Include File '* '\*********************************************************************************** Dim Isliste(250) as string Dim OutputPath as string sub sxw7_02 printlog "-------------------------- SXW7_02.INC ------------------------------" call tframes call hEnablePrettyPrinting(1) printlog "--------------------------- C J K ------------------------------" call tschina call ttchina call tkorean call tjapan end sub ' '------------------------------------------------------------------------- ' testcase tframes 'NOTE: This test has been created as there were no SAX parser available for using ' in testtools. It is very (!) time consuming to debug this routines. ' Feel free to contact me if there is any issue with this script! jsi@openoffice.org Dim Searchstring(20) as string Dim StyleBodyA as string Dim StyleDefinitionA as string Dim i as integer Dim a as integer Dim AdditionalParameter as string '/// Disabling the 'pretty printing' functionality. call hEnablePrettyPrinting() printlog "+- frames.sdw" '/// Opening frames.sdw from input directory. call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\frames.sdw")) '/// Saving document as OOo XML 1.0 file. if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) '/// Unpacking the file (ZIP archieve) into a seperate directory. UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\frames") ) '/// Verifying well-formness of content.xml, styles.xml and meta.xml. if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw")) sleep(2) call hCloseDocument sleep(2) printlog "-------------------------------------------------------------------------" Searchstring(1) = " 12 then printlog " +- " & Searchstring(i) if InStr (StyleDefinitionA , Searchstring(i)) = 0 then warnlog "Frame Style: " & Searchstring(i) & " not found!" end if end if Next i end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tschina Dim i as integer Dim a as integer Dim xXMLStyleName as string Dim xPath as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- zh_cn_text.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\zh_cn_text.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw")) sleep(2) call hCloseDocument sleep(2) end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase ttchina Dim i as integer Dim a as integer Dim xXMLStyleName as string Dim xPath as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- zh_tw_text.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\zh_tw_text.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw")) sleep(2) call hCloseDocument sleep(2) end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tkorean Dim i as integer Dim a as integer Dim xXMLStyleName as string Dim xPath as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- ko_text.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\ko_text.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw")) sleep(2) call hCloseDocument sleep(2) end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tjapan Dim i as integer Dim a as integer Dim xXMLStyleName as string Dim xPath as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- jp_text.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\jp_text.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw")) sleep(2) call hCloseDocument sleep(2) end if else call hCloseDocument end if endcase