Subject: RE: [xsl] Using attributes with XPath From: "Jacqueline Radebaugh" <jrad@xxxxxxx> Date: Wed, 23 Aug 2006 15:16:56 -0400 |
Hello: Thank you very much for your help. I revised my code so that I created two templates for the attributes of the <list> element. It looks like: <!-- list[parent::description] --> <xsl:template match="list[parent::description]"> <fo:list-block> <xsl:apply-templates/> </fo:list-block> </xsl:template> <xsl:template match="@type[parent::list]"> <fo:inline font-size="10pt" font-weight="normal"> <xsl:apply-templates/> </fo:inline> </xsl:template> <xsl:template match="@mark[parent::list]"> <fo:inline font-size="10pt" font-weight="normal"> <xsl:apply-templates/> </fo:inline> </xsl:template> <xsl:template match="item[parent::list]"> <fo:list-item> <fo:list-item-label> <fo:block>•</fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block> <xsl:apply-templates/> </fo:block> </fo:list-item-body> </fo:list-item> </xsl:template> I am still obtaining no output of the list. However, when I take the attributes off of the <list> element in my source code, i.e., <list> <item>- The item contains more than one language one of which may be a sign language</item> <item>- The item is or includes a translation</item> <item>- The language of the summaries, abstracts, or accompanying material differs from the language of the main item</item> <item>- The language of a table of contents differs from the language of the main item</item> </list> my XSLT code works. What I am still doing wrong? It is definitely related to the attributes of <list> (i.e., type="marked" mark="*"). Thank you very much for your help! Best wishes, Jackie Radebaugh Library of Congress Network Development & MARC Standards Office Washington, DC USA Phone: +1-202-707-1153 FAX: +1-202-707-0115 E-Mail: jrad@xxxxxxx >>> mike@xxxxxxxxxxxx 08/22/06 4:27 PM >>> > > <xsl:template match="list"> > <fo:list-block> > <xsl:apply-templates select="@* That will apply-templates to the attributes of the list element, but if you've written any template rules that match attributes, you haven't shown them to us. | *[contains(@type, > $my_version) or string-length(@type)=0] | text()"/> That will match children of the list element that have a type attribute satisfying certain conditions, but in the XML you showed us, no children of the list element have a type attribute. | text()"/> That will match text node children of the list element, but in the data you showed us, the only text node children of the list element were whitespace. Michael Kay http://www.saxonica.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Java program to Generate , Michael Kay | Thread | Re: [xsl] Using attributes with XPa, David Carlisle |
RE: [xsl] xsl:call-template questio, Lin, Jessica | Date | RE: [xsl] xsl:call-template questio, Lin, Jessica |
Month |