?
Solved

XML formatting Question

Posted on 2006-06-21
4
Medium Priority
?
321 Views
Last Modified: 2008-02-01
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>
0
Comment
Question by:halifaxman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 16954931
Hi halifaxman,

what you could do is the following (two options)

safe the report, open in word, set the continuous numbering to restart numbering in word
safe back as XML and check the difference and implement it

other option
don't use the word auto numbering but give the "bullets" a fix value, organised in your XSLT
That would be something like this
                        <w:p>
                            <w:pPr>
                                <w:listPr>
                                    <w:ilvl w:val="0"/>
                                    <w:ilfo w:val="1"/>
                                    <wx:t wx:val="{position()}." wx:wTabBefore="360" wx:wTabAfter="180"/>
                                    <wx:font wx:val="Times New Roman"/>
                                </w:listPr>
                            </w:pPr>
                            <w:r>
                                <w:t><xsl:value-of select="name" /></w:t>
                            </w:r>
                        </w:p>

I simply have {position()} there, but using format-number you can make that roman, easily


Cheers!
0
 

Author Comment

by:halifaxman
ID: 16955117
Thanks I will it a go
0
 

Author Comment

by:halifaxman
ID: 17165794
apologies, for not getting round to this, I have been away.

I will make sure I look at this today
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question