Subject: [xsl] find unique codes From: Xiaocun Xu <xiaocunxu@xxxxxxxxx> Date: Mon, 20 Aug 2001 19:17:29 -0700 (PDT) |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] RE: XSLT WG: What is plan, David_Marston | Thread | [xsl] declaring global variable in , Syed Abuthaheer |
RE: [xsl] Xquery vs XSLT, Evan Lenz | Date | [xsl] declaring global variable in , Syed Abuthaheer |
Month |