Skip to content

Commit

Permalink
DTD and XSLS changes for modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdocguard committed Sep 5, 2011
1 parent 82854d0 commit cd7b80a
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 42 deletions.
80 changes: 64 additions & 16 deletions docs/dtd/module.dtd
Original file line number Diff line number Diff line change
@@ -1,24 +1,72 @@

<!ELEMENT module (section+) >
<!ATTLIST module title CDATA #REQUIRED
link CDATA #REQUIRED
lang (en) #REQUIRED
<!ELEMENT module (section+) >
<!ATTLIST module
name CDATA #REQUIRED
id ID #REQUIRED
>

<!ELEMENT section (directive+ | para+) >
<!ATTLIST section title CDATA #REQUIRED
name CDATA #IMPLIED
<!ELEMENT section (directive+ | para+) >
<!ATTLIST section
name CDATA #REQUIRED
id ID #IMPLIED
>

<!ELEMENT directive (syntax, default, context, para+) >
<!ATTLIST directive name CDATA #REQUIRED >
<!ELEMENT directive (syntax+, default, context+, para+) >
<!ATTLIST directive
name ID #REQUIRED
appeared-in CDATA #IMPLIED
>

<!ELEMENT syntax (#PCDATA | argument | code | parameter | value)* >

<!ELEMENT default (#PCDATA | code)* >

<!ELEMENT context (#PCDATA)* >

<!ELEMENT para (#PCDATA | argument | c-def | c-func | code | command | emphasis | example | header | http-error | link | list | note | parameter | value | var)* >

<!ELEMENT argument (#PCDATA)* >

<!ELEMENT c-def (#PCDATA)* >

<!ELEMENT c-func (#PCDATA)* >

<!ELEMENT code (#PCDATA | value)* >

<!ELEMENT command (#PCDATA)* >

<!ELEMENT emphasis (#PCDATA)* >

<!ELEMENT example (#PCDATA)* >

<!ELEMENT header (#PCDATA)* >

<!ELEMENT http-error EMPTY >
<!ATTLIST http-error
code CDATA #REQUIRED
text CDATA #IMPLIED
>

<!ELEMENT link (#PCDATA)* >
<!ATTLIST link
doc CDATA #IMPLIED
id CDATA #IMPLIED
>

<!ELEMENT list (listitem+) >
<!ATTLIST list
type (bullet | enum) #REQUIRED
>

<!ELEMENT listitem ANY >

<!ELEMENT note ANY >

<!ELEMENT parameter (#PCDATA)* >

<!ELEMENT syntax (#PCDATA | value)* >
<!ELEMENT default (#PCDATA)* >
<!ELEMENT context (#PCDATA)* >
<!ELEMENT value (#PCDATA)* >

<!ELEMENT para (#PCDATA | value)* >
<!ELEMENT value (#PCDATA)* >
<!ELEMENT var (#PCDATA)* >

<!ENTITY nbsp "&#xA0;" >
<!ENTITY mdash "&#xA0;- " >
<!ENTITY nbsp "&#xA0;" >
<!ENTITY mdash "&#xA0;- " >
51 changes: 40 additions & 11 deletions docs/xsls/content.xsls
Original file line number Diff line number Diff line change
@@ -1,19 +1,48 @@
X:stylesheet {

X:template = "section[@name and @title]" {
<a name="{@name}" /> <center><h4> !{@title} </h4></center>
!!;
}
X:template = "section[@id and @name]" {
<a name="{@id}" /> <center><h4> !{@name} </h4></center>
!!;
}

X:template = "section[not(@name) and @title]" {
<center><h4> !{@title} </h4></center>
!!;
}
X:template = "section[not(@id) and @name]" {
<center><h4> !{@name} </h4></center>
!!;
}

X:template = "section[not(@id) and not(@name)]" { !!; }

X:template = "para" { <p> !!; </p> }

X:template = "c-def" { <code> !!; </code> }

X:template = "c-func" { <code> !!; X:text{()} </code> }

X:template = "code" { <code> !!; </code> }

X:template = "command" { <code> !!; </code> }

X:template = "example" { <blockquote><pre> !!; </pre></blockquote> }

X:template = "emphasis" { <strong> !!; </strong> }

X:template = "header" { <code> !!; </code> }

X:template = "http-error" {
<i> X:text{&quot;} !{@text} X:text{&quot;} </i>
X:text{ (} !{@code} X:text{)}
}

X:template = "section[not(@name) and not(@title)]" { !!; }
X:template = "link[@id and not(@doc)]" { <a href="#{@id}"> !!; </a> }
X:template = "link" { <u> !!; </u> }

X:template = "para" { <p> !!; </p> }
X:template = "list[@type='bullet']" { <ul> !!; </ul> }
X:template = "list[@type='enum']" { <ol> !!; </ol> }
X:template = "listitem" { <li> !!; </li> }

X:template = "value" { <i> !!; </i> }
X:template = "argument" { <code><i> !!; </i></code> }
X:template = "parameter" { <code> !!; </code> }
X:template = "value" { <code> !!; </code> }

X:template = "var" { <code> !!; </code> }
}
62 changes: 49 additions & 13 deletions docs/xsls/directive.xsls
Original file line number Diff line number Diff line change
@@ -1,15 +1,51 @@
X:stylesheet {

X:template = "directive" {
<a name="{@name}" /> <center><h4> !{@name} </h4></center>
!! "syntax";
!! "default";
!! "context";
!! "para";
}

X:template = "syntax" { X:text {syntax: } !!; <br/> }
X:template = "default" { X:text {default: } !!; <br/> }
X:template = "context" { X:text {context: } !!; <br/> }


X:template = "directive" {
<hr/>
<a name="{@name}"/>
<!-- <center><h4> !{@name} </h4></center> -->
!! "syntax";
!! "default";
!! "context";
X:if "(@appeared-in)" {
<strong>appeared in version</strong>: !{@appeared-in}
}
!! "para";
}

X:template = "syntax" {
X:if "position() = 1" {
<strong>syntax</strong>:
} else {
<code>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</code>
}
<code> !!; </code> <br/>
}

X:template = "default" {
<strong>default</strong>:
X:if "count(text()) = 0" {
<strong>none</strong>
} else {
<code> !!; </code>
}
<br/>
}

X:template = "context" {
X:if "position() = 1" {
<strong>context</strong>:
}
X:if "count(text()) = 0" {
<strong>any</strong>
} else {
<code> !!; </code>
}
X:if "position() != last()" {
X:text{, }
} else {
<br/>
}
}

}
4 changes: 2 additions & 2 deletions docs/xsls/module.xsls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ X:strip-space elements = "*";
-->
X:param XML = "'../xml'";

X:var LINK = "/module/@link";
X:var ID = "/module/@id";

X:include href = "directive.xslt";
X:include href = "content.xslt";
Expand All @@ -19,7 +19,7 @@ X:include href = "content.xslt";
X:template = "/module" {
<html><head>

<title> !{@title} </title>
<title> !{@name} </title>

</head>
<body>
Expand Down

0 comments on commit cd7b80a

Please sign in to comment.