You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Eric Rodriguez <to...@yahoo.com> on 2004/06/10 19:43:52 UTC

Custom Doctype

Hi! I've been following the tutorial LenyaAddingCustomDocType 
(http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType) with 
no luck, since it seems Lenya is totally ignoring my 
"customDoctype2xhtml.xsl" stylesheet. I've tested my stylesheet with 
other processors (including Cocoon) and it works fine but lenya just 
ignores it. I've also noticed that if I add my templates to 
"xhtml2xhtml.xsl" on "mypub/xslt" it works fine, but that's not the 
point of having a custom doctype.

So, I want to ask you 2 questions in concrete:
1) Is "mypub/xslt/xhtml2xhtml.xsl" always called or is Lenya defaulting 
the doctype to xhtml???
2) does my sample xml (e.g. "customDoctype.xml") needs all "lenya" and 
"dc" tags present on the sample "xhtml.xml"?

Thanx for any help,
Eric Rodriguez


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Andreas Hartmann <an...@apache.org>.
Eric Rodriguez wrote:

> Gregor J. Rothfuss wrote:
> 
>> Eric Rodriguez wrote:
>>
>>> 1) Is "mypub/xslt/xhtml2xhtml.xsl" always called or is Lenya 
>>> defaulting the doctype to xhtml???
>>
>>
>>
>> no. the doctype is chosen by looking into the file that matches the 
>> request, getting the root namespace, and comparing that with the 
>> definitions in doctypes.xmap. make sure to follow the naming 
>> conventions throughout. if you have defined the name of your doctype 
>> as customDoctype then thats what lenya expects.
>>
>> is that the case for you?
>>
> If I understand it correctly, my request is sent to 
> "mypub/content/rc/view.xsp" and this XSP searches the root namespace of 
> my sample document. Is this right? So if in my sample xml I have 
> xmlns:card="http://anydomain.com/card" then view.xsp takes the string 
> "card" and then goes to mypub/xslt and looks for card2xhtml.xsl it 
> processes it and the result will later be transformed by page2html.xsl - 
> Is that more or less the process?

No.
view.xsp has nothing to do with the doctype resolving, its purpose
is to generate a revision from the revision history.

The doctype is resolved in parameter-doctype.xmap using the
SourceTypeAction.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Eric Rodriguez <to...@yahoo.com>.
Gregor J. Rothfuss wrote:

> Eric Rodriguez wrote:
>
>> 1) Is "mypub/xslt/xhtml2xhtml.xsl" always called or is Lenya 
>> defaulting the doctype to xhtml???
>
>
> no. the doctype is chosen by looking into the file that matches the 
> request, getting the root namespace, and comparing that with the 
> definitions in doctypes.xmap. make sure to follow the naming 
> conventions throughout. if you have defined the name of your doctype 
> as customDoctype then thats what lenya expects.
>
> is that the case for you?
>
If I understand it correctly, my request is sent to 
"mypub/content/rc/view.xsp" and this XSP searches the root namespace of 
my sample document. Is this right? So if in my sample xml I have 
xmlns:card="http://anydomain.com/card" then view.xsp takes the string 
"card" and then goes to mypub/xslt and looks for card2xhtml.xsl it 
processes it and the result will later be transformed by page2html.xsl - 
Is that more or less the process?




---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Jean Pierre LeJacq wrote:

>>>2) does my sample xml (e.g. "customDoctype.xml") needs all "lenya" and
>>>"dc" tags present on the sample "xhtml.xml"?
>>
>>no. only if you want to use asset management and metadata.
> 
> Will lenya add these if they are missing from the document
> initially?  Or is it the case that they must exist at creation time
> otherwise they are ignored?

lenya wont add them. this would be risky because the schema might not 
allow it. that said, i would recommend to include the lenya metadata in 
your custom doctypes. they do not harm you if you dont use them but can 
come in handy if you want to start using them

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Thu, 10 Jun 2004, Gregor J. Rothfuss wrote:

