From:
Robin Berjon <robin.berjon [at] expway.fr>
Date:
Fri, 25 Oct 2002 16:15:23 +0200
To:
"Andreas J. Koenig" <andreas.koenig [at] anima.de>
To:
axkit-users [at] axkit.org
Subject:
Re: Axpoint bug with nested <point> elements
Andreas J. Koenig wrote:
>>>>>>On Fri, 25 Oct 2002 14:00:00 +0200, Robin Berjon
<robin.berjon [at] expway.fr> said:
> > IIRC it's not a bug in AxPoint, just a missing feature :) However, if
> > Pod::SAX produces that then it has a bug because it doesn't follow
the
> > AxPoint spec.
>
> Thanks, Robin, for the tricky answer:-)
You're most welcome :)
> Pod::SAX doesn't produce AxPoint, it produces stuff like
Ah, yes, silly me.
> So, if I understand correctly, the bug is in pod2axpoint.xsl. I'll try
> to work around that. Unfortunately, my XSLT skills are not up to fixing.
Well, I'm sufficiently in love with XSLT to want to recommend upgrading
those skills, but I must say this may not be a totally trivial situation
:( The following stylesheet will take a document of the form:
<section>
<point>foo</point>
<point>
blabl<b>bar</b> lorem
<point>foo</point>
<point>bar</point>
</point>
</section>
And turn it into something like:
<section>
<point level='1'>foo</point>
<point level='1'>
blabl<b>bar</b> lorem
</point>
<point level='2'>foo</point>
<point level='2'>bar</point>
</section>
It ought to work to arbitrary depth levels, so long as points are
embedded directly inside other points and not inside another element
contained in a point (it should be possible to address that but I don't
have the time to look into it right now). You'll probably have to adapt
it to match the PodML vocabulary. Another option would be to use it
directly on AxPoint to fix it up (ie have a stylesheet pipeline). In
that case you will still probably have to add a few other things to copy
the rest of the document properly, but it shouldn't be too hard.
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'>
<xsl:template match='section'>
<section>
<xsl:apply-templates/>
</section>
</xsl:template>
<xsl:template match='point'>
<point level='{count(ancestor::point) + 1}'>
<xsl:apply-templates mode='noPoint'/>
</point>
<xsl:apply-templates select='point'/>
</xsl:template>
<xsl:template match='node()' mode='noPoint'>
<xsl:copy-of select='.'>
<xsl:apply-templates mode='noPoint'/>
</xsl:copy-of>
</xsl:template>
<xsl:template match='point' mode='noPoint'/>
</xsl:stylesheet>
--
Robin Berjon <robin.berjon [at] expway.fr>
Research Engineer, Expway
7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488
Axpoint bug with nested <point> elements - Andreas J. Koenig on 24 Oct 2002 18:06:53 -0000
Re: Axpoint bug with nested <point> elements - Johan Van den Brande on 24 Oct 2002 18:20:58 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 24 Oct 2002 18:59:54 -0000
Re: Axpoint bug with nested <point> elements - Johan Van den Brande on 24 Oct 2002 19:31:16 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 25 Oct 2002 10:04:35 -0000
Re: Axpoint bug with nested <point> elements - Robin Berjon on 25 Oct 2002 12:00:45 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 25 Oct 2002 12:57:43 -0000
Re: Axpoint bug with nested <point> elements - Robin Berjon on 25 Oct 2002 14:16:00 -0000
Re: Axpoint bug with nested <point> elements - Matt Sergeant on 25 Oct 2002 14:54:02 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 25 Oct 2002 15:02:38 -0000
Re: Axpoint bug with nested <point> elements - Tod Harter on 25 Oct 2002 13:55:29 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 28 Oct 2002 17:37:08 -0000
Re: Axpoint bug with nested <point> elements - Matt Sergeant on 31 Oct 2002 16:55:42 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 1 Nov 2002 09:47:01 -0000
Re: Axpoint bug with nested <point> elements - Matt Sergeant on 1 Nov 2002 10:13:52 -0000
Re: Axpoint bug with nested <point> elements - Andreas J. Koenig on 4 Nov 2002 16:12:29 -0000
Back up to archives |
These pages are copyright © 2002 Apache Software Foundation


Index