Solved

XML formatting Question

Posted on 2006-06-21
4
267 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
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
Comment Utility
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
Comment Utility
Thanks I will it a go
0
 

Author Comment

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

I will make sure I look at this today
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DOCTYPE in pubmed 5 42
Read XML Response From ASP Classic 9 56
Nessus Scan 1 63
Which XML parser should I used for my requirement 11 55
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, …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now