> Eric Rodriguez wrote:
>
> > 2) does my sample xml (e.g. "customDoctype.xml") needs all "lenya" and
> > "dc" tags present on the sample "xhtml.xml"?
>
> no. only if you want to use asset management and metadata.

Will lenya add these if they are missing from the document
initially?  Or is it the case that they must exist at creation time
otherwise they are ignored?

-- 
JP



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Eric Rodriguez wrote:
> Hi! I've been following the tutorial LenyaAddingCustomDocType 
> (http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType) with 
> no luck, since it seems Lenya is totally ignoring my 
> "customDoctype2xhtml.xsl" stylesheet. I've tested my stylesheet with 
> other processors (including Cocoon) and it works fine but lenya just 
> ignores it. I've also noticed that if I add my templates to 
> "xhtml2xhtml.xsl" on "mypub/xslt" it works fine, but that's not the 
> point of having a custom doctype.
> 
> So, I want to ask you 2 questions in concrete:
> 1) Is "mypub/xslt/xhtml2xhtml.xsl" always called or is Lenya defaulting 
> the doctype to xhtml???

no. the doctype is chosen by looking into the file that matches the 
request, getting the root namespace, and comparing that with the 
definitions in doctypes.xmap. make sure to follow the naming conventions 
throughout. if you have defined the name of your doctype as 
customDoctype then thats what lenya expects.

is that the case for you?

> 2) does my sample xml (e.g. "customDoctype.xml") needs all "lenya" and 
> "dc" tags present on the sample "xhtml.xml"?

no. only if you want to use asset management and metadata.

-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Jean Pierre LeJacq <jp...@quoininc.com>.
On Tue, 15 Jun 2004, Eric Rodriguez wrote:

> Gregor J. Rothfuss wrote:
>
> > bxe is schema driven and only allows you to edit the elements and
> > attributes (and even attribute values) as defined in the schema. i
> > would recommend bxe over the forms editor.
>
> Can I edit different  doctypes on the same publication with BXE? If so,
> where do I configure it, I've been reading the documentation and the
> wiki but I can't find how to configure it for different doctypes. Best I
> could do was adding "mydoctype-namespaces.xml" to
> mypub/resources/misc/bxeng but when I try to edit the document it
> doesn't let me!!! I'm a newbie in Lenya and I guess this is a common
> question so if you could direct me as to where to find answers for these
> "simple" issues.

Yes, different documents can be instances of different doctypes.
Take a look at the University of Zurich publication for an example
of how to do this.  The lenya wiki also has an article on how to
define your own custom doctypes.

-- 
JP



---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Eric Rodriguez <to...@yahoo.com>.
Gregor J. Rothfuss wrote:

> Eric Rodriguez wrote:
>
>>  would like to hear any comments/critics/alternative solutions, etc. 
>> After all, the idea of using a WYSIWYG editor is tempting but i'm not 
>> sure how configurable they are.
>
>
> bxe is schema driven and only allows you to edit the elements and 
> attributes (and even attribute values) as defined in the schema. i 
> would recommend bxe over the forms editor.
>
>
Can I edit different  doctypes on the same publication with BXE? If so, 
where do I configure it, I've been reading the documentation and the 
wiki but I can't find how to configure it for different doctypes. Best I 
could do was adding "mydoctype-namespaces.xml" to 
mypub/resources/misc/bxeng but when I try to edit the document it 
doesn't let me!!! I'm a newbie in Lenya and I guess this is a common 
question so if you could direct me as to where to find answers for these 
"simple" issues.

Thanx,
Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Eric Rodriguez wrote:

