Managing change in an XML environment

com.renderx.xep.lib.InternalException: No matching point found for change-bar

PosterContent
nk4um User
Posts: 11
September 29, 2010 18:44Looks good!
Hi Nigel,

I slipped in your solution in place of my own (swapping in the rx: namespace because I''m still using it) and it looks much better than mine! I was getting some strange right-justification problems with my solution and yours looks excellent. Thanks!

Jeff.
nk4um Administrator
Posts: 129
June 14, 2010 16:40And another fix...
Hello Jeff,

Apologies - I had been meaning to follow-up on this for a while.  Your post served as a reminder!

Richard managed to send us a simple test case which broke using his version of XEP (4.17), however it worked fine - no InternalErrors or other problems when we tried it out using the earlier version 4.9 we are using.

I reviewed all the info I could find and came up with another work-around - a "change-bar optimizer".

Richard has tested this code and reports that it works with his data.  I''ve put it on our downloads page (at the bottom):
  http://www.deltaxml.com/dxml/library/downloads.html

Its a ZIP containing an XSL filter and some xspec tests (demonstrates what it does).  Like your approach its a new stage between docbook-xsl and XEP.  The idea is to remove extra changebars (which sit on top of each other in the result).  Its hard to do this as part of docbook-xsl (as it currently stands), but relatively easy as a post-process.  If this works for XEP users more generally I''ll do new releases with better docs and happy to publish/premote its use and/or Jeff''s solution (please let us know here).

Cheers,

Nigel
nk4um User
Posts: 11
June 11, 2010 21:49Ok, got this fixed for the last time I think.
Further talks with RenderX rendered the nugget that the problem could also be fixed by adding line feeds after the change-bar elements, so now I pass my XML through this script before it hits XEP. This script addresses my stubborn test case that couldn''t be addressed by the zero-space issue:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" version="1.0">
    <xd:doc scope="stylesheet">
        <xd:desc>
            <xd:p><xd:b>Created on:</xd:b> Jun 9, 2010</xd:p>
            <xd:p><xd:b>Author:</xd:b> hookerje</xd:p>
            <xd:p>Adds line feeds to FO to get around change-bar-end issue in XEP</xd:p>
        </xd:desc>
    </xd:doc>
   
    <xsl:template match="rx:change-bar-begin">
        <xsl:text>           
        </xsl:text>
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates/>
        </xsl:copy>
        <xsl:text>           
        </xsl:text> 
    </xsl:template>
   
    <xsl:template match="rx:change-bar-end">
        <xsl:text>           
        </xsl:text>
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates/>
        </xsl:copy>
        <xsl:text>           
        </xsl:text> 
    </xsl:template>
   
    <xsl:template match="*">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates/>
        </xsl:copy>
    </xsl:template>
   
    <xsl:template match="comment()|processing-instruction()">
        <xsl:copy/>
    </xsl:template>
   
</xsl:stylesheet>
nk4um User
Posts: 11
June 7, 2010 19:55This is an encoding error that he's seeing now
The zero-width space character code is UTF-8, and unless UTF-8 is being maintained all the way to the formatter, than violence erupts. The fact that he''s seeing the funky letter A means that he''s using a different encoding.

Character encodings and namespaces are the bane of every sane XML developer''s existence. They both suck.

I am still seeing this issue sporatically and can sent you an XML document that will reliably trigger it if I can get some kind of NDA from you guys first. 
nk4um Administrator
Posts: 129
March 4, 2010 16:41
Hi Richard,

Firstly, 0.1.4 of the customization can be used with DocBook 4.x and 5.x - my wording in the download page could be better:

0.1.2   for use with:  docbook-xsl-1.72  (docbook 4.x)
0.1.4   for use with:  docbook-xsl-1.74 (docbook 4.x) and
                                     docbook-xsl-ns-1.74 (docbook 5.0)

I also performed the edit suggested by Jeff - I used OxygenXML with an XPath query-replace operation.  I also contemplated doing the edit using an XSLT script - but just delved into the editor.  I''ve sent you a copy of these edits by email.

But your sed looks basically correct.    In my edits I wrapped the characters in <xsl:text> but that shouldn''t make much difference.

I also ran it through one of our larger tests (the simplified docbook block one) and got a PDF out as expected.  Our other tests will take an hour or so to run...

One of the problems we have is that we haven''t been able to provoke/reproduce this ourselves.  If you or Jeff have a redistributable test case, I''d appreciate a copy.

We''d like this fixed (either as a work-around in our code) or by RenderX.  We''re happy to work with any of our users towards this aim.

Thanks,

Nigel
nk4um User
Posts: 8
March 4, 2010 16:33
Nigel

I have tried the updated stylesheets that you emailed me.

For the benifit of people reading along, these stylesheets make the stylesheet look like this:

<xsl:text>&#x200B;</xsl:text><fo:change-bar-end change-bar-class="{$class}"/><xsl:text>&#x200B;</xsl:text>


And the generated xsl:fo looks like this:

<fo:inline color="red" background-color="inherit" text-decoration="line-through" font-style="normal"><fo:change-bar-begin change-bar-class="id3288229" change-bar-color="blue" change-bar-style="solid"/><fo:basic-link internal-destination="service_desk">Chapter 21, <fo:inline font-style="italic">Service Desk</fo:inline></fo:basic-link><fo:basic-link internal-destination="service_desk"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="service_desk"/>]</fo:inline></fo:basic-link>â<fo:change-bar-end change-bar-class="id3288229"/>â</fo:inline>

