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

Fwd: Selecting First Child of Ancestor using Xpath

Subject: Fwd: Selecting First Child of Ancestor using Xpath
From: Nathan Tallman <ntallman@xxxxxxxxx>
Date: Wed, 20 Nov 2013 10:12:32 -0500
 Fwd: Selecting First Child of Ancestor using Xpath
I have the following xml:

               <c03 level="otherlevel" otherlevel="subsubseries"
id="seriesB2ii">
                  <did>
                     <unittitle>Section ii. Subject Files</unittitle>
                     <unitdate era="ce"
calendar="gregorian">1937-1958</unitdate>
                  </did>
                  <scopecontent>
                     <p>Scope and Content Note: Includes file on
Jewish organizations, annual
                        meetings, anti-discrimination and legislation,
Commentary newsletter,
                        Emergency Committee, foreign affairs, human
and civil rights, Israel, joint
                        defense appeal, Palestine immigration and
platform, peace, and the American
                        Jewish tercentenary.</p>
                  </scopecontent>
                  <arrangement>
                     <p>Arrangement Note: Arranged alphabetically.</p>
                  </arrangement>
                  <c04 level="file">
                     <did>
                        <container type="Box">B7</container>
                        <container type="Folder">30</container>
                        <unittitle>Administrative Committee</unittitle>
                        <unitdate era="ce"
calendar="gregorian">1943-1944</unitdate>
                     </did>
                  </c04>
                  <c04 level="file">
                     <did>
                        <container type="Box">B7</container>
                        <container type="Folder">31</container>
                        <unittitle>American Council for Judaism</unittitle>
                        <unitdate era="ce" calendar="gregorian">1950</unitdate>
                     </did>
                  </c04>
                  <c04 level="file">
                     <did>
                        <container type="Box">B7</container>
                        <container type="Folder">32</container>
                        <unittitle>American Jewish Conference</unittitle>
                        <unitdate era="ce"
calendar="gregorian">January - May 1943</unitdate>
                     </did>
                  </c04>

I'm working on a template that matches on c04, then has an
xsl:for-each for the did (so did is m context node). I am transforming
this into an HTML table.

I'd like to do an xsl:coose/when to test for the first c04 child of
c03, so I can add table headers. As this is processing all dids I need
the test to specifically catch the first c04 child. However
test="../../c04[1]" does not seem to be doing the trick.

Any suggestions? I'm using XSLT 2.0.

Thanks,
Nathan

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.