> The logical question now is regarding editors. I need different people 
> to be able to create new documents but I really need a lot of control on 
> the elements they use (that's why I have created my own doctype).  For 
> example, I don't want anybody to be able to place an image without an 
> 'alt' attribute or a "menu-item" without an ID or things like that. I 
> think the solution is to use the Forms Editor and creating an xsl for my 
> doctype, but since you guys are the experts I would like to hear any 
> comments/critics/alternative solutions, etc. After all, the idea of 
> using a WYSIWYG editor is tempting but i'm not sure how configurable 
> they are.

bxe is schema driven and only allows you to edit the elements and 
attributes (and even attribute values) as defined in the schema. i would 
recommend bxe over the forms editor.


-- 
Gregor J. Rothfuss
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://wyona.com                   http://cocoon.apache.org/lenya
gregor.rothfuss@wyona.com                       gregor@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Eric Rodriguez <to...@yahoo.com>.
> BTW, I'd recommend to use the namespace URI for sourcetype
> resolving.
>
> -- Andreas
>
Well, I forgot about the local-name and used a namespace instead, It 
worked out fine!!! Thanx a lot guys!!!

The logical question now is regarding editors. I need different people 
to be able to create new documents but I really need a lot of control on 
the elements they use (that's why I have created my own doctype).  For 
example, I don't want anybody to be able to place an image without an 
'alt' attribute or a "menu-item" without an ID or things like that. I 
think the solution is to use the Forms Editor and creating an xsl for my 
doctype, but since you guys are the experts I would like to hear any 
comments/critics/alternative solutions, etc. After all, the idea of 
using a WYSIWYG editor is tempting but i'm not sure how configurable 
they are.

Thanks,
Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Andreas Hartmann <an...@apache.org>.
Eric Rodriguez wrote:

[...]
>>
> In parameter-doctype.xmap I have defined the following:
> <map:actions>
>    <map:action logger="sitemap.action.sourcetype" name="sourcetype"  
> src="org.apache.forrest.components.sourcetype.SourceTypeAction">
>        <sourcetype name="xhtml">
>          <document-element namespace="http://www.w3.org/1999/xhtml" />
>        </sourcetype>
>       <sourcetype name="card">
>          <document-element local-name="card" />
>        </sourcetype>
>    </map:action>
> </map:actions>
> 
> "card" being of course the name of my doctype which corresponds to 
> card.rng and card2xhtml.rng and to the namespace 
> xmlns:card="http://anydomain.com/card"

What do you mean with "corresponds to the namespace"?

> which I use on both the sample 
> xml and in the xsl file.

And the local name of your document element is "card"?
BTW, I'd recommend to use the namespace URI for sourcetype
resolving.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Eric Rodriguez <to...@yahoo.com>.
Andreas Hartmann wrote:

> Eric Rodriguez wrote:
>
>>  it seems Lenya is totally ignoring my "customDoctype2xhtml.xsl" 
>> stylesheet.
>
>
> It seems that your parameter-doctype.xmap does not return
> the correct doctype for your URL.
>
> -- Andreas
>
In parameter-doctype.xmap I have defined the following:
 <map:actions>
    <map:action logger="sitemap.action.sourcetype" name="sourcetype"  
src="org.apache.forrest.components.sourcetype.SourceTypeAction">
        <sourcetype name="xhtml">
          <document-element namespace="http://www.w3.org/1999/xhtml" />
        </sourcetype>
       <sourcetype name="card">
          <document-element local-name="card" />
        </sourcetype>
    </map:action>
</map:actions>

"card" being of course the name of my doctype which corresponds to 
card.rng and card2xhtml.rng and to the namespace 
xmlns:card="http://anydomain.com/card" which I use on both the sample 
xml and in the xsl file.

But it doesn't work!!!!! aaaahhhhh

Well, as always any help is GREATLY appreciated.

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Custom Doctype

Posted by Andreas Hartmann <an...@apache.org>.
Eric Rodriguez wrote:

> Hi! I've been following the tutorial LenyaAddingCustomDocType 
> (http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType) with 
> no luck, since it seems Lenya is totally ignoring my 
> "customDoctype2xhtml.xsl" stylesheet.

It seems that your parameter-doctype.xmap does not return
the correct doctype for your URL.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org