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

Revision Marking in HTML

Subject: Revision Marking in HTML
From: Nadia.Swaby@xxxxxx
Date: Tue, 26 Apr 2005 08:24:46 -0400
craig swaby
Hi All,

I have been given the task of reworking some XSL stylesheets at work, used
to convert XML to HTML.  We use XMetal to create our XML documents, and use
the revision tracking in XMetal to track any changes made to documents.
XMetal uses processing instructions to mark insertions and deletions.  Here
are to examples:

1) Inline insertion:

<?xm-insertion_mark_start author="A. Jekyll"
time="20041103T123406-0500"?>Document revised to:<?xm-insertion_mark_end ?>

2) Block insertion:

<?xm-insertion_mark_start author="A. Jekyll" time="20041103T123413-0500"?>
<list type="itemized" id="ID6BE23E2rad7702F" export.control="no"
qmsp.additional.requirements="no">
      <list.item id="ID6BE23E2rad04ADD" export.control="no"
qmsp.additional.requirements="no">
            <para export.control="no"
qmsp.additional.requirements="no">Change custodian</para>
      </list.item>
</list>
<?xm-insertion_mark_end ?>

The solution that we are currently using to highlight in inserted data in
HTML is as follows:

<xsl:template match="processing-instruction('xm-insertion_mark_start')">
            <xsl:choose>
                  <xsl:when test="following-sibling::text()">
                        <xsl:text disable-output-escaping="yes">&lt;span
class="revcontrol"></xsl:text>
                  </xsl:when>
                  <xsl:otherwise>
                        <xsl:text disable-output-escaping="yes">&lt;div
class="revcontrol"></xsl:text>
                  </xsl:otherwise>
            </xsl:choose>
      </xsl:template>
      <xsl:template
match="processing-instruction('xm-insertion_mark_end')">
            <xsl:choose>
                  <xsl:when test="preceding-sibling::text()">
                        <xsl:text
disable-output-escaping="yes">&lt;/span&gt;</xsl:text>
                  </xsl:when>
                  <xsl:otherwise>
                        <xsl:text
disable-output-escaping="yes">&lt;/div&gt;</xsl:text>
                  </xsl:otherwise>
            </xsl:choose>
      </xsl:template>

I am looking for a way to mark these revisions in XML that does not require
the use of d-o-e.  I was thinking of doing something like this:

<xsl:template match="processing-instruction('xm-insertion_mark_start')">
            <xsl:choose>
                  <xsl:when test="following-sibling::text()">
                        <span class="revcontrol"><xsl:apply-templates
select="following-sibling::*"/></span>
                  </xsl:when>
                  <xsl:otherwise>
                        <div class="revcontrol"><xsl:apply-templates
select="following-sibling::*"/></div>
                  </xsl:otherwise>
            </xsl:choose>
      </xsl:template>

But that results in the data being output twice.

Does any one have any ideas that could make this work, or is my best bet
sticking to d-o-e.

TIA

Nadia

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.