Re: [xsl] wordml to docbook

Subject: Re: [xsl] wordml to docbook
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Tue, 6 Dec 2005 12:03:48 -0600
> yes you are right!
> i can transform all the elements inside of <p>...</p>
> and i can create the sect1 but my problem is now,
> if style="level1" i create <sect1> and all elemets which are
> inside of this <p>-tag shoud be inside.When the style"level2" comes
> i want to open a <sect2> inside of <sect1> and all elements of
> this <p>-tag with level2 should be inside and so one...and this
> opening of <sect2> without closing <sect1> is my problem!
>
Like I said, I think you're going around this the wrong way...stop
thinking about tags.  You're taking a SAX approach to this problem.
What you want to do is for each level one element in the input, create
a new section 1 and apply templates within this new element to all
nodes in source between the current element and the next level 1.  Do
this recursively or via keys.  It's a standard grouping problem (as
well as a standard flat xml file problem).  The faq addresses a lot of
the concerns you mentioned.  It also can be a bit complex to
implement, but it's not a new problem in any sense of the word.  I'd
be surprised if you can't find some similar transforms of word xml
already to base as examples.

Instead of getting all confused with the word xml file format why
don't you try using simpler XML and then progressively increase the
complexity of the sample docs.  If you follow the advice given it
should scale well.


Jon Gorman

Current Thread