V
Vince C.
Hi all,
I've created XML documents that are described with a schema. I'm using those
documents to create web pages.
All my web pages contain a fixed header and a variable document part. The
header is the same in each page and is described in an XML document,
"Head.xml". The document part, which is variable in content, is described in
other XML files (e.g. "Document.xml", "Product.xml", "Register.xml").
Following the liquid design way, a web page is always built from "Head.XML"
and (only) one XML document. A page is always made of a succession of DIV
elements that are positioned using CSS. A DIV corresponds to a piece of
information in the schema.
I defined the base structure of a document in a schema and I wanted that
structure to be extensible. Hence I've extended the definition of a document
to fit other requirements (e.g. form submission documents - "Register.xml",
product sheet - "Product.xml").
For instance, static information contain a title and a body text. The title
and the text form the base document in "Document.xml". A product document,
"Product.xml", extends the base document definition to add a list of
packages. Packages are also rendered in HTML as a DIV below the body text.
The XSL templates required to output a page HTML, HEAD, BODY and document
header are placed in an XSL file, "Head.xsl". The XSL templates to output a
document are placed in another XSL file, "Document.xsl". The templates to
output a product are placed in yet another XSL file, "Product.xsl".
How can I reuse those templates given that the template that outputs the
structure of the web page must be called first?
A concrete case: to output the web page for a document, I need to call some
templates in "Head.xsl", plus some other templates in "Document.xsl" that
should be called in-between. If I want to output the page for a product I
have to call the same templates from "Head.xsl", that should in turn call
some templates from "Document.xsl" (to render title and text) and finally
call some templates from "Product.xsl" (to render packaging below the text).
Such an order in calls is required because the template that renders the
structure of a page also renders the HTML and BODY elements. So I have to
call templates dynamically from within "Head.xsl".
Is there a smart(er) way to achieve this?
Thanks for any hint/suggestion.
Vince C.
I've created XML documents that are described with a schema. I'm using those
documents to create web pages.
All my web pages contain a fixed header and a variable document part. The
header is the same in each page and is described in an XML document,
"Head.xml". The document part, which is variable in content, is described in
other XML files (e.g. "Document.xml", "Product.xml", "Register.xml").
Following the liquid design way, a web page is always built from "Head.XML"
and (only) one XML document. A page is always made of a succession of DIV
elements that are positioned using CSS. A DIV corresponds to a piece of
information in the schema.
I defined the base structure of a document in a schema and I wanted that
structure to be extensible. Hence I've extended the definition of a document
to fit other requirements (e.g. form submission documents - "Register.xml",
product sheet - "Product.xml").
For instance, static information contain a title and a body text. The title
and the text form the base document in "Document.xml". A product document,
"Product.xml", extends the base document definition to add a list of
packages. Packages are also rendered in HTML as a DIV below the body text.
The XSL templates required to output a page HTML, HEAD, BODY and document
header are placed in an XSL file, "Head.xsl". The XSL templates to output a
document are placed in another XSL file, "Document.xsl". The templates to
output a product are placed in yet another XSL file, "Product.xsl".
How can I reuse those templates given that the template that outputs the
structure of the web page must be called first?
A concrete case: to output the web page for a document, I need to call some
templates in "Head.xsl", plus some other templates in "Document.xsl" that
should be called in-between. If I want to output the page for a product I
have to call the same templates from "Head.xsl", that should in turn call
some templates from "Document.xsl" (to render title and text) and finally
call some templates from "Product.xsl" (to render packaging below the text).
Such an order in calls is required because the template that renders the
structure of a page also renders the HTML and BODY elements. So I have to
call templates dynamically from within "Head.xsl".
Is there a smart(er) way to achieve this?
Thanks for any hint/suggestion.
Vince C.