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

How to restrict xsl:key

Subject: How to restrict xsl:key
From: "Mark Wilson mark@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Sep 2019 21:55:08 -0000
 How to restrict xsl:key
I have established a key:
B <xsl:key name="placement-index" match="Stamp"
use="concat(CatNumbers/@pofis-prefix, CatNumbers/@pofis-number,
CatNumbers/@pofis-suffix)"/>

It uses an XML file that contains the element Stamp. It worked until
today. What changed is that the CatNumbers fall into two Periods
(seedataB  below). Until today, the Catnumbers referenced always fell in
Period domain='c' in my data. They now also fall into Period
domain='cr'.B  I need to restrict the output of the template to only keys
built from the @domain='c' part of the data. Have not a clue how to do this.

The code using building and using the key is:

<xsl:key name="placement-index" match="Stamp"
use="concat(CatNumbers/@pofis-prefix, CatNumbers/@pofis-number,
CatNumbers/@pofis-suffix)"/>

B B B  <xsl:template match="Flaws">
B B B B B B B B B  <Flaws>
B B B B B B B B B B B  <xsl:attribute name="placement-index"
select="key('placement-index', concat(@pofis-prefix, @pofis-number,
@pofis-suffix), doc('../work/data-with-index.xml'))/@placement-index"
B B B B B B B B B B B  />
B B B B B B B B B B B  <xsl:attribute name="flaw-width"
select="key('placement-index', concat(@pofis-prefix, @pofis-number,
@pofis-suffix), doc('../work/data-with-index.xml'))/@flaw-width"
B B B B B B B B B B B  />
B B B B B B B B B B B  <xsl:copy-of select="@*"/>
B B B B B B B B B B B  <xsl:copy-of select="node()"/>
B B B B B B B B B  </Flaws>
B B B  </xsl:template>


The data is: <Period domain="c"> B B B B B <Year year="1918"> B B B B B B B B <Month month="12"> B B B B B B B B B B B <Day day="18"> B B B B B B B B B B B B B B <Set> B B B B B B B B B B B B B B B B B <Motif concept="Definitive Issues"/> B B B B B B B B B B B B B B B B B <Stamp> B B B B B B B B B B B B B B B B B B B B <CatNumbers scott-number="2" pofis-number="3"/> B B B B B B B B B B B B B B B B B B B B <Value kc-value="0" h-value="5"/> B B B B B B B B B B B B B B B B B B B B <Inscriptions czech="$" eng="$"/> B B B B B B B B B B B B B B B B B B B B <Formats other="3"/> B B B B B B B B B B B B B B B B B B B B <Formats gutter="3"/> B B B B B B B B B B B B B B B B B </Stamp> B B B B B B B B B B B B B B B B B <Stamp> B B B B B B B B B B B B B B B B B B B B <CatNumbers scott-number="3" pofis-number="5"/> B B B B B B B B B B B B B B B B B B B B <Value kc-value="0" h-value="10"/> B B B B B B B B B B B B B B B B B B B B <Inscriptions czech="$" eng="$"/> B B B B B B B B B B B B B B B B B B B B <Formats other="5"/> B B B B B B B B B B B B B B B B B B B B <Formats gutter="5"/> B B B B B B B B B B B B B B B B B </Stamp> B B B B B B B B B B B B B B </Set> ... <Period/> <Period domain="cr"> B B B B B <Year year="1918"> B B B B B B B B <Month month="12"> B B B B B B B B B B B <Day day="18"> B B B B B B B B B B B B B B <Set> B B B B B B B B B B B B B B B B B <Motif concept="Definitive Issues"/> B B B B B B B B B B B B B B B B B <Stamp> B B B B B B B B B B B B B B B B B B B B <CatNumbers scott-number="2" pofis-number="3"/> B B B B B B B B B B B B B B B B B B B B <Value kc-value="0" h-value="5"/> B B B B B B B B B B B B B B B B B B B B <Inscriptions czech="$" eng="$"/> B B B B B B B B B B B B B B B B B B B B <Formats other="3"/> B B B B B B B B B B B B B B B B B B B B <Formats gutter="3"/> B B B B B B B B B B B B B B B B B </Stamp> B B B B B B B B B B B B B B B B B <Stamp> B B B B B B B B B B B B B B B B B B B B <CatNumbers scott-number="3" pofis-number="5"/> B B B B B B B B B B B B B B B B B B B B <Value kc-value="0" h-value="10"/> B B B B B B B B B B B B B B B B B B B B <Inscriptions czech="$" eng="$"/> B B B B B B B B B B B B B B B B B B B B <Formats other="5"/> B B B B B B B B B B B B B B B B B B B B <Formats gutter="5"/> B B B B B B B B B B B B B B B B B </Stamp> B B B B B B B B B B B B B B </Set> ... <Period/>

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.