Solved

XML formatting Question

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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, …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

16 Experts available now in Live!

Get 1:1 Help Now