Click here to Skip to main content
15,889,511 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: How to de-batch very large XMLDocument into bit size chunks Pin
daveyerwin28-Feb-10 8:44
daveyerwin28-Feb-10 8:44 
GeneralRe: How to de-batch very large XMLDocument into bit size chunks Pin
ONeil Tomlinson1-Mar-10 6:33
ONeil Tomlinson1-Mar-10 6:33 
QuestionUnclosed tr tag Pin
John Jones II26-Feb-10 4:35
John Jones II26-Feb-10 4:35 
AnswerRe: Unclosed tr tag Pin
Richard MacCutchan26-Feb-10 5:23
mveRichard MacCutchan26-Feb-10 5:23 
AnswerRe: Unclosed tr tag Pin
Stuart Dootson26-Feb-10 7:45
professionalStuart Dootson26-Feb-10 7:45 
QuestionXML schema - Element name used to identify item problem... - need to use the element name to identify value when importing into SQL 2005 tables Pin
VicarH25-Feb-10 7:37
VicarH25-Feb-10 7:37 
QuestionDisplay a image in picturebox Pin
kpuneeth723-Feb-10 20:36
kpuneeth723-Feb-10 20:36 
AnswerRe: Display a image in picturebox Pin
Stuart Dootson23-Feb-10 20:50
professionalStuart Dootson23-Feb-10 20:50 
GeneralRe: Display a image in picturebox [modified] Pin
kpuneeth723-Feb-10 21:01
kpuneeth723-Feb-10 21:01 
GeneralRe: Display a image in picturebox Pin
Stuart Dootson23-Feb-10 21:36
professionalStuart Dootson23-Feb-10 21:36 
GeneralRe: Display a image in picturebox Pin
kpuneeth723-Feb-10 23:53
kpuneeth723-Feb-10 23:53 
GeneralRe: Display a image in picturebox Pin
Stuart Dootson24-Feb-10 0:08
professionalStuart Dootson24-Feb-10 0:08 
GeneralRe: Display a image in picturebox Pin
kpuneeth724-Feb-10 1:26
kpuneeth724-Feb-10 1:26 
QuestionMultiple group using Muenchian Method [modified] Pin
ONeil Tomlinson23-Feb-10 4:15
ONeil Tomlinson23-Feb-10 4:15 
I have the following input XML. I want to group all unique Code/ID combination.

<List>
 <Section>
  	<Code>AA</Code>
  	<ID>11</ID>
 <Section>
 <Section>
  	<Code>AA</Code>
  	<ID>11</ID>
 <Section>
 <Section>
  	<Code>CC</Code>
  	<ID>11</ID>
 <Section>
 <Section>
  	<Code>AA</Code>
  	<ID>22</ID>
 <Section>
 <Section>
  	<Code>AA</Code>
  	<ID>11</ID>
 <Section>
<List>


So result should be as shown below.


<Code>AA</Code>
<ID>11</ID>

<Code>CC</Code>
<ID>11</ID>

<Code>AA</Code>
<ID>22</ID>


Im using the Muenchian Method. Currely my XSL (below) is grouping by Code (and not Code/ID combination)

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0" xmlns:ns0="http://A4C.Interface.HRP.Payroll.Schemas">
	<xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />

	<xsl:key name="CCids" match="/List/Section" use="Code"/>

	<xsl:template match="/">
		<xsl:apply-templates select="/ns0:Payroll" />
	</xsl:template>
	<xsl:template match="/ns0:Payroll">
		<ns0:List>
			<xsl:for-each select="/List/Section [generate-id(.)=generate-id(key('CCids',Code))]">
				<Section>
					<Code>
						<xsl:value-of select="code/text()" />
					</Code>
					<ID>
						<xsl:value-of select="id/text()" />
					</ID>
				</Section>
			</xsl:for-each>
		</ns0:List>
	</xsl:template>
</xsl:stylesheet>



How do i get this to use a Code/ID combination? I tried nested for-each loop but no luck. Thanks
modified on Tuesday, February 23, 2010 11:40 AM

AnswerRe: Multiple group using Muenchian Method Pin
Stuart Dootson23-Feb-10 20:47
professionalStuart Dootson23-Feb-10 20:47 
GeneralRe: Multiple group using Muenchian Method Pin
ONeil Tomlinson24-Feb-10 0:05
ONeil Tomlinson24-Feb-10 0:05 
QuestionHow Do I deserialize the following Xml string? [modified] Pin
ashishtango22-Feb-10 23:05
ashishtango22-Feb-10 23:05 
AnswerRe: How Do I deserialize the following Xml string? Pin
Stuart Dootson22-Feb-10 23:54
professionalStuart Dootson22-Feb-10 23:54 
GeneralRe: How Do I deserialize the following Xml string? Pin
ashishtango23-Feb-10 16:52
ashishtango23-Feb-10 16:52 
GeneralRe: How Do I deserialize the following Xml string? Pin
Stuart Dootson23-Feb-10 20:27
professionalStuart Dootson23-Feb-10 20:27 
GeneralRe: How Do I deserialize the following Xml string? Pin
ashishtango24-Feb-10 18:35
ashishtango24-Feb-10 18:35 
QuestionAccessing a image from a xml file and display in visual studio picture box Pin
kpuneeth722-Feb-10 21:15
kpuneeth722-Feb-10 21:15 
AnswerRe: Accessing a image from a xml file and display in visual studio picture box Pin
Richard MacCutchan22-Feb-10 22:31
mveRichard MacCutchan22-Feb-10 22:31 
Questionxsd to entity [modified] Pin
pokiri22-Feb-10 17:45
pokiri22-Feb-10 17:45 
AnswerRe: xsd to entity Pin
Not Active22-Feb-10 21:01
mentorNot Active22-Feb-10 21:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.