Subject: Re: [xsl] find unique codes From: Xiaocun Xu <xiaocunxu@xxxxxxxxx> Date: Tue, 21 Aug 2001 15:58:15 -0700 (PDT) |
Hi, I am still struggling with this problem. I was thinking, is there a way to use declare one xsl:key across two different types of elements, ExtendedAttributeDefinition/@ExtendedAttributeDefinitionCode and ExtendedAttribute/@ExtendedAttributeCode? Thanks, Xiaocun --- Xiaocun Xu <xiaocunxu@xxxxxxxxx> wrote: > Hi, > > I have the need to find unique attribute codes > across two different types of elements: > ExtendedAttributeDefinition and ExtendedAttribute. > Following is an example, the input has two > ExtendedAttributeDefinition elements with code Color > and Size, as well as two ExtendedAttribute elements > with code Color and New. What I need in output is > the > two ExtendedAttributeDefinition elements with code > Color and Size, as well as the ExtendedAttribute > element with code New. The duplicated > ExtendedAttribute element with code Color is > eliminated. > Attached are the input XML and desired output XML, > with work in progress XSL. I can get all unique > ExtendedAttribute codes across all lineitems via > key, > how can I compare this list with the > ExtendedAttributeDefinition codes and take only the > unique ExtendedAttribute codes? > > Much thanks for any suggestions, > Xiaocun > > Input XML: > <RFQDomainAttributeDefinition Domain="line_item"> > <ExtendedAttributeDefinition > ExtendedAttributeDefinitionCode="Color"/> > <ExtendedAttributeDefinition > ExtendedAttributeDefinitionCode="Size"/> > </RFQDomainAttributeDefinition> > <Requisition> > <LineItem LineItemName="item1"> > <ExtendedAttribute ExtendedAttributeCode="Color"/> > <ExtendedAttribute ExtendedAttributeCode="New"/> > </LineItem> > > Desired Output XML: > <ExtendedAttributeDefinition > ExtendedAttributeDefinitionCode="Color"/> > <ExtendedAttributeDefinition > ExtendedAttributeDefinitionCode="Size"/> > <ExtendedAttribute ExtendedAttributeCode="New"/> > > work in progress XSL: > <xsl:key name="extended-attrs-lineitem-index" > match="LineItem/ExtendedAttribute" > use="@ExtendedAttributeCode"/> > > <xsl:variable name="extended-attrs-def-lineitem" > select="RFQDomainAttributeDefinition[@Domain = > 'line_item']/ExtendedAttributeDefinition"/> > > <xsl:variable name="extended-attrs-lineitem" > select="Requisition/LineItem/ExtendedAttribute[generate-id() > = generate-id(key('extended-attrs-lineitem-index', > @ExtendedAttributeCode))]"/> > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute > with Yahoo! Messenger > http://phonecard.yahoo.com/ > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] declaring global variable, Andrew Welch | Thread | Re: [xsl] find unique codes, Jeni Tennison |
Re: [xsl] how to extract chid node?, Xiaocun Xu | Date | [xsl] Migrating from xalan to oracl, thomas george |
Month |