Re: Newbie - Help with transformation



Howdy, Joris.
Thanks for the quick help.
You were correct in that there were 2 Item template matches - can't see the
forest for the trees 8-). Fixing that displayed the table frame or should I
say 3 table headers.

Then, I changed the apply template in the root section to Root/Item with a
coresponding change from Root match to Item match. This then caused the 3
rows to display in the table. However, the ItemID and SectionDescription
data does not display.

Thanks again for the help as now I at least "see" data 8-),

Rey

"Joris Gillis" <roac@xxxxxxxxxx> wrote in message
news:op.ssxq7bt5yf9v9r@xxxxxxxxxxxxxxxxxx
> Hi,
>
> > When I started this yesterday, I got 3 header displays but no table
frame;
> > made a change then got the 3 ItemID numbers but all in a row w/no
separation
> > and still no table frame.
> > Had tried using the apply-templates meth for the table data fields with
> > matching templates but no success. Then tried using value-of - still no
> > success.
>
> I think the stylesheet you need looks something like this:
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet
> version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>
> <xsl:output method="html" indent="yes"/>
>
> <!-- applied to root node of xml document -->
> <xsl:template match="/">
> <!-- output to html -->
> <html>
> <head>
> <title>Test Output - Answers to Certification Exam
Questions</title>
> </head>
> <body bgcolor="white">
> <!-- &#160; is for non-breaking space -->
> <!-- get/display test name -->
> <p><b>Test Name:&#160;&#160;</b><xsl:value-of
> select="Root/@TestName"/></p>
> <xsl:apply-templates select="Root"/>
> </body>
> </html>
> </xsl:template>
>
>
> <xsl:template match="Root">
> <table width="100%" border="1" >
> <tr><th>ItemID</th><th>Question</th><th>Answer</th><th>Section
> Description</th></tr>
> <!-- loop thru each Q & A -->
> <xsl:for-each select="Item">
> <tr>
> <td><xsl:value-of select="@ItemID"/></td>
> <td><xsl:value-of select=".//div"/></td>
> <td><xsl:value-of select=".//label"/></td>
> <td><xsl:value-of select=".//SectionDescription"/></td>
> </tr>
> </xsl:for-each>
> </table>
> </xsl:template>
>
>
> <xsl:template match="@ItemID"><b><xsl:value-of
select="."/></b></xsl:template>
>
> </xsl:stylesheet>
>
> the reason for the table not being setup was that you had two template
that match the 'Item' node.
>
> Hope this helps.
>
> regards,
> --
> Joris Gillis (http://users.telenet.be/root-jg/me.html)
> Vincit omnia simplicitas
> Keep it simple


.



Relevant Pages

  • Re: Envelope Options
    ... If you have the frame selected or text within the frame selected, ... Envelope Address in the drop down list in Styles, under the Formatting ... rather than a template, you can change the location of the address area. ... Then save the custom envelope as a custom ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How can I change the defaults for an envelope and keep them?
    ... Normal.dot, not the letterhead template. ... "Suzanne S. Barnhill" wrote: ... Choose Frame. ...
    (microsoft.public.word.docmanagement)
  • Re: How can I change the defaults for an envelope and keep them?
    ... every time I create an envelope from the letterhead or any other template ... "Suzanne S. Barnhill" wrote: ... In the Frame dialog, change the vertical position as desired. ...
    (microsoft.public.word.docmanagement)
  • Good CMS design, templates and other issues + performance
    ... of CMS. ... it's better to display currently displayed ... FILE constant or $template variable - without abstraction. ... download data of item's category ...
    (comp.lang.php)
  • Re: Can I change the default bullet symbol? W2007
    ... with the display settings for styles. ... On Jul 18, 1:05 pm, "Stefan Blom" ... by double-clicking the template file or using the New dialog box). ... Not all styles are shown in the Styles pane, ...
    (microsoft.public.word.docmanagement)