Re: converting omf files



On Sat, May 04, 2002 at 02:26:56AM -0700, Chris Lyttle wrote:
> John,
> It seems to me in the quick test I did on this that the file produced is
> a start for the new format and quite a bit still has to be added, is
> that correct?
> 

Chris -

If you have a "complete" old OMF file (see
http://scrollkeeper.sourceforge.net/documentation/writing_scrollkeeper_omf_files/ar01s06.html
for an example) then the resulting OMF file also will be complete, but
many of them are lacking elements which you'll have to add in
manually, yeah.




> PS It took me a bit of combing thru the SK mailing list to find the info
> I needed about how to put together a OMF system for the docs, perhaps we
> could use a 'HOWTO' for this sort of like what Sasha wrote for getting
> docbook xml to work? Any takers?
> 

That'd be great if someone has the time.

John

> On Mon, 2002-04-22 at 20:25, John Fleck wrote:
> > Folks -
> > 
> > I've made an xsl stylesheet to convert old OMF files to the form
> > required by ScrollKeeper's new dtd. This is tested against some of my
> > old files, and also against Dan's "Complete OMF File" example (which
> > is of the old type):
> > 
> > http://scrollkeeper.sourceforge.net/documentation/writing_scrollkeeper_omf_files/ar01s06.html
> > 
> > Run this using xsltproc at the command line:
> > 
> > [jfleck jelloiii omfexamples]$ xsltproc omftransform.xsl complete.omf > testout.omf
> > 
> > Then by all means, you should validate the resulting output:
> > 
> > [jfleck jelloiii omfexamples]$ xmllint --noout --dtdvalid /usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd testout.omf 
> > 
> > Suggestions welcome, as my xslt skills are modest at best.
> > 
> 
> > <?xml version="1.0"?>
> > <xsl:stylesheet id="omf"
> >   version="1.0"
> >   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >    <xsl:strip-space elements="*"/>
> >    
> >    <xsl:template match="omf">
> >      <xsl:element name="omf">
> >        <xsl:text>
> >        </xsl:text>
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >    </xsl:template>
> > 
> >  
> >    <xsl:template match="resource">
> >      <xsl:element name="resource">
> >        <xsl:text>
> >        </xsl:text>
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >    
> >    <xsl:template match="creator">
> >      <xsl:element name="creator">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="maintainer">
> >      <xsl:element name="maintainer">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="contributor">
> >      <xsl:element name="contributor">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="type">
> >      <xsl:element name="type">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="title">
> >      <xsl:element name="title">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="date">
> >      <xsl:element name="date">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="version">
> >      <version xsl:use-attribute-sets="version-atts">
> >        
> >      </version>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:attribute-set name="version-atts">
> >      <xsl:attribute name="identifier"><xsl:value-of select="normalize-space(identifier)"/></xsl:attribute>
> >      <xsl:attribute name="date"><xsl:value-of select="normalize-space(date)"/></xsl:attribute>
> >      <xsl:attribute name="description"><xsl:value-of select="normalize-space(description)"/></xsl:attribute>
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="subject">
> >      <subject xsl:use-attribute-sets="subject-atts">
> >      
> >      </subject>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >   
> >    <xsl:attribute-set name="subject-atts">
> >      <xsl:attribute name="category"><xsl:value-of select="normalize-space(category)"/></xsl:attribute>
> > 
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="description">
> >      <xsl:element name="description">
> >        <xsl:apply-templates/>
> >      </xsl:element>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:template match="format">
> >      <format xsl:use-attribute-sets="format-atts">
> >        
> >      </format>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >   
> >    <xsl:attribute-set name="format-atts">
> >      <xsl:attribute name="mime"><xsl:value-of select="@mime"/></xsl:attribute>
> >      <xsl:attribute name="dtd"><xsl:value-of select="@dtd"/></xsl:attribute>
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="identifier">
> >      <identifier xsl:use-attribute-sets="identifier-atts">
> >      
> >      </identifier>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >    
> >    <xsl:attribute-set name="identifier-atts">
> >      <xsl:attribute name="url"><xsl:value-of select="@url"/></xsl:attribute>
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="relation">
> >      <relation xsl:use-attribute-sets="relation-atts">
> >        
> >      </relation>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >    
> >    <xsl:attribute-set name="relation-atts">
> >      <xsl:attribute name="seriesid"><xsl:value-of select="@seriesid"/></xsl:attribute>
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="language">
> >      <language xsl:use-attribute-sets="language-atts">
> >      
> >      </language>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> >   
> >    <xsl:attribute-set name="language-atts">
> >      <xsl:attribute name="code"><xsl:value-of select="@code"/></xsl:attribute>
> >    </xsl:attribute-set>
> > 
> >    <xsl:template match="rights">
> >      <rights xsl:use-attribute-sets="rights-atts">
> >      
> >      </rights>
> >      <xsl:text>
> >      </xsl:text>
> >    </xsl:template>
> > 
> >    <xsl:attribute-set name="rights-atts">
> >      <xsl:attribute name="type"><xsl:value-of select="normalize-space(type)"/></xsl:attribute>
> >      <xsl:attribute name="license.version"><xsl:value-of select="normalize-space(license.version)"/></xsl:attribute>
> >      <xsl:attribute name="holder"><xsl:value-of select="normalize-space(holder)"/></xsl:attribute>
> >    </xsl:attribute-set>
> >    
> >  </xsl:stylesheet>
> 
> 
> _______________________________________________
> gnome-doc-list mailing list
> gnome-doc-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-doc-list
> 

-- 
John Fleck
jfleck inkstain net (h) jfleck abqjournal com (w)
http://www.inkstain.net http://www.abqjournal.com

"You don't want to die with the music still in you."
 - John Gardner



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]