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


Help: OASIS Mailing Lists Help | MarkMail Help

office message

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

Subject: Re: [office] Groups - Draft 29 with change tracking information(office-spec-1.0-draft29-ct.sxw) modified


thank you for reporting the unnecessary style information in the paragraphs 
that contain the Relax-NG schema. I agree that they make it a little bit more 
difficult to extract the schema, but I would not consider them to be errors. 
However, we should remove the unnecessary styling information for one of the 
next documents.

I have attached the XSLT stylesheet that I'm using to extract the schema 
below, and did not encounter any problems with the extracted schema.

Please note that the schema did not change between OpenDocument 1.0 and 
OpenDocument 1.0 (2nd edition). This means that the schemas that are 
available at the TC's web page remain valid.

Best regards


Dave Pawson wrote On 05/27/06 16:45,:
> Having cleaned that last error (the spans)
> the following style sheet will extract the schema, as a valid RNG schema.
> I've also used an identity transform to clean it up and indent it for
> readability.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"

   <xsl:output method="text"/>

   <!-- which paragraph styles do we wish to extract? -->
   <xsl:param name="style" select="'RelaxNG'"/>
   <xsl:param name="style2" select="'Changed Relax NG'"/>

   <!-- default: don't output anything -->
   <xsl:template match="text()"/>

   <!-- paragraph with the proper style found? Then generate output! -->
   <xsl:template match="text:p">

     <!-- determine all parent styles of this paragraph; use key 'parents' -->
     <xsl:variable name="parents"
       select="@text:style-name |
               key('parents',@text:style-name) |
               key('parents',key('parents',@text:style-name)) |

     <!-- if proper parent style is found, generate output! -->
     <xsl:if test="$parents = $style or $parents = $style2">
       <xsl:apply-templates mode="output"/>

   <xsl:key name="parents"
     use="../@style:name" />

   <!-- generate output: just copy all text we find -->
   <xsl:template mode="output">

   <xsl:template mode="output" match="text()">

   <!-- white space handling: <text:s>, <text:tab> elements  -->
   <xsl:template mode="output" match="text:tab-stop">
     <xsl:text>    </xsl:text>

   <xsl:template mode="output" match="text:s">
     <xsl:call-template name="repeat">
       <xsl:with-param name="count" select="@text:c"/>
       <xsl:with-param name="string" select="' '"/>

   <xsl:template name="repeat">
     <xsl:param name="count"/>
     <xsl:param name="string"/>
     <xsl:if test="$count > 0">
       <xsl:value-of select="$string"/>
       <xsl:call-template name="repeat">
         <xsl:with-param name="count" select="$count -1"/>
         <xsl:with-param name="string" select="$string"/>


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