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

Using attributes with XPath

Subject: Using attributes with XPath
From: "Jacqueline Radebaugh" <jrad@xxxxxxx>
Date: Tue, 22 Aug 2006 15:25:53 -0400
xpath attribute
Hello:

I am writing a XSL-FO style sheet and am trying to output a list.

The list's XML is:

<list type="marked" mark="*">
<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 XSL-FO code is:

<xsl:template match="list">
<fo:list-block>
  <xsl:apply-templates select="@* | *[contains(@type, $my_version) or
string-length(@type)=0] | text()"/>
 </fo:list-block>
</xsl:template>

<xsl:template match="item[parent::list]">
<fo:list-item>
 <fo:list-item-label>
 <fo:block>&#x2022;</fo:block>
 </fo:list-item-label>
 <fo:list-item-body>
 <fo:block>
 <xsl:apply-templates select="@* | *[contains(@type, $my_version) or
string-length(@type)=0] | text()"/>
 </fo:block>
 </fo:list-item-body>
 </fo:list-item>
</xsl:template>

I have tried to use the attribute expression in XPATH for the @type and @mark
attributes of the list element.  The code looked like:

<xsl:template match="list[attribute::type and attribute::mark]">
<fo:list-block>
  <xsl:apply-templates select="@* | *[contains(@type, $my_version) or
string-length(@type)=0] | text()"/>
 </fo:list-block>
</xsl:template>

Unfortunately, I did not receive the list output.

Could you please inform me on what I am doing incorrectly with my XPATH
expressions and or XSLT code?

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

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.