[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Entity Questions

Subject: Re: Entity Questions
From: "Luke Shannon" <lshannon@xxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2005 18:12:56 -0500
xsl entity
Michael;

Thanks for your patience.

Here is one template that calls the template I keep showing.

<xsl:template name="s1_pdf">
<!-- text 1 -->
<fo:flow flow-name="xsl-region-body">
<fo:block font-family="Helvetica" font-size="12pt" font-weight="bold"
break-after="auto" space-after="10pt" text-align="left">
<xsl:call-template name="text_display_and_edit">
<xsl:with-param name="text_number" select="number('1')" />
</xsl:call-template>
</fo:block>
<!-- text 2 -->
<fo:block font-family="Helvetica" font-size="12pt" font-weight="normal"
text-align="left">
<xsl:call-template name="text_display_and_edit">
<xsl:with-param name="text_number" select="number('2')" />
</xsl:call-template>
</fo:block>
</fo:flow>
</xsl:template>

I tested adding the match="P" template. I didn't replace anything. I think
this might be because I changed the output method to xml to deal with
entities like &nbsp;

I am thinking the <P> tags are now &lt;P&gt; so the template is not matching
them. I am adding some logging to verify this, if this is the case I may
need to rethink things.

Luke


----- Original Message ----- 
From: "Michael Kay" <mike@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, January 17, 2005 6:02 PM
Subject: RE:  Entity Questions


> > So taking this template for example:
> >
> > <!-- the html i am looking at is machine generated and in all caps -->
> > <xsl:template match="P">
> > <fo:block>
> >   <xsl:apply-templates/>
> >  </fo:block>
> > </xsl:template>
> >
> > This is matching a P node (<P>) and replacing it with the
> > <fo:block>the
> > contents of the matched node</fo:block>.
> >
> > Is this correct?
>
> Yes that's correct.
> >
> > If this is correct than I should be able to do the following:
> >
> > <!-- output the text from the xml document -->
> > <xsl:template name="text_display_and_edit">
> > <xsl:param name="text_number" />
> > <xsl:param name="textname" select="concat('TEXT',$text_number)" />
> > <xsl:if test="DATA/VERSION/ITEM[@NAME=$textname] !=''" >
> > <xsl:value-of select="DATA/VERSION/ITEM[@NAME=$textname]"/>
> > </xsl:if>
> > </xsl:template>
>
> You've shown this named template several times, but you haven't shown any
> code that calls it, or the section of the source document that it's
> processing. A named template is invoked using xsl:call-template,
> >
> > <!-- this template will catch the <P> and output their
> > contents inside of
> > <fo:block> instead-->
> > <xsl:template match="P">
> > <fo:block>
> > <xsl:apply-templates/>
> > </fo:block>
> > </xsl:template>
>
> This is just the template rule you showed us before.
> >
> > Is this making more sense?
> >
> > One thing I don't understand. How does <xsl:apply-template/>
> > manage to write
> > the content of the node out?
> >
>
> It does it indirectly. It selects some nodes from the source document; the
> template rules that match those nodes are activated, and instructions
within
> those template rules, such as <B>...</B> or <xsl:value-of select="@x"/>,
> write nodes to the result tree.
>
> Michael Kay
> http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.