[xsl] Using for-each-group out of word.xml

Subject: [xsl] Using for-each-group out of word.xml
From: Jeff Wilson <jeffrey@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 1 Aug 2011 18:19:28 -0700
Good evening,

Thank you for your quick response about my last posting. My question
today is about underlying logic for a my project.

I'm saving word docs as xml and transforming them to be imported into
InDesign.

The tables turned out to be the easiest part because there was an
element to element relationship, just had to rearrange some stuff.
But the other bits are proving to be quite difficult. The other bits
are:

1. Formatting Features:
	a. Matching any paragraphstyle (w:p/w:pPr/w:pStyle/@w:val) that
begins with 'Feature'
	b. wrapping those lines in an element <_Anchored Feature>,
	c. matching the first line styled FeatureType, deleting it and
adding a graphic based on it's value.

So, I'm wondering if for-each-group will work for this. Perhaps a
group-by="contains(w:pPr/w:pStyle/@w:val,Feature)".

Or, if I continue the logic of matching w:p and then processing it
based on it's parastyle.

This is what a feature looks like:

<w:p w:rsidR="006B72DB" w:rsidRPr="00862900"
w:rsidRDefault="006B72DB" w:rsidP="006B72DB">
<w:pPr>
<w:pStyle w:val="FeatureType"/>
</w:pPr>
<w:proofErr w:type="gramStart"/>
<w:r>
<w:t>t</w:t>
</w:r>
<w:r w:rsidRPr="00862900">
<w:t>ype</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
<w:r w:rsidRPr="00862900">
<w:t>=general</w:t>
</w:r>
</w:p>
<w:p w:rsidR="006B72DB" w:rsidRDefault="006B72DB" w:rsidP="006B72DB">
<w:pPr>
<w:pStyle w:val="FeatureTitle"/>
</w:pPr>
<w:r>
<w:lastRenderedPageBreak/>
<w:t>What Do I Type?</w:t>
</w:r>
<w:bookmarkStart w:id="0" w:name="_GoBack"/>
<w:bookmarkEnd w:id="0"/>
</w:p>
<w:p w:rsidR="006B72DB" w:rsidRDefault="006B72DB" w:rsidP="006B72DB">
<w:pPr>
<w:pStyle w:val="FeaturePara"/>
</w:pPr>
<w:r>
<w:t>With Tooltip Assistance set to at least Minimal, you can see the
keyboard shortcut for a tool by hovering your mouse pointer over it.
The keyboard shortcut is shown in parentheses next to the name of the
tool.</w:t>
</w:r>
</w:p>

Thank you for your help.

Designer-turned-xml-translator,
jeff

Current Thread