'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_01 printlog "-------------------------- SXW7_01.INC ------------------------------" printlog "------------------------ Alien Attributes ---------------------------" call tfiscus call tfiscus2 printlog "---------------------- File Format Changes --------------------------" call tfeat476 call tfeat1318 printlog "---------------------------------------------------------------------" call tcharacters end sub ' '------------------------------------------------------------------------- ' testcase tfiscus 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 Dim iStylesToCount as integer Dim sStyleStyleValueA as string printlog "+- fiscus.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fiscus.sxw")) '/// Saving (and if already exiting overwriting) the document. if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus.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\fiscus.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus.sxw")) sleep(2) call hCloseDocument sleep(2) SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\content.xml")) printlog " ---------------------" printlog " c o n t e n t . x m l" printlog " ---------------------" printlog "-----------------" printlog "Hidden Namespaces" printlog "-----------------" '/// content.xml '/// Hidden Namespaces '///+ Searching for: xmlns:foo="http://www.foo.com" '///+ Searching for: xmlns:bar="http://www.bar.com" /// '------------------------------------------------------------------------- AttributeSearch(1) = "xmlns:foo" AttributeValue(1) = "http://www.foo.com" AttributeSearch(2) = "xmlns:bar" AttributeValue(2) = "http://www.bar.com" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-content") for i = 1 to 2 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i SAXSeekElement("/") printlog " * * *" '/// hidden attributes in a table style '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '/// hidden attributes in a table cell style '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '/// hidden attributes in a paragraph style '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '/// hidden attributes in a text style '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '/// hidden attributes in a frame style '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '------------------------------------------------------------------------- AttributeSearch(1) = "attr1" AttributeValue(1) = "42" AttributeSearch(2) = "foo:attr2" AttributeValue(2) = "43" AttributeSearch(3) = "bar:attr3" AttributeValue(3) = "44" '------------------------------------------------------------------------- for a = 1 to 8 if a = 1 then printlog "----------------------------------" printlog "Hidden attributes in a table style" printlog "----------------------------------" end if if a = 4 then printlog "---------------------------------------" printlog "Hidden attributes in a table cell style" printlog "---------------------------------------" end if if a = 6 then printlog "--------------------------------------" printlog "Hidden attributes in a paragraph style" printlog "--------------------------------------" end if if a = 7 then printlog "---------------------------------" printlog "Hidden attributes in a text style" printlog "---------------------------------" end if if a = 8 then printlog "----------------------------------" printlog "Hidden attributes in a frame style" printlog "----------------------------------" end if if a = 1 or a = 4 or a = 6 or a = 7 or a = 8 then SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") SAXSeekElement("style:style" , a) SAXSeekElement("style:properties") printlog "++ Feature(s) to be searched for:" printlog " |" for i = 1 to 3 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then if a = 1 then warnlog "Hidden attributes (in a table style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if if a = 4 then warnlog "Hidden attributes (in a table cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if if a = 6 then warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if if a = 7 then warnlog "#i74125# - Alien attributes get lost in text style properties." ' warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if if a = 8 then warnlog "Hidden attributes (in a frame style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if end if next i printlog " * * *" end if SAXSeekElement("/") next a SAXRelease() SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\styles.xml")) '------------------------------------------------------------------------- printlog " -------------------" printlog " s t y l e s . x m l" printlog " -------------------" printlog "-----------------" printlog "Hidden Namespaces" printlog "-----------------" '/// STYLES.XML '/// Hidden Namespace '///+ Searching for: xmlns:foo="http://www.foo.com" '///+ Searching for: xmlns:bar="http://www.bar.com" /// '------------------------------------------------------------------------- AttributeSearch(1) = "xmlns:foo" AttributeValue(1) = "http://www.foo.com" AttributeSearch(2) = "xmlns:bar" AttributeValue(2) = "http://www.bar.com" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-styles") for i = 1 to 2 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i SAXSeekElement("/") '------------------------------------------------------------------------- printlog " * * *" printlog "-----------------------------------------------" printlog "Hidden attributes in TEMPLATE STYLE 'Text body'" printlog "-----------------------------------------------" '/// hidden attributes in the template style ´Text body´ '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '------------------------------------------------------------------------- AttributeSearch(1) = "attr1" AttributeValue(1) = "42" AttributeSearch(2) = "foo:attr2" AttributeValue(2) = "43" AttributeSearch(3) = "bar:attr3" AttributeValue(3) = "44" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-styles") SAXSeekElement("office:styles") ' There are 7 style:style elements; it is important to get ' the 'Text body' titled one because it is the onliest which ' has one additional 'style:properties' element. ' Executing SAXSeekElement without having an additional ' element interrupts the test run! for iStylesToCount = 1 to 7 SAXSeekElement("style:style", iStylesToCount) sStyleStyleValueA = SAXGetAttributeValue("style:name") if sStyleStyleValueA = "Text body" then exit for else SAXSeekElement(0) end if next iStylesToCount ' Go into the style:propries element in 'Text body' named style:style element. ' There the three hidden attributes should be stored. SAXSeekElement("style:properties") for i = 1 to 3 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Hidden attributes (in a template style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i '------------------------------------------------------------------------- printlog " * * *" SAXRelease() end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tfiscus2 Dim i as integer Dim xXMLStyleName as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- fiscus2.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fiscus2.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2.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\fiscus2.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2.sxw")) sleep(2) call hCloseDocument sleep(2) SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\content.xml")) printlog " ---------------------" printlog " c o n t e n t . x m l" printlog " ---------------------" printlog "-----------------" printlog "Hidden Namespaces" printlog "-----------------" '/// content.xml '/// Hidden Namespaces '///+ Searching for: xmlns:foo="http://www.foo.com" '///+ Searching for: xmlns:bar="http://www.bar.com" /// '------------------------------------------------------------------------- AttributeSearch(1) = "xmlns:foo" AttributeValue(1) = "http://www.foo.com" AttributeSearch(2) = "xmlns:bar" AttributeValue(2) = "http://www.bar.com" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-content") for i = 1 to 2 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i SAXSeekElement("/") printlog " * * *" printlog "--------------------------------------------------------------------------" printlog "Hidden attributes in text style but a 'span'-item over the whole paragraph" printlog "--------------------------------------------------------------------------" '/// hidden attributes in a text style '///+ where a 'span'-item exists in a whole paragraph. '///+ Searching for: attr1="42" '///+ Searching for: foo:attr2="43" '///+ Searching for: bar:attr3="44" /// '------------------------------------------------------------------------- AttributeSearch(1) = "attr1" AttributeValue(1) = "42" AttributeSearch(2) = "foo:attr2" AttributeValue(2) = "43" AttributeSearch(3) = "bar:attr3" AttributeValue(3) = "44" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") SAXSeekElement("style:style" , 9) SAXSeekElement("style:properties") for i = 1 to 3 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Hidden attributes (in a text style with a 'span'-item over the whole paragraph): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i printlog " * * *" SAXRelease() end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tfeat476 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 "+- feat476.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\feat476.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476.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\feat476.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476.sxw")) sleep(2) call hCloseDocument sleep(2) SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\content.xml")) printlog " ---------------------" printlog " c o n t e n t . x m l" printlog " ---------------------" printlog "-----------------" printlog "Vertical Relation" printlog "-----------------" '/// content.xml '/// Vertical Relation '///+
The style:vertical-rel attribute has a new value "text". '///+ It is used by frames (i.e. images, text-boxes, etc.) that '///+ are bound as characters to specify a vertical alignment '///+ relative to the text height of the line that contains the '///+ frame. '///+ Before this change, the value "char" was used for this '///+ purpose. This lead to an ambiguity, because the same value '///+ is used with a different meaning for frames bound at a character.
'/// Searching for: style:vertical-rel="text" '------------------------------------------------------------------------- AttributeSearch(1) = "style:vertical-rel" AttributeValue(1) = "text" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") SAXSeekElement("style:style") SAXSeekElement("style:properties") for i = 1 to 1 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Vertical Relation (XML file format change 476): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i SAXSeekElement("/") printlog " * * *" SAXRelease() end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tfeat1318 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 "+- feat1318.sxw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\feat1318.sxw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318.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\feat1318.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318") ) if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318.sxw")) sleep(2) call hCloseDocument sleep(2) SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\content.xml")) printlog " ---------------------" printlog " c o n t e n t . x m l" printlog " ---------------------" printlog "-----------------" printlog "Vertical Position" printlog "-----------------" '/// content.xml '/// Vertical Position '///+
The style:vertical-pos attribute that can be attached to the '///+ element of graphic styles has got the new '///+ value "below". It can be used for frames that are bound to a '///+ character only and means that the frame is displayed right '///+ below the anchor character. '///+ The meaning of any other value of the style:vertical-pos '///+ attribute is unchanged. There also was no other way to set '///+ the vertical position of a frame to "below the anchor '///+ character".
'/// Searching for: style:vertical-pos="below" '------------------------------------------------------------------------- AttributeSearch(1) = "style:vertical-pos" AttributeValue(1) = "below" printlog "++ Feature(s) to be searched for:" printlog " |" '------------------------------------------------------------------------- SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") SAXSeekElement("style:style") SAXSeekElement("style:properties") for i = 1 to 1 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Vertical Relation (XML file format change 1318): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i SAXSeekElement("/") printlog " * * *" SAXRelease() end if else call hCloseDocument end if endcase ' '------------------------------------------------------------------------- ' testcase tcharacters Dim a as integer Dim b as integer Dim c as integer Dim g as integer Dim i as integer Dim xXMLStyleName as string Dim xPath as string Dim AttributeSearch(50) as string Dim AttributeValue(50) as string printlog "+- characters.sdw" '/// Opening the characters.sdw file from the input directory. call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\characters.sdw")) '/// Saving the document in OOo XML 1.0 file format. if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) '/// Unpack the complete file (ZIP archieve) into a seperate directory. UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\characters") ) '/// Verifying the wellformness of content.xml, styles.xml and meta.xml. if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else '/// Opening the exported document (GPF-check). call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw")) sleep(2) '/// Closing the document. call hCloseDocument sleep(2) SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\content.xml")) printlog " ---------------------" printlog " c o n t e n t . x m l" printlog " ---------------------" printlog "----------" printlog "Paragraphs" printlog "----------" '------------------------------------------------------------------------- '/// CONTENT.XML '/// Paragraph Style P2 SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p" , 15) xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "text:style-name: " & xXMLStyleName '///+ Searching for: style:text-position="super 90%" '///+ Searching for: style:text-blinking="true" /// AttributeSearch(1) = "style:text-position" AttributeValue(1) = "super 90%" AttributeSearch(2) = "style:text-blinking" AttributeValue(2) = "true" printlog "++ Feature(s) to be searched for:" printlog " |" SAXSeekElement("/") SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") a = SAXGetChildCount for c = 1 to a SAXSeekElement(c) if SAXGetAttributeValue("style:name") = xXMLStyleName then SAXSeekElement("style:properties") for i = 1 to 2 printlog " +- " & AttributeSearch(i) if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then warnlog "Paragraph style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" end if next i c=a end if SAXSeekElement(0) next c SAXSeekElement("/") printlog " * * *" '------------------------------------------------------------------------- printlog "----------" printlog "Textstyles" printlog "----------" printlog "++ Feature(s) to be searched for:" printlog " |" SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p", 12) SAXSeekElement("text:span") xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "text:style-name: " & xXMLStyleName '/// Text Style T8 '///+ Searching for: style:text-outline="true" '///+ Searching for: style:text-crossing-out="single-line" '///+ Searching for: fo:font-size="22pt" '///+ Searching for: fo:text-shadow="1pt 1pt" '///+ Searching for: style:text-underline="single" '///+ Searching for: style:text-underline-color="font-color" /// AttributeSearch(1) = "style:text-outline" AttributeValue(1) = "true" AttributeSearch(2) = "style:text-crossing-out" AttributeValue(2) = "single-line" AttributeSearch(3) = "fo:font-size" AttributeValue(3) = "22pt" AttributeSearch(4) = "fo:text-shadow" AttributeValue(4) = "1pt 1pt" AttributeSearch(5) = "style:text-underline" AttributeValue(5) = "single" AttributeSearch(6) = "style:text-underline-color" AttributeValue(6) = "font-color" SAXSeekElement("/") SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") a = SAXGetChildCount for c = 1 to a SAXSeekElement(c) if SAXGetAttributeValue("style:name") = xXMLStyleName then SAXSeekElement("style:properties") for g = 1 to 6 printlog " +- " & AttributeSearch(g) if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" end if next g c=a end if SAXSeekElement(0) next c printlog " * * *" SAXSeekElement("/") '------------------------------------------------------------------------- printlog "++ Feature(s) to be searched for:" printlog " |" for g = 1 to 3 SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p" , 8) SAXSeekElement(g) xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "text:style-name: " & xXMLStyleName '/// Text Style T5 '///+ Searching for: fo:font-style="italic" /// '/// Text Style T6 '///+ Searching for: fo:font-weight="bold" /// '/// Text Style T7 '///+ Searching for: style:text-underline="single" '///+ Searching for: style:text-underline-color="font-color" /// AttributeSearch(1) = "fo:font-style" AttributeValue(1) = "italic" AttributeSearch(2) = "fo:font-weight" AttributeValue(2) = "bold" AttributeSearch(3) = "style:text-underline" AttributeValue(3) = "single" AttributeSearch(4) = "style:text-underline-color" AttributeValue(4) = "font-color" SAXSeekElement("/") SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") a = SAXGetChildCount for c = 1 to a SAXSeekElement(c) if SAXGetAttributeValue("style:name") = xXMLStyleName then SAXSeekElement("style:properties") if g = 3 then for i = 1 to 2 printlog " +- " & AttributeSearch(i+2) if SAXGetAttributeValue(AttributeSearch(i+2)) <> AttributeValue(i+2) then warnlog "Textstyle: " & AttributeSearch(i+2) & " is not " & AttributeValue(i+2) & "!" end if next i else printlog " +- " & AttributeSearch(g) if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" end if end if c=a end if SAXSeekElement(0) next c SAXSeekElement("/") next g printlog " * * *" SAXSeekElement("/") '------------------------------------------------------------------------- printlog "++ Feature(s) to be searched for:" printlog " |" SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p", 19) xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "paragraph:style-name: " & xXMLStyleName '/// Paragraph Style P3 '///+ Searching in language 01 for : fo:letter-spacing="0.06cm" '///+ Searching in other language for: fo:letter-spacing=" '///+ Searching for: style:letter-kerning="true" '------------------------------------------------------------------------- AttributeSearch(1) = "style:letter-kerning" AttributeValue(1) = "true" AttributeSearch(2) = "fo:letter-spacing" AttributeValue(2) = "0.106cm" SAXSeekElement("/") SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") a = SAXGetChildCount for c = 1 to a SAXSeekElement(c) if SAXGetAttributeValue("style:name") = xXMLStyleName then SAXSeekElement("style:properties") if gLanguage = 1 then b = 2 else b = 1 end if for g = 1 to b printlog " +- " & AttributeSearch(g) if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" end if next g c=a end if SAXSeekElement(0) next c '------------------------------------------------------------------------- printlog " * * *" SAXSeekElement("/") '------------------------------------------------------------------------- printlog "++ Feature(s) to be searched for:" printlog " |" for g = 1 to 2 SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p", 26) SAXSeekElement(g) xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "text:style-name: " & xXMLStyleName '/// Text Style T10 '///+ Searching for: style:text-background-color="#00dcff" /// '/// Text Style T11 '///+ Searching for: style:text-background-color="#ffcc99" /// '------------------------------------------------------------------------- AttributeSearch(1) = "style:text-background-color" AttributeValue(1) = "#00dcff" AttributeSearch(2) = "style:text-background-color" AttributeValue(2) = "#ffcc99" SAXSeekElement("/") SAXSeekElement("office:document-content") SAXSeekElement("office:automatic-styles") a = SAXGetChildCount for c = 1 to a SAXSeekElement(c) if SAXGetAttributeValue("style:name") = xXMLStyleName then SAXSeekElement("style:properties") printlog " +- " & AttributeSearch(g) if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" end if c=a end if SAXSeekElement(0) next c SAXSeekElement("/") next g '------------------------------------------------------------------------- printlog "---------" printlog "O t h e r" printlog "---------" '/// Other (Link) '///+ Searching for: <text:a xlink:type="simple" xlink:href="http://www.hyperlink.de/" office:target-frame-name="_blank" xlink:show="new">Hyperlink</text:a> /// printlog " * * *" SAXSeekElement("/") '------------------------------------------------------------------------- printlog "++ Feature(s) to be searched for:" printlog " |" SAXSeekElement("office:document-content") SAXSeekElement("office:body") SAXSeekElement("text:p", 29) SAXSeekElement("text:a") xXMLStyleName = SAXGetAttributeValue("text:style-name") printlog "text:style-name: " & xXMLStyleName AttributeSearch(1) = "xlink:type" AttributeValue(1) = "simple" AttributeSearch(2) = "xlink:href" AttributeValue(2) = "http://www.hyperlink.de/" AttributeSearch(3) = "office:target-frame-name" AttributeValue(3) = "_blank" AttributeSearch(4) = "xlink:show" AttributeValue(4) = "new" for i = 1 to 4 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then if i = 3 then warnlog "#i80480# Hyperlink attribute office:target-frame-name gets lost sometimes." elseif i = 4 then warnlog "#i80480# Hyperlink attribute xlink:show gets lost sometimes." else warnlog "Other: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" endif end if next i end if SAXRelease() else call hCloseDocument end if endcase