Hi Dave,

Dave Pawson wrote:
>> Do you (or anyone) know if the original script/stylesheet used by the ODF
>> spec guys is available? Or where I could start looking for a sample
>> style-based export filter stylesheet?
> 
> Ask Michael nicely?
> 
> or see
> http://www.oasis-open.org/committees/office/faq.php
> 
> where the 1.0 schemas are linked from?
> 
> I'm sure google can find the 1.1 files.

I'm not interested in the schema itself, but in the process of extracting
it.. I hacked up the stylesheet below that does that (barely).

unzip -p OpenDocument-v1.1-cs1.odt content.xml |xsltproc
extract-schema.xsl - |sed -e 's/^      //' > schema.rng

The sed hack is because I can't seem to convince xsltproc not to indent six
spaces. It's probably obvious I'm not a xslt guru :)

Cheers,

    Rob



<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
               
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
                xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0">

  <xsl:output method="text" indent="no"/>

  <xsl:template match="office:document-content">
    <xsl:apply-templates select="office:body"/>
  </xsl:template>

  <xsl:template match="office:body">
    <xsl:apply-templates select="office:text"/>
  </xsl:template>

  <xsl:template match="office:text">
    <xsl:apply-templates select="text:p"/>
  </xsl:template>

  <xsl:template match="text:p">
    <xsl:if test="@text:style-name='RelaxNG'">
      <xsl:apply-templates select="text:tab"/>

      <xsl:value-of select="."/>
      <xsl:text>
      </xsl:text>
    </xsl:if>
  </xsl:template>

  <xsl:template match="text:tab">
    <xsl:text>    </xsl:text>
  </xsl:template>
</xsl:stylesheet>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to