OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

opendocument-users message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: (No subject header)


I've got an application that inserts tables into an existing
odt file (oo 2.0).

The spec document (OpenDocument-v1.0-os.sxw) in section
8.2.1 on page 188 shows a code snippet that has a table
style declaration and then the table code.

I'd like to be able to define styles outside of styles.xml
or <office:automatic-styles>. It would be great if I could
define the style right before the table definition (as in
the example). However, I can't get it to work.

Am I reading the spec to literally? Can styles be defined
right before the table?

Below is the content.xml file that I've been unsuccessfully
testing with. Any suggestions?

Thanks in advance,

Max

-- snip here --
<?xml version="1.0" encoding="UTF-8"?>

<office:document-content
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:dc="http://purl.org/dc/elements/1.1/";
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
xmlns:math="http://www.w3.org/1998/Math/MathML";
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
xmlns:ooo="http://openoffice.org/2004/office";
xmlns:ooow="http://openoffice.org/2004/writer";
xmlns:oooc="http://openoffice.org/2004/calc";
xmlns:dom="http://www.w3.org/2001/xml-events";
xmlns:xforms="http://www.w3.org/2002/xforms";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
office:version="1.0">
 <office:scripts/>
 <office:font-face-decls>
  <style:font-face style:name="Tahoma1"
svg:font-family="Tahoma"/>
  <style:font-face style:name="Arial Unicode MS"
svg:font-family="&apos;Arial Unicode MS&apos;"
style:font-pitch="variable"/>
  <style:font-face style:name="Tahoma"
svg:font-family="Tahoma" style:font-pitch="variable"/>
  <style:font-face style:name="Times New Roman"
svg:font-family="&apos;Times New Roman&apos;"
style:font-family-generic="roman"
style:font-pitch="variable"/>
 </office:font-face-decls>
 <office:automatic-styles>
  <style:style style:name="BasicTable2"
style:family="table">
   <style:table-properties style:width="6.925in"
table:align="margins"/>
  </style:style>
  <style:style style:name="BasicTable2.A"
style:family="table-column">
   <style:table-column-properties
style:column-width="3.4625in"
style:rel-column-width="32767*"/>
  </style:style>
  <style:style style:name="BasicTable2.B"
style:family="table-column">
   <style:table-column-properties
style:column-width="3.4625in"
style:rel-column-width="32768*"/>
  </style:style>
  <style:style style:name="T1" style:family="text">
   <style:text-properties fo:color="#ff0000"/>
  </style:style>
 </office:automatic-styles>
 <office:body>
  <office:text>
   <text:sequence-decls>
    <text:sequence-decl text:display-outline-level="0"
text:name="Illustration"/>
    <text:sequence-decl text:display-outline-level="0"
text:name="Table"/>
    <text:sequence-decl text:display-outline-level="0"
text:name="Text"/>
    <text:sequence-decl text:display-outline-level="0"
text:name="Drawing"/>
   </text:sequence-decls>
   <text:p text:style-name="Standard"/>
  <style:style style:name="BasicTable" style:family="table">
   <style:table-properties style:width="4in"
table:align="margins"/>
  </style:style>
  <style:style style:name="BasicTable.A"
style:family="table-column">
   <style:table-column-properties style:column-width="2in"
/>
  </style:style>
  <style:style style:name="BasicTable.B"
style:family="table-column">
   <style:table-column-properties style:column-width="2in"
/>
  </style:style>
  <style:style style:name="T1" style:family="text">
   <style:text-properties fo:color="#ff0000"/>
  </style:style>   
   <table:table table:name="BasicTable"
table:style-name="Table1">
    <table:table-column table:style-name="BasicTable.A"/>
    <table:table-column table:style-name="BasicTable.B"/>
    <table:table-row>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard">0.2 </text:p>
     </table:table-cell>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard">setosa </text:p>
     </table:table-cell>
    </table:table-row>
    <table:table-row>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard">0.2 </text:p>
     </table:table-cell>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard">setosa </text:p>
     </table:table-cell>
    </table:table-row>
    <table:table-row>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard">0.2 </text:p>
     </table:table-cell>
     <table:table-cell office:value-type="string">
      <text:p text:style-name="Standard"><text:span
text:style-name="T1">setosa</text:span> </text:p>
     </table:table-cell>
    </table:table-row>
   </table:table>
   <text:p text:style-name="Standard"/>
  </office:text>
 </office:body>
</office:document-content>




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]