Hi Michael,
Michael Wechner wrote:
Hi
I would like to do something as follows:
"Customer: Sun-Microsystems"
whereas my XSLT is as follows
<xsl:template match="invoice:customer">
<text:p text:style-name="PCustomer">
Customer: <text:span
text:style-name="TCustomerID"><xsl:value-of select="@id"/></text:span>
</text:p>
</xsl:template>
which means the XML looks like <invoice:customer id="Sun-Microsystems"/>
but it seems to me that one can only attach a display-name in the case
of style:family="paragraph" and not style:family="text".
Is that correct? (I didn't find anything within the v1.0 spec re this)
No, style:family="text" and style:display-name can occur together.
Easiest way to find something out as this, is to download the extracted
RelaxNG of the spec from:
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
or directly from:
http://www.oasis-open.org/committees/download.php/12571/OpenDocument-schema-v1.0-os.rng
There you will find the following, if you search for style:family and
style:display-name. Both occur beyond style:style.
<define name="style-style">
<element name="style:style">
<ref name="style-style-attlist"/>
<ref name="style-style-content"/>
<zeroOrMore>
<ref name="style-map"/>
</zeroOrMore>
</element>
</define>
..
<define name="style-style-attlist" combine="interleave">
<optional>
<attribute name="style:display-name">
<ref name="string"/>
</attribute>
</optional>
</define>
The reason you might have overseen it in the spec is probably that
style:family although an attribute is part of the style-style-content as
it's value has dependencies to the content.
For example in a style:family="text" only style text properties can be
found.
<define name="style-style-content" combine="choice">
<group>
<attribute name="style:family">
<value>text</value>
</attribute>
<optional>
<ref name="style-text-properties"/>
</optional>
</group>
</define>
Where in style:family="paragraph" it extents it with style paragraph
properties.
<define name="style-style-content" combine="choice">
<group>
<attribute name="style:family">
<value>paragraph</value>
</attribute>
<optional>
<ref name="style-paragraph-properties"/>
</optional>
<optional>
<ref name="style-text-properties"/>
</optional>
</group>
</define>
For a living proof, download the OD spec
http://www.oasis-open.org/committees/download.php/12573/OpenDocument-v1.0-os.sxw
and save it as ODT and take a look in the XML, there the combination in
question occurs.
PS: You might use style inheritance as occured in this doc to solve your
problem.
- Svante
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]