Andreas J. Koenig wrote:
On Fri, 25 Oct 2002 14:00:00 +0200, Robin Berjon <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
Research Engineer, Expway
7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to