Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XML formatting Question

Posted on 2006-06-21
4
Medium Priority
?
326 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 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