Hi All!

I just read on slashdot, that M$ published the XML Schema for their new Office 2003 Suite (mostly Word related) including documentation:
http://isb.oio.dk/info/news/wordml+published.htm


According to http://rep.oio.dk/Microsoft.com/officeschemas/LegalNotice.htm they are even redistributable without fee, but I don't know, if that's relevant for us.

I experimented a bit with with it and added a hello world example for Word 2003 ML (see attachments for the results).

I don't know if it's worth adding it to CVS, but if you like, feel free to do so ;-)

Enjoy!

--
Andreas Hochsteger
http://highstick.blogspot.com/
<?xml version="1.0" encoding="iso-8859-1"?>

<!-- CVS $Id: samples.xml,v 1.11 2003/09/08 05:37:33 bdelacretaz Exp $ -->

<samples name="Hello, World!">

  <group name="Back">
   <sample name="Back" href="../">
    Back to the samples home page.
   </sample>
  </group>

  <group name="About">
   <note>All examples on this page have been created using a single data source,
   hello.xml file.
   </note>
   <sample name="XML" href="hello.xml">
    Hello world XML document.
   </sample>
  </group>

  <group name="Multichannel Hello World!">
   <sample name="HTML" href="hello.html">
    This page shows how a simple XML page can be presented in HTML.
   </sample>
   <sample name="XHTML" href="hello.xhtml">
    This is the same page as above, but rendered in XHTML (which is the 
    well-formed XML version of HTML). Note that both the page and the
    stylesheet used to transform it didn't change from the previous
    example, Cocoon does everything for you by setting a different serializer.
   </sample>
   <sample name="WML" href="hello.wml">
    By changing the stylesheet, it's possible to render the same content
    for consumption on different devices. Here, for example, it's rendered
    in WML (Wireless Markup Language) which is the markup language used
    in WAP-enabled agents (such as PDA or cell phones).
   </sample>
   <sample name="CHTML" href="hello.chtml">
    Or, as CHTML (Compact HTML), which is used by i-Mode compatible cell phones.
   </sample>
   <sample name="SVG" href="hello.svg">
    Given the power of XSLT and the fact that many presentation languages are
    based on the XML syntax, it is possible to generate even vector graphics
    from your content. Here is an example that renders to  SVG (Scalable Vector
    Graphics). (You need an SVG plugin, or an SVG-capable browser to see this.)
   </sample>   
   <sample name="Plain Text" href="hello.txt">
    Sometimes you don't need to be very fancy, so here is a plain text
    version of your content.
   </sample>
   <sample name="VRML" href="hello.wrl">
    But sometimes you need to be fancy to impress people, so here is a 3D
    version of your content (you need a VRML plugin in your browser to visualize
    this).
   </sample>
   <sample name="VoiceML" href="hello.vml">
    Or sometimes you don't even have a display in front of you, so you want to
    hear your content, so here is a VoiceML representation of your content (you 
    need a VoiceML-capable agent to hear this).
   </sample>
   <sample name="Zip archive" href="hello.zip">
    Or you might want your information nicely packaged as a zip file.
   </sample>
  </group>

  <group name="Hello Office!">
   <sample name="OpenOffice Writer" href="hello.sxw">
    This document shows how a simple XML page can be presented in OpenOffice Writer file format.
   </sample>
   <sample name="OpenOffice Calc" href="hello.sxc">
    This spreadsheet shows how a simple XML page can be presented in OpenOffice Calc file format.
   </sample>
   <sample name="OpenOffice Impress" href="hello.sxi">
    This presentation shows how a simple XML page can be presented in OpenOffice Impress file format.
   </sample>
   <sample name="OpenOffice Draw" href="hello.sxd">
    This drawing shows how a simple XML page can be presented in OpenOffice Draw file format.
   </sample>
   <sample name="M$ Office Word" href="hello-wordml.doc">
    This document shows how a simple XML page can be presented in M$ Word 2003 file format.
   </sample>
  </group>

  <group name="Hello World Web Service">
   <sample name="Web Service" href="hello.service">
    Here is a super-simple web service that says hi!
   </sample>
   <sample name="Web Service WSDL Descriptor" href="hello.service/WSDL">
    And this is the corresponding WSDL descriptor.
   </sample>
  </group>

  <group name="Blocks Hello World!">
   <note>
	These samples only work if the corresponding blocks are activated
	at build time. 
   </note>
   <sample name="RTF" href="../jfor/hello.rtf">
    Hello from the jfor block in Rich Text Format.
   </sample>
   <sample name="PDF" href="../fop/hello.pdf">
    Hello from the fop block in Portable Document Format.
   </sample>
   <sample name="PDF" href="../itext/hello.pdf">
    Another hello in Portable Document Format, from the itext block.
   </sample>
   <sample name="JPEG" href="../batik/hello.jpeg">
    Hello from the batik block in JPEG.
   </sample>
   <sample name="PNG" href="../batik/hello.png">
    Hello from the batik block in PNG.
   </sample>
   <sample name="SWF" href="../swf/hello.swf">
    Flashy hello from swf block! You need the appropriate (flash) plugin for your browser.
   </sample>
   <sample name="XLS" href="../poi/hello.xls">
    Hello in Excel spreadsheet format from the POI block.
   </sample>
   <sample name="HTML" href="../stx/hello.html">
    Hello in the HTML format, but now with help from stx block.
   </sample>
  </group>
