N
NiQuil
Hello people,
I am creating a portal which should be easy maintainable by
non-programmers.
Thus far people can easyly change the text, set it Bold Italic and
Underlined. Also i can set a footnote which will be displayed at the
bottom of the text.
The next feature i would like to create involves creating a link.
--->I want to be able to insert a link in a piece of tekst.<---
I am very new to xml (started yesterday) and I hope someone could give
me some directions in this matter.
This is what I have thus-far:
-------The DTD--------------------------------------------------
<!ENTITY % paratext " #PCDATA | bold | italic | underline | footnote">
<!ELEMENT page (message*)>
<!ELEMENT message (header, title, bodyText, footer, numbering)>
<!ELEMENT header (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT bodyNumber (#PCDATA)>
<!ELEMENT bodyText (paragraph*)>
<!ELEMENT paragraph (¶text* >
<!ELEMENT footnote (¶text*>
<!ELEMENT footer (#PCDATA)>
<!ELEMENT numbering (#PCDATA)>
------------------------------------------------------------------
--------The xslt--------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/page">
<html>
<body>
<table border="1" width="100%">
<tr>
<td>
<xsl:apply-templates select="message" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="message">
<table border="1" bordercolor="#9acd32" width="100%">
<tr>
<td colspan="2">
<h6>
<xsl:value-of select="header" />
</h6>
</td>
</tr>
<tr>
<td colspan="2">
<h2>
<xsl:value-of select="title" />
</h2>
</td>
</tr>
<tr>
<td>
<xsl:value-of select="bodyNumber" />
</td>
<td>
<xsl:apply-templates select="bodyText" />
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="footer" />
</td>
</tr>
</table><br/>
</xsl:template>
<xsl:template match="bodyText">
<table border="1" bordercolor="black" align="center" width="100%">
<tr>
<td><xsl:apply-templates select="paragraph"/> </td>
</tr>
</table>
</xsl:template>
<xsl:template match="paragraph">
<p><xsl:apply-templates /></p>
<xsl:for-each select="footnote">
<sup><xsl:number level="any" count="footnote" from="paragraph"
format="1"/></sup> <xsl:value-of select="." /><br />
</xsl:for-each>
</xsl:template>
<xsl:template match="footnote">
<sup><xsl:number level="any" count="footnote" from="paragraph"
format="1"/></sup>
</xsl:template>
<xsl:template match="bold">
<b><xsl:apply-templates /> </b>
</xsl:template>
<xsl:template match="underline">
<u><xsl:apply-templates /> </u>
</xsl:template>
<xsl:template match="italic">
<i><xsl:apply-templates /> </i>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------
-------XML-File------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--<!DOCTYPE GeneralText_1 SYSTEM "GeneralText_1.dtd"> -->
<?xml-stylesheet type="text/xsl" href="GeneralText_1.xslt"?>
<page>
<message>
<header>xml document editor</header>
<title>Welcome</title>
<bodyNumber>Punt 1</bodyNumber>
<bodyText>
<paragraph>text <bold>bold text</bold> more text<italic>Italic
text</italic> more text<underline>underlined text</underline>more
text<footnote>an added footnote</footnote>.</paragraph>
</bodyText>
<footer>Versie 0.1</footer>
<numbering>1</numbering>
</message>
----------------------------------------------------------------------------
Thank You in advance for your help.
If you feel i have put this question in the wrong newsgroup please
state so. (I am also new to newsgroups)
Greetz Wilbert.
I am creating a portal which should be easy maintainable by
non-programmers.
Thus far people can easyly change the text, set it Bold Italic and
Underlined. Also i can set a footnote which will be displayed at the
bottom of the text.
The next feature i would like to create involves creating a link.
--->I want to be able to insert a link in a piece of tekst.<---
I am very new to xml (started yesterday) and I hope someone could give
me some directions in this matter.
This is what I have thus-far:
-------The DTD--------------------------------------------------
<!ENTITY % paratext " #PCDATA | bold | italic | underline | footnote">
<!ELEMENT page (message*)>
<!ELEMENT message (header, title, bodyText, footer, numbering)>
<!ELEMENT header (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT bodyNumber (#PCDATA)>
<!ELEMENT bodyText (paragraph*)>
<!ELEMENT paragraph (¶text* >
<!ELEMENT footnote (¶text*>
<!ELEMENT footer (#PCDATA)>
<!ELEMENT numbering (#PCDATA)>
------------------------------------------------------------------
--------The xslt--------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/page">
<html>
<body>
<table border="1" width="100%">
<tr>
<td>
<xsl:apply-templates select="message" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="message">
<table border="1" bordercolor="#9acd32" width="100%">
<tr>
<td colspan="2">
<h6>
<xsl:value-of select="header" />
</h6>
</td>
</tr>
<tr>
<td colspan="2">
<h2>
<xsl:value-of select="title" />
</h2>
</td>
</tr>
<tr>
<td>
<xsl:value-of select="bodyNumber" />
</td>
<td>
<xsl:apply-templates select="bodyText" />
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="footer" />
</td>
</tr>
</table><br/>
</xsl:template>
<xsl:template match="bodyText">
<table border="1" bordercolor="black" align="center" width="100%">
<tr>
<td><xsl:apply-templates select="paragraph"/> </td>
</tr>
</table>
</xsl:template>
<xsl:template match="paragraph">
<p><xsl:apply-templates /></p>
<xsl:for-each select="footnote">
<sup><xsl:number level="any" count="footnote" from="paragraph"
format="1"/></sup> <xsl:value-of select="." /><br />
</xsl:for-each>
</xsl:template>
<xsl:template match="footnote">
<sup><xsl:number level="any" count="footnote" from="paragraph"
format="1"/></sup>
</xsl:template>
<xsl:template match="bold">
<b><xsl:apply-templates /> </b>
</xsl:template>
<xsl:template match="underline">
<u><xsl:apply-templates /> </u>
</xsl:template>
<xsl:template match="italic">
<i><xsl:apply-templates /> </i>
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------
-------XML-File------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!--<!DOCTYPE GeneralText_1 SYSTEM "GeneralText_1.dtd"> -->
<?xml-stylesheet type="text/xsl" href="GeneralText_1.xslt"?>
<page>
<message>
<header>xml document editor</header>
<title>Welcome</title>
<bodyNumber>Punt 1</bodyNumber>
<bodyText>
<paragraph>text <bold>bold text</bold> more text<italic>Italic
text</italic> more text<underline>underlined text</underline>more
text<footnote>an added footnote</footnote>.</paragraph>
</bodyText>
<footer>Versie 0.1</footer>
<numbering>1</numbering>
</message>
----------------------------------------------------------------------------
Thank You in advance for your help.
If you feel i have put this question in the wrong newsgroup please
state so. (I am also new to newsgroups)
Greetz Wilbert.