You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthew Smith <ms...@windebt.com> on 2000/08/15 21:44:37 UTC

the big picture, dtd's, and substitution entities

    I'm afraid I'm missing the big picture on how to glue all my documents,
xsp, and stylesheets together.  There's a good chance this next question is
a direct result of that.
    How can I create an element that will allow me to use a substitution
macro through both my stylesheet and any xml document that I create to be
parsed with it?  I'm afraid I'm not communicating this correctly, so I'll
elaborate.  Normaly I can define <!entity pricolor "6666FF"> in a DTD, and
then in an xml document I can use &pricolor; anywhere and my xml browsers
will replace it with the hex color definition I specified.
	Now, what I want to do in Cocoon is to be able to define these entities in
the stylesheet and have any occurance of those macros to be substituted.
But I really don't understand how DTD's fit into the Cocoon model.  Or maybe
I just don't know something I should know about stylesheets in this case.
	I'd really appretiate anyone who might be able to clear this up for me.

Thanks,
Matt


RE: the big picture, dtd's, and substitution entities

Posted by Matthew Smith <ms...@windebt.com>.
	Thanks a lot.  That was what I was looking for.  I've had a hard time
finding good tutorials on this stuff.  Most of the information out there is
very dry documentation type material.  While I'll read it when I have to, I
don't care for it much because it usualy covers the features and their flat
technical uses.  I prefer to read sudgestions about how to actualy implement
things, pointing out the most useful features.

Matt

-----Original Message-----
From: OD [mailto:od@feersumendjinns.com]
Sent: Wednesday, August 16, 2000 9:15 AM
To: cocoon-users@xml.apache.org
Subject: Re: the big picture, dtd's, and substitution entities


I'm not sure I understand your problem and I cant see why you'd want color
entities in your DTD, I'm no expert at any of this stuff though and my uses
for it don't do it justice :)

If you are creating color entites to have consistant colors throughout you
output page or to use as variables.
You could use attributes in your xml file (<table color="blue"></table>) or
you could use <xsl:variables> in the stylesheet that hold your various
different colors.
I've included an example xml and xsl file, it was orginally intended to show
a friend the merits of xml/xsl/cocoon for turning simple table based data in
to fairly complex/colorful html tables. I've stripped loads of the html
formatting from the stylesheet and all the database stuff from the xml file.
Hopefully it still makes sense and maybe, if we are lucky, is relevant to
your problem. If not, tell us more.


----- Original Message -----
From: Matthew Smith <ms...@windebt.com>
To: Cocoon List (E-mail) <co...@xml.apache.org>
Sent: Tuesday, August 15, 2000 8:44 PM
Subject: the big picture, dtd's, and substitution entities


>     I'm afraid I'm missing the big picture on how to glue all my
documents,
> xsp, and stylesheets together.  There's a good chance this next question
is
> a direct result of that.
>     How can I create an element that will allow me to use a substitution
> macro through both my stylesheet and any xml document that I create to be
> parsed with it?  I'm afraid I'm not communicating this correctly, so I'll
> elaborate.  Normaly I can define <!entity pricolor "6666FF"> in a DTD, and
> then in an xml document I can use &pricolor; anywhere and my xml browsers
> will replace it with the hex color definition I specified.
> Now, what I want to do in Cocoon is to be able to define these entities in
> the stylesheet and have any occurance of those macros to be substituted.
> But I really don't understand how DTD's fit into the Cocoon model.  Or
maybe
> I just don't know something I should know about stylesheets in this case.
> I'd really appretiate anyone who might be able to clear this up for me.
>
> Thanks,
> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: the big picture, dtd's, and substitution entities

Posted by OD <od...@feersumendjinns.com>.
I'm not sure I understand your problem and I cant see why you'd want color
entities in your DTD, I'm no expert at any of this stuff though and my uses
for it don't do it justice :)

If you are creating color entites to have consistant colors throughout you
output page or to use as variables.
You could use attributes in your xml file (<table color="blue"></table>) or
you could use <xsl:variables> in the stylesheet that hold your various
different colors.
I've included an example xml and xsl file, it was orginally intended to show
a friend the merits of xml/xsl/cocoon for turning simple table based data in
to fairly complex/colorful html tables. I've stripped loads of the html
formatting from the stylesheet and all the database stuff from the xml file.
Hopefully it still makes sense and maybe, if we are lucky, is relevant to
your problem. If not, tell us more.


----- Original Message -----
From: Matthew Smith <ms...@windebt.com>
To: Cocoon List (E-mail) <co...@xml.apache.org>
Sent: Tuesday, August 15, 2000 8:44 PM
Subject: the big picture, dtd's, and substitution entities


>     I'm afraid I'm missing the big picture on how to glue all my
documents,
> xsp, and stylesheets together.  There's a good chance this next question
is
> a direct result of that.
>     How can I create an element that will allow me to use a substitution
> macro through both my stylesheet and any xml document that I create to be
> parsed with it?  I'm afraid I'm not communicating this correctly, so I'll
> elaborate.  Normaly I can define <!entity pricolor "6666FF"> in a DTD, and
> then in an xml document I can use &pricolor; anywhere and my xml browsers
> will replace it with the hex color definition I specified.
> Now, what I want to do in Cocoon is to be able to define these entities in
> the stylesheet and have any occurance of those macros to be substituted.
> But I really don't understand how DTD's fit into the Cocoon model.  Or
maybe
> I just don't know something I should know about stylesheets in this case.
> I'd really appretiate anyone who might be able to clear this up for me.
>
> Thanks,
> Matt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org