Mark Wilson
asked on
XML formatting Question
I have the following code (see end of question), the code is part of a report that generates the results in a word document.
The results are outputted as follows
Mark Smith (this is <xsl:value-of select="name" /> in first dataset example)
i Country 1 (this is <xsl:value-of select="destination" /> in second dataset example1)
ii Country 2
iii Country 3
George Burns
iv Country 4
v Country 5
The problem I have is that
1) the bullet points and destination start half way across the page I want them to start on the left as below:
George Burns
iv Country 4
v Country 5
2) I want to reset the numbering on each change of <xsl:value-of select="name" />, its continuous at the moment, so the output would be
Mark Smith (this is <xsl:value-of select="name" /> in first dataset example)
i Country 1 (this is <xsl:value-of select="destination" /> in second dataset example1)
ii Country 2
iii Country 3
George Burns
i Country 4
ii Country 5
Any help would be much appreciated
<xsl:template match="Example">
<w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint">
<w:pPr>
<w:rPr>
<w:rFonts w:cs="Arial" />
<w:u w:val="single" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Arial" />
<w:u w:val="single" />
</w:rPr>
<w:t>
<xsl:value-of select="name" />
</w:t>
</w:r>
</w:p>
<xsl:for-each select="Example1">
<w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint">
<w:pPr>
<w:listPr>
<w:ilvl w:val="2" />
<w:ilfo w:val="15" />
<wx:t wx:val="·" wx:wTabBefore="360" wx:wTabAfter="240" />
<wx:font wx:val="Symbol" />
</w:listPr>
<w:rPr>
<w:rFonts w:cs="Arial" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Arial" />
</w:rPr>
<w:t>
<xsl:value-of select="destination" />
</w:t>
</w:r>
</w:p>
</xsl:if>
</xsl:for-each>
The results are outputted as follows
Mark Smith (this is <xsl:value-of select="name" /> in first dataset example)
i Country 1 (this is <xsl:value-of select="destination" /> in second dataset example1)
ii Country 2
iii Country 3
George Burns
iv Country 4
v Country 5
The problem I have is that
1) the bullet points and destination start half way across the page I want them to start on the left as below:
George Burns
iv Country 4
v Country 5
2) I want to reset the numbering on each change of <xsl:value-of select="name" />, its continuous at the moment, so the output would be
Mark Smith (this is <xsl:value-of select="name" /> in first dataset example)
i Country 1 (this is <xsl:value-of select="destination" /> in second dataset example1)
ii Country 2
iii Country 3
George Burns
i Country 4
ii Country 5
Any help would be much appreciated
<xsl:template match="Example">
<w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint">
<w:pPr>
<w:rPr>
<w:rFonts w:cs="Arial" />
<w:u w:val="single" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Arial" />
<w:u w:val="single" />
</w:rPr>
<w:t>
<xsl:value-of select="name" />
</w:t>
</w:r>
</w:p>
<xsl:for-each select="Example1">
<w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint">
<w:pPr>
<w:listPr>
<w:ilvl w:val="2" />
<w:ilfo w:val="15" />
<wx:t wx:val="·" wx:wTabBefore="360" wx:wTabAfter="240" />
<wx:font wx:val="Symbol" />
</w:listPr>
<w:rPr>
<w:rFonts w:cs="Arial" />
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Arial" />
</w:rPr>
<w:t>
<xsl:value-of select="destination" />
</w:t>
</w:r>
</w:p>
</xsl:if>
</xsl:for-each>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
apologies, for not getting round to this, I have been away.
I will make sure I look at this today
I will make sure I look at this today
ASKER