'encoding UTF-8 Do not remove or change this line! '************************************************************************** * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * '/************************************************************************ '* '* owner : helge.delfs@sun.com '* '* 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