Subject: Re: [xsl] Unable to select wanted nodes From: "Mark" <mark@xxxxxxxxxxxx> Date: Fri, 7 Oct 2011 09:26:19 -0700 |
Thanks again for all your help, Mark
Problem 1: Unlike the original data where there were two different se-tenants [105] and [107], here se-tenant has a single value [146]; no label should be generated - see also Problem 3. --> <FormatPage souvenir-sheet="146"> <FormatButtons> <Formats state="depressed" souvenir-sheet="146"/> <Formats label="1" state="active" se-tenant="146"/> </FormatButtons> <StampButtons> <Stamp label="1" state="active" pofis-number="146"/> <Stamp label="2" state="active" pofis-number="147"/> <Stamp label="3" state="active" pofis-number="148"/> </StampButtons> </FormatPage> <FormatPage se-tenant="146"> <FormatButtons> <Formats state="active" souvenir-sheet="146"/> <Formats label="1" state="depressed" se-tenant="146"/> </FormatButtons> <StampButtons> <Stamp label="1" state="active" pofis-number="146"/> <Stamp label="2" state="active" pofis-number="147"/> <Stamp label="3" state="active" pofis-number="148"/> </StampButtons> </FormatPage>
<!-- Problem 2: Although these stamps belong to the same Set, they do not share a format: coupon should appear only in the first <FormatPage> and souvenir-sheet only in the second. Neither should generate a label. --> <FormatPage coupon="244"> <FormatButtons> <Formats state="depressed" coupon="244"/> <!-- 244 does not have a souvenir sheet --> <Formats label="1" state="active" souvenir-sheet="245"/> </FormatButtons> <StampButtons> <Stamp state="active" pofis-number="244"/> </StampButtons> </FormatPage> <FormatPage souvenir-sheet="245"> <FormatButtons> <!-- 255 does not have a coupon --> <Formats state="active" coupon="244"/> <Formats label="1" state="depressed" souvenir-sheet="245"/> </FormatButtons> <StampButtons> <Stamp state="active" pofis-number="245"/> </StampButtons> </FormatPage>
<!-- Problem 3: Labels for different formats should be in different sequences. Here se-tenant should get no label (as in the first problem), and the coupon labels should start with '1', not '2'. However, were there two se-tenants, they would be labeled '1' and '2' also. --> <FormatPage souvenir-sheet="365"> <FormatButtons> <Formats state="depressed" souvenir-sheet="365"/> <Formats label="1" state="active" se-tenant="365"/> <Formats label="2" state="active" coupon="367"/> <Formats label="3" state="active" coupon="368"/> </FormatButtons> <StampButtons> <Stamp label="1" state="active" pofis-number="365"/> <Stamp label="2" state="active" pofis-number="366"/> <Stamp label="3" state="active" pofis-number="367"/> <Stamp label="4" state="active" pofis-number="368"/> </StampButtons> </FormatPage> <FormatPage se-tenant="365"> <FormatButtons> <Formats state="active" souvenir-sheet="365"/> <Formats label="1" state="depressed" se-tenant="365"/> <Formats label="2" state="active" coupon="367"/> <Formats label="3" state="active" coupon="368"/> </FormatButtons> <StampButtons> <Stamp label="1" state="active" pofis-number="365"/> <Stamp label="2" state="active" pofis-number="366"/> </StampButtons> </FormatPage> <FormatPage coupon="367"> <FormatButtons> <Formats state="active" souvenir-sheet="365"/> <Formats label="1" state="active" se-tenant="365"/> <Formats label="2" state="depressed" coupon="367"/> <Formats label="3" state="active" coupon="368"/> </FormatButtons> <StampButtons> <Stamp state="active" pofis-number="367"/> </StampButtons> </FormatPage> <FormatPage coupon="368"> <FormatButtons> <Formats state="active" souvenir-sheet="365"/> <Formats label="1" state="active" se-tenant="365"/> <Formats label="2" state="active" coupon="367"/> <Formats label="3" state="depressed" coupon="368"/> </FormatButtons> <StampButtons> <Stamp state="active" pofis-number="368"/> </StampButtons> </FormatPage> </Output>
<Input> <!-- No Problem here, original data --> <Set> <Stamp> <CatNumbers pofis-number="105"/> <Formats souvenir-sheet="105"/> <Formats se-tenant="105"/> </Stamp> <Stamp> <CatNumbers pofis-number="106"/> <Formats souvenir-sheet="105"/> <Formats se-tenant="105"/> </Stamp> <Stamp> <CatNumbers pofis-number="107"/> <Formats souvenir-sheet="105"/> <Formats se-tenant="107"/> </Stamp> <Stamp> <CatNumbers pofis-number="108"/> <Formats souvenir-sheet="105"/> <Formats se-tenant="107"/> </Stamp> </Set> <!-- Problem 1: Unlike the original data where there were two different se-tenants [105] and [107], here se-tenant has a single value [146]; no label should be generated --> <Set> <Stamp> <CatNumbers pofis-number="146"/> <Formats souvenir-sheet="146"/> <Formats se-tenant="146"/> </Stamp> <Stamp> <CatNumbers pofis-number="147"/> <Formats souvenir-sheet="146"/> <Formats se-tenant="146"/> </Stamp> <Stamp> <CatNumbers pofis-number="148"/> <Formats souvenir-sheet="146"/> <Formats se-tenant="146"/> </Stamp> </Set> <!-- Problem 2: Although these stamps belong to the same Set, they do not share a format: coupon should appear only in the first <FormatPage> and souvenir-sheet only in the second. --> <Set> <Stamp> <CatNumbers pofis-number="244"/> <Formats coupon="244"/> </Stamp> <Stamp> <CatNumbers pofis-number="245"/> <Formats souvenir-sheet="245"/> </Stamp> </Set> <!-- Problem 3: Labels for different formats should be in different sequences. Here se-tenant should get no label (as in the first problem), and the coupon labels should start with '1', not '2'. However, were there two se-tenants, they would be labeled '1' and '2' also. --> <Set> <Stamp> <CatNumbers pofis-number="365"/> <Formats souvenir-sheet="365"/> <Formats se-tenant="365"/> </Stamp> <Stamp> <CatNumbers pofis-number="366"/> <Formats souvenir-sheet="365"/> <Formats se-tenant="365"/> </Stamp> <Stamp> <CatNumbers pofis-number="367"/> <Formats souvenir-sheet="365"/> <Formats coupon="367"/> </Stamp> <Stamp> <CatNumbers pofis-number="368"/> <Formats souvenir-sheet="365"/> <Formats coupon="368"/> </Stamp> </Set> </Input> --------------------------------------
<xsl:strip-space elements="*"/> <xsl:template match="Input"> <xsl:element name="Output"> <xsl:apply-templates/> </xsl:element> </xsl:template>
<xsl:template match="Set"> <!-- <xsl:apply-templates mode="stamp"/> Removed, works fine--> <xsl:apply-templates mode="formats"/> </xsl:template>
<xsl:template match="Stamp" mode="formats"> <xsl:apply-templates mode="formats"/> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Unable to select wanted n, Mark | Thread | Re: [xsl] Unable to select wanted n, Brandon Ibach |
Re: [xsl] Define internal xsl varia, Mukul Gandhi | Date | [xsl] Seeking an elegant implementa, Costello, Roger L. |
Month |