Subject: RE: [xsl] transforming flat structure with xsl 2.0 grouping From: Charlie 0 <charlieo0@xxxxxxxxxxx> Date: Mon, 20 May 2013 11:55:03 -0400 |
Ken,I have an extremely flat structure exported from Framemaker (not structured). The elements are created from style names and the structure is completely flat. Just about everything is a sibling of everything else.
I am transforming this flat structure to a proprietary content model (DTD). The entire project consists of a lot of group. Most of which I have a handle on. However there is aspect I could use some help with.
I have an XML input structure that something like this:
<XML> <Warning> </Warning> <WarnHazText>Cleaning solvent </WarnHazText> <WarnHazText>Wear eye</WarnHazText> <ProcStep>All weldel.</ProcStep> <Warning> </Warning> <WarnHazText>Cleaning solvent </WarnHazText> <WarnHazText>Wear eye</WarnHazText> <HazText>CARC </HazText> <HazText>ALWAYS follow /HazText> <Note></Note> <HazText>When using a torch</HazText> <ProcStep>All weldel.</ProcStep> </XML>
Or it could look like this:
<XML> <ProcStep>All weldel.</ProcStep> <Warning> </Warning> <Graphic> <IMAGE href="icon-30.gif"/> </Graphic> <WarnHazText>Cleaning solvent </WarnHazText> <WarnHazText>Wear eye</WarnHazText> <HazText>CARC </HazText> <HazText>ALWAYS follow /HazText> <ProcStep>All weldel.</ProcStep> </XML>What output would you like from both of those inputs? You don't show that ... you only show your code.
The problem with trying to "fix" the templates you have is that you may have started out on the wrong foot. It is difficult from your prose description to deduce what end structures you want from the above when the transformation is done. Knowing what you want from what you have (and if you have further examples, all the better) would help a volunteer understand the requirement better.
. . . . . . . Ken
-- ------------------------------
<XML> <step1> <specpara> <warning> <trim.para>Cleaning solvent</trim.para> <trim.para>Wear eye</trim.para> </warning> <para>All welds.</para> </specpara> </step1> <step1> <specpara> <warning> <trim.para>Cleaning solvent </WarnHazText> <trim.para>Wear eye</trim.para> <trim.para>CARC </trim.para> <trim.para>ALWAYS follow </trim.para> </warning> <note> <trim.para>When using a torch</trim.para> </note> <para>All weldel. </para> </specpara> </step1> </XML>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] transforming flat structu, G. Ken Holman | Thread | Re: [xsl] transforming flat structu, Imsieke, Gerrit, le- |
[xsl] Digital.Humanities@Oxford Sum, James Cummings | Date | Re: [xsl] deep copy without attribu, Ihe Onwuka |
Month |