Hi,
sorry but this doesn't work for me. But with a little
brainstorming this code works for me (together with the
XSLT-Code):
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="test10.xsl" type="text/xsl"?>
<!DOCTYPE BUCH [<!ELEMENT BUCH (KAPITEL)+>
<!ELEMENT KAPITEL (UEBERSCHRIFT, UNTERKAPITEL*)*>
<!ELEMENT UEBERSCHRIFT (#PCDATA)>
<!ELEMENT UNTERKAPITEL (ZWISCHENUEBERSCHRIFT,POINT,TEXT)*>
<!ELEMENT POINT (#PCDATA)>
<!ELEMENT ZWISCHENUEBERSCHRIFT (#PCDATA)>
<!ELEMENT TEXT (#PCDATA)>] >
XSLT-Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"></xsl:output>
<xsl:template match="BUCH">
<xsl:for-each select="KAPITEL">
<H1>
<xsl:value-of select="UEBERSCHRIFT"></xsl:value-of>
</H1>
<xsl:for-each select="UNTERKAPITEL">
<H3>
<xsl:value-of select="ZWISCHENUEBERSCHRIFT"></xsl:value-of>
</H3>
<H4>
<xsl:value-of select="POINT"></xsl:value-of>
</H4>
<P>
<xsl:value-of select="TEXT"></xsl:value-of>
</P>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
thanx for alle the hints
M.
Michael Rühling schrieb:
Quote:
Originally Posted by
Hi,
this seems to be the right way, I suppose and therefore
I will try this as soons as possible. And furthermore if
this works for me, I will try to understand it.
>
>
thanx
M.
>
Peter Flynn schrieb:
Quote:
Originally Posted by
> Join Bytes! wrote:
Quote:
Originally Posted by
>>Hi,
>>I am sorry for not beeing totally precise.
>>The BUCH or KAPITEL function works fine. What makes the problem ist
>>the UEBERSCHRIFT-thing.
>>>
>>XSLT-Code says UEBERSCHRIFT can be more than one (the reference part
>>of my book says so). And I want to have more than one UEBERSCHRIFT in
>>one KAPITEL. Even more than one ZWISCHENUEBERSCHRIFT and TEXT.
>>I don't want to have only one UEBERSCHRIFT and ZWISCHENUEBERSCHRIFT
>>and TEXT Part in my KAPITEL, because, it makes no sense to have an
>>extra KAPITEL for a short TEXT which belongs to a UEBERSCHRIFT.
|
>>
>Yes, it is possible (but unusual) to have more than one ueberschrift
>in a chapter.
>>
>I think you may be confusing the ueberschrift with the concept of a
>container like <sectionor <subsection>. XML is normally built on a
>hierarchical model or containers, unlike (eg) LaTeX, where headings
>are simply interruptions to the flow of text (eg \section{}, not
>\begin{section}...\end{section}).
>>
><!DOCTYPE buch [
><!ELEMENT buch (kapitel)+>
><!ELEMENT kapitel (ueberschrift,text+,unterkapitel*)>
><!ELEMENT ueberschrift (#PCDATA)>
><!ELEMENT unterkapitel (ueberschrift,text+)>
><!ELEMENT text (#PCDATA)>
>]>
|
|