[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Revision Marking in HTML

Subject: Re: Revision Marking in HTML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 3 May 2005 18:11:46 +0100
re revision
> I changed it back to the old way (if it ain't broke, don't fix it!) 

this is not unreasonable

> Thanks for all your help.  I hope know one feels like I wasted their time.


not at all, just to round the thread off for the sake of the archives,
here's the original key method, tested a bit:

nadia.xml


<section>
      <heading>Head</heading>
      <para>Some Text</para>
      <?xm-insertion_mark_start author="N. Swaby"
time="20041103T124303-0500"?>
      <list>
            <list.item>
                  <para>More Test</para>
            </list.item>
      </list>
      <?xm-insertion_mark_end ?>
      <figure>
            <graphic file="drm044-f2.jpg" width="606" height="276"/>
            <figtitle>Fig</figtitle>
      </figure>
      <table><!-- table stuff--></table>
      <table><!-- table stuff--></table>
      <table><!-- table stuff--></table>
</section>



nadia.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">




<xsl:key
   name="pi"
   match="node()"
   use="generate-id(preceding-sibling::processing-instruction()[starts-with(name(),'xm-insertion_mark_')][1])"/>

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

<xsl:template match="section[processing-instruction('xm-insertion_mark_start')]">
<div>
<xsl:apply-templates select="processing-instruction('xm-insertion_mark_start')[1]/preceding-sibling::node()"/>
<xsl:for-each select="processing-instruction('xm-insertion_mark_start')">
<div class="revcontrol">
<xsl:apply-templates select="key('pi',generate-id())"/>
</div>
</xsl:for-each>
<xsl:apply-templates select="processing-instruction('xm-insertion_mark_end')[last()]/following-sibling::node()"/>
</div>
</xsl:template>

<xsl:template match="section/heading">
<h2>
<xsl:apply-templates/>
</h2>
</xsl:template>

<xsl:template match="list">
<ol>
<xsl:apply-templates/>
</ol>
</xsl:template>
<xsl:template match="list.item">
<li>
<xsl:apply-templates/>
</li>
</xsl:template>

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

<xsl:template match="figure|table">
<p> a converted <xsl:value-of select="name()"/>.</p>
</xsl:template>



</xsl:stylesheet>


$ saxon nadia.xml nadia.xsl
<?xml version="1.0" encoding="utf-8"?>
<div>
      <h2>Head</h2>
      <p>Some Text</p>
      <div class="revcontrol">
      <ol>
            <li>
                  <p>More Test</p>
            </li>
      </ol>
      </div>
      <p> a converted figure.</p>
      <p> a converted table.</p>
      <p> a converted table.</p>
      <p> a converted table.</p>
</div>

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.