On May 3, 2007, at 12:03 PM, ccbranham wrote:

I'd like to create a transformation that works with OO Writer to export a document to a simple XML format (stripping out all the style information and metadata and retaining just the structure of the document). I can't seem even to get it started, so was wondering if someone had a simple XSLT example that I could study or knew where I could find one.

Let's say you want to strip the child nodes (but retain the text) of the following paragraphs:

<doc>
  <para>some <span>text</span>.</para>
  <para>some <span>more text</span>.</para>
</doc>

Just do:

<xsl:template match="doc">
  <document>
     <xsl:apply-templates/>
  </document>
</xsl:template>

<xsl:template match="para">
  <p>
    <xsl:apply-templates/>
  </p>
</xsl:template>

<xsl:template match="span">
  <xsl:apply-templates/>
</xsl:template>

That might get you started (though you'll have to figure out namespace binding!).

Bruce

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

Reply via email to