</samples>
<?xml version="1.0"?>

<!-- CVS $Id: sitemap.xmap,v 1.12 2003/07/29 03:15:47 vgritsenko Exp $ -->

<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>

<!-- =========================== Views =================================== -->

 <map:views>
  <map:view name="content" from-label="content">
   <map:serialize type="xml"/>
  </map:view>

  <map:view from-label="content" name="pretty-content">
    <map:transform src="context://stylesheets/system/xml2html.xslt"/>
    <map:serialize type="html"/>
  </map:view>

  <map:view name="links" from-position="last">
   <map:serialize type="links"/>
  </map:view>
 </map:views>

<!-- =========================== Pipelines ================================= -->

 <map:pipelines>
  <map:pipeline>

   <map:match pattern="">
     <map:generate src="samples.xml"/>
     <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl">
       <map:parameter name="contextPath" value="{request:contextPath}"/>
     </map:transform>
     <map:serialize/>
   </map:match>
   
   <map:match pattern="hello.xml">
    <map:generate src="content/hello.xml"/>
    <map:serialize type="xml"/>
   </map:match>

   <map:match pattern="hello.html">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2html.xsl"/>
    <map:serialize type="html"/>
   </map:match>

   <map:match pattern="hello.xhtml">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2html.xsl"/>
    <map:serialize type="xhtml"/>
   </map:match>

   <map:match pattern="hello.txt">
    <map:generate src="content/hello.xml"/>
    <map:serialize type="text"/>
   </map:match>

   <map:match pattern="hello.wml">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2wml.xsl"/>
    <map:serialize type="wml"/>
   </map:match>

   <map:match pattern="hello.chtml">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2chtml.xsl"/>
    <map:serialize type="chtml"/>
   </map:match>

   <map:match pattern="hello.vml">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2vml.xsl"/>
    <map:serialize type="xml"/>
   </map:match>

   <map:match pattern="hello.svg">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2svg.xsl"/>
    <map:serialize type="svgxml"/>
   </map:match>

   <map:match pattern="hello.wrl">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2vrml.xsl"/>
    <map:serialize type="vrml"/>
   </map:match>

   <map:match pattern="hello.service">
    <map:generate src="content/hello.xml"/>
    <map:serialize type="xml"/>
   </map:match>

   <map:match pattern="hello.service/WSDL">
    <map:generate src="webservice/HelloWorld.wsdl"/>
    <map:serialize type="xml"/>
   </map:match>

   <map:match pattern="hello.sxw">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2sxw.xsl"/>
    <map:serialize type="sxw"/>
   </map:match>

   <map:match pattern="hello.sxc">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2sxc.xsl"/>
    <map:serialize type="sxc"/>
   </map:match>

   <map:match pattern="hello.sxi">
    <map:generate src="content/hello.xml"/>
    <!-- FIXME: XSLTC fails on this stylesheet -->
    <map:transform type="xalan" src="style/xsl/page2sxi.xsl"/>
    <map:serialize type="sxi"/>
   </map:match>

   <map:match pattern="hello.sxd">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2sxd.xsl"/>
    <map:serialize type="sxd"/>
   </map:match>

   <map:match pattern="hello-wordml.doc">
    <map:generate src="content/hello.xml"/>
    <map:transform src="style/xsl/page2wordml.xsl"/>
    <map:serialize type="xml"/>
   </map:match>

   <map:match pattern="hello.zip">
    <map:generate src="content/hello_zip.xml"/>
    <map:serialize type="zip"/>
   </map:match>
  </map:pipeline>
 </map:pipelines>
</map:sitemap>
<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- CVS $Id: page2html.xsl,v 1.3 2003/05/07 19:15:51 vgritsenko Exp $ -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"; xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint";>

  <xsl:template match="page">
    <w:wordDocument>
      <w:styles>
        <w:style w:type="paragraph" w:styleId="h1"><w:name w:val="heading 1"/><wx:uiName wx:val="Heading 1"/><w:basedOn w:val="Standard"/><w:next w:val="Standard"/><w:rsid w:val="006217F2"/><w:pPr><w:pStyle w:val="h1"/><w:keepNext/><w:spacing w:before="240" w:after="60"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:rFonts w:ascii="Arial" w:h-ansi="Arial" w:cs="Arial"/><wx:font wx:val="Arial"/><w:b/><w:b-cs/><w:kern w:val="32"/><w:sz w:val="32"/><w:sz-cs w:val="32"/></w:rPr></w:style>
      </w:styles>
      <w:body>
        <wx:sect>
          <wx:sub-section>
            <xsl:apply-templates/>
          </wx:sub-section>
        </wx:sect>
      </w:body>
    </w:wordDocument>
  </xsl:template>

  <xsl:template match="title">
    <w:p>
      <w:pPr><w:pStyle w:val="h1"/></w:pPr>
      <w:r><w:t><xsl:apply-templates/></w:t></w:r>
    </w:p>
  </xsl:template>

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

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

  <xsl:template match="@*|node()" priority="-2"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
  <xsl:template match="text()" priority="-1"><xsl:value-of select="."/></xsl:template>

</xsl:stylesheet>

Reply via email to