Print

Print


Hi Michele,

It depends on what the usage is regarding how to write it.  Without being
able to test the output of that XPath statement myself, I'm not quite sure
if it will gather a list of unique container types in the entire EAD guide
or if it will gather a list of unique container types on the level of each
dsc/component (in which case, there can be repetitive values in your
variable).  Since uniqueTypes is at the top of the file, you may have to
use 'select="/ead/archdesc/dsc/.......'

Try doing an <xsl:value-of select="$uniqueTypes"/> at the top of your
document and/or a <xsl:for-each select="$uniqueTypes"><xsl:value-of
select="."/></xsl:for-each>

That will help you get an idea what data the XPath expression is gathering.
 If you merely want distinct container types anywhere in the document, you
can use the distinct-values() function.

Ethan

On Thu, Apr 26, 2012 at 12:36 PM, Michele R Combs <[log in to unmask]> wrote:

>  Thanks!  That helps.  So let’s talk about that context thing for a
> second.  The <xsl:variable...> line appears right at the top of the file,
> but $uniqueTypes is then used later at various points.  For example, there
> are a couple of <xsl:for-each select=”$uniqueTypes”> where the code then
> does something however many times it takes to account for all the unique
> types.   ****
>
> ** **
>
> So first, I’m unclear as to what set of <container>s it’s looking at to
> determine uniqueness.  The entire document?  Just <container>s in whatever
> c0# it happens to be in when the variable is used?  All the child c0#s
> within it as well?  ** **
>
> ** **
>
> Since the variable is used in various places in the code, I’m also unclear
> as to whether the value of $uniqueTypes will be different at these
> different locations.
>
> ****
>
> Finally, if you were writing this statement, how would you write it?****
>
> ** **
>
> Thanks!****
>
> ** **
>
> Michele****
>
> ** **
>
> *From:* Encoded Archival Description List [mailto:[log in to unmask]] *On
> Behalf Of *Ethan Gruber
> *Sent:* Thursday, April 26, 2012 11:58 AM
> *To:* [log in to unmask]
> *Subject:* Re: Help parsing a node****
>
> ** **
>
> It should get the container type for every node with a container which is
> not the same @type for other containers at that context.  That's probably
> not how I would construct that XPATH statement.  I am not sure how
> differently descendant::*/container will function from
> descendant::container.****
>
> ** **
>
> Ethan****
>
> On Thu, Apr 26, 2012 at 11:47 AM, Ethan Gruber <[log in to unmask]> wrote:
> ****
>
> What do you actually expect it to do?****
>
>
> Ethan****
>
> ** **
>
> On Thu, Apr 26, 2012 at 11:43 AM, Michele R Combs <[log in to unmask]>
> wrote:****
>
> Hi all --
>
> Can someone translate this into plain English for me?
>
> <xsl:variable name="uniqueTypes"
> select="ead/archdesc/dsc/descendant::*/container[not(@type=following::*/container/@type)]/@type"
> />
>
> What exactly will this select?  And (since it starts with the root node)
> will it select the exact same thing no matter where it's used?
>
> I thought I knew but it isn't behaving at all the way I expected.
>
> Thanks --
>
> Michele
> +++++++++++++++
> Michele Combs
> Lead Archivist
> Special Collections Research Center
> Syracuse University
> 315-443-2081
> [log in to unmask]
> scrc.syr.edu
> library-blog.syr.edu/scrc****
>
> ** **
>
> ** **
>