Unfortunately I still get the same error from xep.

Thanks

Richard
nk4um User
Posts: 8
March 4, 2010 15:44
I have tried adding the &#x200B; as described.

To perform the replacement in the docbook-changes-0.1.4 I did:


for j in $(
       for i in $(find . -name "*.xsl")
       do
             grep -l change-bar-end $i; done
       )
do

     sed -i ''s@<fo:change-bar-end change-bar-class="{$class}"/>@\\&#x200B;<fo:change-bar-end change-bar-class="{$class}"/>\\&#x200B;@'' $j

done


This results in each <fo:change-bar-end ..> line looking like:

&#x200B;<fo:change-bar-end change-bar-class="{$class}"/>&#x200B;


The xsl:fo that is generate looks like this:


<fo:change-bar-begin change-bar-class="id3404849" change-bar-color="blue" change-bar-style="solid"/><fo:basic-link internal-destination="service_desk">Chapter 21, <fo:inline font-style="italic">Service Desk</fo:inline></fo:basic-link><fo:basic-link internal-destination="service_desk"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="service_desk"/>]</fo:inline></fo:basic-link>â<fo:change-bar-end change-bar-class="id3404849"/>â


So the &#x200B; characters are being inserted but I still get the error from XEP.

Thanks

Richard
nk4um User
Posts: 8
March 4, 2010 15:24
I have tried again, this time with docbook-changes-0.1.4 and docbook-xsl-1.75.1.

I get the same error.

Richard
nk4um User
Posts: 8
March 4, 2010 15:05
Nigel,

Versions first:

xep-4.17-20091204
docbook-changes-0.1.2 (because I am using docbook-4.5 and I recall you instructions suggest only using 0.1.4 for docbook-5)
docbook-xsl-1.71.0

I am reasonably familiar with xslt.

Regards

Richard
nk4um Administrator
Posts: 129
March 4, 2010 13:40More detail in a previous forum posting
Hello Richard,

We''re keen to know about where you''re spending 3 days - but I''ll address that in another post.  Getting to the immediate problem:

From hunting on Google (http://itwriting.ca/index.php?option=com_content&view=article&id=70:deltaxml-changebars-and-docbook&catid=41:xslt&Itemid=34) it appears that this is known issue with RenderX but that a work around may be possible by making change to the DeltaXML stylesheets. But I can not work out how to modify the stylesheets to resolve the issue.

Are you able to give me any advice?


''itwriting.ca'' is Jeff Hooker who also happens to also be poster on these forums.  In particular this issue is discussed a few topics back:

http://www.deltaxml.com/forum/topic/78/1

The last message suggests adding &#x200B; before/after every change-bar start/end in our XSLT.  Where Jeff said <rx:change-bar-end>  I think that may be an older version.  I think the code now uses <fo:change-bar-end.../>  (rx: was used in early versions of XEP before XSL FO 1.1 standardized the change-bar features).

I could do the changes Jeff suggests fairly quickly (10 mins work) if you are unfamiliar with XSLT  - please let me know which versions of XEP, our customization and docbook-xsl you are using and I''ll try to lend a hand.

Hope this helps,

Nigel
nk4um User
Posts: 8
March 4, 2010 13:01
Here is the input (it did not render in the last message:

<fo:inline color="red" background-color="inherit" text-decoration="line-through" font-style="normal"><rx:change-bar-begin xmlns:rx="http://www.renderx.com/XSL/Extensions" change-bar-class="id3434708" change-bar-color="blue" change-bar-style="solid"/><fo:basic-link internal-destination="service_desk">Chapter 21, <fo:inline font-style="italic">Service Desk</fo:inline></fo:basic-link><fo:basic-link internal-destination="service_desk"><fo:inline keep-together.within-line="always"> [<fo:page-number-citation ref-id="service_desk"/>]</fo:inline></fo:basic-link><rx:change-bar-end xmlns:rx="http://www.renderx.com/XSL/Extensions"
change-bar-class="id3434708"/></fo:inline>
nk4um User
Posts: 8
Hi

I am doggedly trying to get my docbook tool chain to generate change bars using an evaluation copy of DeltaXML before I commit to a purchase. Three days in and I feel that I am starting to make real progress. But I have come up against the following problem.

Pushing the output of DeltaXML through the docbook fo stylesheets and then into RenderX I get the following error:

error: formatting failed: com.renderx.xep.lib.InternalException: No matching point found for change-bar: /type=start,class=id3434708,serial=25231,points: ((x=229039,y=165348,line_shift=0,region serial=37188,active=false) (x=229039,y=152149,line_shift=0,region serial=37188,active=false) (x=229039,y=706960,line_shift=0,region serial=37279,active=true)), regtype=normal, pair.serial=25238/ in region {column-0,normal,neutral,275,37188,(85039,135880),(526961,706960),phi=0}

The input that causes the issue is:



From hunting on Google (http://itwriting.ca/index.php?option=com_content&view=article&id=70:deltaxml-changebars-and-docbook&catid=41:xslt&Itemid=34) it appears that this is known issue with RenderX but that a work around may be possible by making change to the DeltaXML stylesheets. But I can not work out how to modify the stylesheets to resolve the issue.

Are you able to give me any advice?

Regards

Richard