Solved

XML formatting Question

Posted on 2006-06-21
4
302 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 500 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
microsoft access - xml 10 79
C# SQL BULK INSERT CLASS 5 50
Setting up a IIS 8 Web Server to send and receive XML files 7 104
xml files 7 54
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.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

696 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