BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


SQL XML
Passing stored procedure a list of complete zipcodes to validate
Convert a flat text file into xml
XML IMDB Concepts.
Using XML as a Data Store
Creating An XML Based Cache Using COM
Character encoding, a few words on the subject
How to use the ADO Stream object to retrieve SQL2000 XML
How to transfer XML into a plain text file?
Convert XDR to XML
Sort a table using the header of the table
Applying a XSLT stylesheet using the DBMS_XMLQuery package
N:N relationships with DBMS_XMLQuery Package
DBMS_XMLQuery package bind values to produce more than one xml file
Download data from a database in XML
Inserting XML file into a table using DBMS_XMLSave Package
Insert XML file into a table using ADO
How to call out to a COM component's method through XSLT
How to select DISTINCT items from XML via XSLT
How to convert Word (RTF) documents to XML for auto publication
Creating SQL Statements with XSLT


 
 

<< SEOSystem.XML >>


By Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First Posted 04/19/2001
Times viewed 350

Filtering unique values


Summary Following code allows you to filter data by one of the data-fields similar to a Select unique in SQL.

Imagine the follwing scenario: You have a list of customers define by country, name , address and phone. You want to display them by country but you only want to display the country name once and then list all the customer for that country. Or you want to diplay how many customer have an address in each country. Since the list of countries is part of the XML data you can't use a select="record[country='usa']" The solution uses some xpath funcionality to filter out all other siblings with the same country value. Note: I tried to use xsl:sort on the data first to create an ordered list but discovered that the Xpath functionality (preceding-sibling works on the original XML and not on the sorted list. Following the excellent advise of Marrow I have now added the Meunchian technique to filter unique values. This technique uses xsl:key and generate-id.

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< SEOSystem.XML >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML