Hi Wendell,
I have been pondering it all morning. I have an idea what the problem is,
but no idea how to fix it!
Here is the key declaration:
<xsl:key name="p" match="node()"
use="generate-id(preceding-sibling::processing-instruction('xm-insertion_mark_start')[1])"/>
Here is the "apply-templates" section:
<xsl:choose>
<xsl:when test="text()[normalize-space()] and
processing-instruction('xm-insertion_mark_start')">
<xsl:apply-templates
select="processing-instruction('xm-insertion_mark_start')[1]/preceding-sibling::node()"/>
<xsl:for-each
select="processing-instruction('xm-insertion_mark_start')">
<span class="revcontrol">
<xsl:apply-templates
select="key('p',generate-id())"/>
</span>
</xsl:for-each>
</xsl:when>
<xsl:when test="processing-instruction('xm-insertion_mark_start')">
<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('p',generate-id())"/>
</div>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
The problem is that if there is an xm-insertion_mark_start processing
instruction found, all the following-sibling nodes get placed inside the
<div class = "revcontrol"></div> section. I need to figure out a way to
test to see if the node has a
preceding-sibling::processing-instruction('xm-insertion_mark_start') and a
following-sibling::processing-instruction('xm-insertion_mark_end'). So
far, I have been having no luck, so I was hoping someone else had an idea.
Thanks
Nadia Swaby
Wendell Piez
<wapiez(_at_)mulberry To:
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
tech.com> cc:
Subject: Re: [xsl] Revision
Marking in HTML
2005-05-02 12:26
Please respond
to xsl-list
Nadia,
If I recall correctly, David suggested using keys to solve this problem?
If so, post back with the sample input again, but also your XSLT (we need
to see the key declaration and possibly how it is used).
Heck, do that anyway -- since if he suggested the other common technique,
we need to see where an apply-templates instruction would have to be
adjusted.
Of course, best of all would be if you figured out the technique well
enough so you wouldn't have to ask. :-> Accordingly, please also direct our
attention to whatever still mystifies you in the code you have (almost)
working. (Alternatively: research keys, figure it out, fix your code, dance
in the hallways, and post us back to say it's fixed.)
You still shouldn't have to use d-o-e.
Regards,
Wendell
At 08:33 AM 5/2/2005, you wrote:
Hello again,
I tried David's method, and I found one instance in which is does not
work.
I have a section of XML that looks like this:
<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>
When I render to HTML, instead of getting:
<div class="revcontrol">
<ol>
<li><p>More Test</p></li>
</ol>
</div>
<!--rest of section here-->
I get:
<div class="revcontrol">
<ol>
<li><p>More Test</p></li>
</ol>
<!--rest of section here-->
</div>
Does anyone know of a solution to this, or should I just go back to d-o-e?
Nadia Swaby
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--