ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error
|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: ?group? but keep order of elements
Elke,
It turns out I had a chuckle about the "dawson"
reference, and sent the cryptic reply, but forgot to
include my silly punch-line (probably all the better).
As for your question, I assume you discovered, and
then decided against the Meunchian solution.
An alternative, then would be some recursive approach,
along the lines of:
<xsl:template match="total">
<totlal>
<xsl:apply-templates />
</totlal>
</xsl:template>
<xsl:template match="entry[MAT/Fundstelle/UbNummer]">
<xsl:if
test="not(preceding-sibling::*[1][MAT/Fundstelle/UbNummer])">
<uebung>
<xsl:copy-of select="." />
<xsl:for-each
select="following-sibling::*[1][MAT/Fundstelle/UbNummer]">
<xsl:call-template name="exercise-checker" />
</xsl:for-each>
</uebung>
</xsl:if>
</xsl:template>
<xsl:template
match="entry[not(MAT/Fundstelle/UbNummer)]">
<texteintrag>
<xsl:copy-of select="." />
</texteintrag>
</xsl:template>
<xsl:template name="exercise-checker">
<xsl:copy-of select="." />
<xsl:for-each
select="following-sibling::*[1][MAT/Fundstelle/UbNummer]">
<xsl:call-template name="exercise-checker" />
</xsl:for-each>
</xsl:template>
Which transforms this:
<total>
<entry>
<MAT>
<Fundstelle>
<TitelNr></TitelNr>
<UbNummer>0</UbNummer>
</Fundstelle>
</MAT>
<LO >
<Text></Text>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr></TitelNr>
</Fundstelle>
</MAT>
<LO>
<TitelEins></TitelEins>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr></TitelNr>
<UbNummer>1</UbNummer>
</Fundstelle>
</MAT>
<LO >
<Text></Text>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr></TitelNr>
<UbNummer>2</UbNummer>
</Fundstelle>
</MAT>
<LO >
<Text></Text>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr></TitelNr>
<UbNummer>3</UbNummer>
</Fundstelle>
</MAT>
<LO >
<Text></Text>
</LO>
</entry>
</total>
into this:
<totlal>
<uebung>
<entry>
<MAT>
<Fundstelle>
<TitelNr/>
<UbNummer>0</UbNummer>
</Fundstelle>
</MAT>
<LO>
<Text/>
</LO>
</entry>
</uebung>
<texteintrag>
<entry>
<MAT>
<Fundstelle>
<TitelNr/>
</Fundstelle>
</MAT>
<LO>
<TitelEins/>
</LO>
</entry>
</texteintrag>
<uebung>
<entry>
<MAT>
<Fundstelle>
<TitelNr/>
<UbNummer>1</UbNummer>
</Fundstelle>
</MAT>
<LO>
<Text/>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr/>
<UbNummer>2</UbNummer>
</Fundstelle>
</MAT>
<LO>
<Text/>
</LO>
</entry>
<entry>
<MAT>
<Fundstelle>
<TitelNr/>
<UbNummer>3</UbNummer>
</Fundstelle>
</MAT>
<LO>
<Text/>
</LO>
</entry>
</uebung>
</totlal>
(some fine-tuning would still help)
Bryan
--- "Naraschewski, E." <e.naraschewski@xxxxxxxxxxxxx>
wrote:
> Hallo again,
> (my first mail today somehow did not get through to
> the list)
> again I read through the faqs (to Bryan S. Schnabel:
> the list with the p in it) and without any result.
> There are partly answers but not the answer I am
> looking for. I am not sure whether grouping is the
> right direction.
> I can not really fix a position. I can only say: Use
> the node <texteintrag> for all entries up to the
> next <uebung>, than take the node <uebung> up to the
> point where <texteintrag> starts again. Actually I
> would think of xsl:if or xsl:when, but if I choose
> these how can I keep the strucure? I simply need an
> xslt that transforms my xml, adds new elements and
> comprises the child elements and following siblings.
> Do I need something completely different to my
> stylesheet or is there a way to continue?
. . .
> Thanks in advance
> Elke
>
*******************************************************
> Elke Naraschewski - Ernst Klett Verlag GmbH -
> Leistungscenter Mediengestaltung
>
> Rotebühlstr. 77 - 70178 Stuttgart
> Tel.: 0711/6672-1116 - Fax: 0711/6672-2023 - E-mail:
> e.naraschewski@xxxxxxxxxxxxx
>
> Stuttgart HRB 10746 - Verleger: Dr.h.c. Michael
> Klett
> Geschäftsführer: Johannes Leßmann - Harald Melcher -
> Dr. Tilmann Michaletz - Dr. Wolf Unkelbach (Vorsitz)
>
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








