You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jorden Woods <jo...@paradigmsgroup.com> on 2004/09/28 08:18:28 UTC

AddingCustomDocType Issues

Hi:

I have followed the steps in the tutorial for adding a new doctype.

I am having difficulty with the doctype matcher (step 4).

Specifically, I do not quite understand what a root tag is.

So for example in the code below, what do I use for "myroottag"?:

<map:action name="sourcetype" 
src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
  <sourcetype name="mydoctype">
    <document-element local-name="myroottag"/>
    <!-- this matches the root tag -->
  </sourcetype>
</map:action>

Also, do I invoke the "mydoctype" doctype by calling a new "page", "mydoctype".

I have gone through all the steps for setting up a doctype but I cannot get a 
new page to use the new template.

Your help is appreciated.

Cheers,

Jorden.


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


Re: AddingCustomDocType Issues

Posted by Jorden Woods <jo...@paradigmsgroup.com>.
Jorden Woods <jorden <at> paradigmsgroup.com> writes:

> 
Andreas:

I figured it out -- please disregard the previous post.

Cheers,

Jorden.

> Andreas Hartmann <andreas <at> apache.org> writes:
> 
> > 






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


Re: AddingCustomDocType Issues

Posted by Andreas Hartmann <an...@apache.org>.
Jorden Woods wrote:
> Andreas Hartmann <andreas <at> apache.org> writes:

[...]

> 
> Sorry, but I thought everything was working.
> 
> Can you give me an example of the correct matching for a)and b)above? 
> 

Before answering your questions - are you familiar with

- the XML terms "local name" and "qualified name"
- the concept of XML namespaces

I guess as soon as you know what these things are
about, your questions will vanish in a puff of smoke :)

I won't explain it here, as other people have done
this much better, for instance at
http://www.w3schools.com/xml/xml_namespaces.asp


You'll find further information about the Forrest source
type action here:
http://forrest.apache.org/docs/cap.html

-- Andreas

> With the menu option in place I am loading my new sample template for new pages 
> but still seeing the formatting for the XHTML doctype.
> 
> What I want is a structure like:
> 
> <sourcetype name="xhtml">
>   <document-element namespace="http://www.w3.org/1999/xhtml" />
> </sourcetype>
> 
> <sourcetype name="mydoctype1">
>   <document-element local-name or namespace= "?????" />
> </sourcetype>
> 
> <sourcetype name="mydoctype2">
>   <document-element local-name or namespace= "?????" />
> </sourcetype>
> 
> <sourcetype name="....>
> ...
> </sourcetype>
> 
> However, I do not know what to put in place of the question marks.
> 
> Thanks,
> 
> Jorden.


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


Re: AddingCustomDocType Issues

Posted by Jorden Woods <jo...@paradigmsgroup.com>.
Andreas Hartmann <andreas <at> apache.org> writes:

> 
> Jorden Woods wrote:
> > Andreas Hartmann <andreas <at> apache.org> writes:
> 
> [...]
> 
> > I guess the bigger question, though, is how do I stop the XHTML doctype 
from 
> > overriding every other doctype chosen?
> 
> ??
> 
> > For example, all doctypes are set to have the namespace 
> > ="http://www.w3.org/19999/xhtml" which is the 'switch' for the XHMTL 
doctype.
> > 
> > The 'switch' is:
> > 
> > <sourcetype name="xhmtl">
> >    <document-element namespace="http://www.w3.org/1999/xhtml">
> > </sourcetype>
> 
> Yes, which means you could
> 
> a) change this source type declaration to match for something
>     else
> 
> b) use another namespace in the schemas for your other doctype(s)
> 

Sorry, but I thought everything was working.

Can you give me an example of the correct matching for a)and b)above? 

With the menu option in place I am loading my new sample template for new pages 
but still seeing the formatting for the XHTML doctype.

What I want is a structure like:

<sourcetype name="xhtml">
  <document-element namespace="http://www.w3.org/1999/xhtml" />
</sourcetype>

<sourcetype name="mydoctype1">
  <document-element local-name or namespace= "?????" />
</sourcetype>

<sourcetype name="mydoctype2">
  <document-element local-name or namespace= "?????" />
</sourcetype>

<sourcetype name="....>
...
</sourcetype>

However, I do not know what to put in place of the question marks.

Thanks,

Jorden.





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


Re: AddingCustomDocType Issues

Posted by Jorden Woods <jo...@paradigmsgroup.com>.
Andreas Hartmann <andreas <at> apache.org> writes:
 

Thanks -- all problems solved!

Cheers,

Jorden.



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


Re: AddingCustomDocType Issues

Posted by Andreas Hartmann <an...@apache.org>.
Jorden Woods wrote:
> Andreas Hartmann <andreas <at> apache.org> writes:

[...]


> I guess the bigger question, though, is how do I stop the XHTML doctype from 
> overriding every other doctype chosen?

??

> For example, all doctypes are set to have the namespace 
> ="http://www.w3.org/19999/xhtml" which is the 'switch' for the XHMTL doctype.
> 
> The 'switch' is:
> 
> <sourcetype name="xhmtl">
>    <document-element namespace="http://www.w3.org/1999/xhtml">
> </sourcetype>

Yes, which means you could

a) change this source type declaration to match for something
    else

b) use another namespace in the schemas for your other doctype(s)


>>>Also, do I invoke the "mydoctype" doctype by calling a 
> 
> new "page", "mydoctype".
> 
>>You have to customize the menu entry accordingly.
>>
> 
> 
> From the tutorial it seems like I should set a new switch with <document-
> element local-name=..>.
> 
> So if I have a doctype foo and I set:
> 
> <sourcetype name="foo">
>   <document-element local-name="foo" />
> </sourcetype>
> 
> and then I name the documents I create in Lenya foo, it should work, right?


What do you mean with "name the documents"?

The menu item in question is

<item uc:usecase="create" uc:step="showscreen" 
href="?doctype=xhtml"><i18n:text>New Document</i18n:text></item>

which means you have to add another item for your doctype:

<item uc:usecase="create" uc:step="showscreen" 
href="?doctype=mydoctype"><i18n:text>New "MyDocType" 
Document</i18n:text></item>


-- Andreas


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


Re: AddingCustomDocType Issues

Posted by Jorden Woods <jo...@paradigmsgroup.com>.
Andreas Hartmann <andreas <at> apache.org> writes:

> 
> The term "root tag" is quite misleading. AFAIK the correct XML term
> is "document element". It refers to the top-level element of an
> XML document, which encloses all other elements, text nodes etc.
> 
> For instance:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
>    <xhtml:head>
>      ...
>    </xhtml:head>
>    <xhtml:body>
>      ...
>    </xhtml:body>
> </xhtml:html>
> 
> In this XML document, the document element is the one with
> the qualified name (QName) xhtml:html.
> 

Okay I understand this, thanks.

I guess the bigger question, though, is how do I stop the XHTML doctype from 
overriding every other doctype chosen?

For example, all doctypes are set to have the namespace 
="http://www.w3.org/19999/xhtml" which is the 'switch' for the XHMTL doctype.

The 'switch' is:

<sourcetype name="xhmtl">
   <document-element namespace="http://www.w3.org/1999/xhtml">
</sourcetype>

 
> > Also, do I invoke the "mydoctype" doctype by calling a 
new "page", "mydoctype".
> 
> You have to customize the menu entry accordingly.
> 

>From the tutorial it seems like I should set a new switch with <document-
element local-name=..>.

So if I have a doctype foo and I set:

<sourcetype name="foo">
  <document-element local-name="foo" />
</sourcetype>

and then I name the documents I create in Lenya foo, it should work, right?

Yet my documents still all end up with the XHTML doctype.

So what am I doing wrong?

Cheers,

Jorden.





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


Re: AddingCustomDocType Issues

Posted by Andreas Hartmann <an...@apache.org>.
Jorden Woods wrote:
> Hi:
> 
> I have followed the steps in the tutorial for adding a new doctype.
> 
> I am having difficulty with the doctype matcher (step 4).
> 
> Specifically, I do not quite understand what a root tag is.

The term "root tag" is quite misleading. AFAIK the correct XML term
is "document element". It refers to the top-level element of an
XML document, which encloses all other elements, text nodes etc.

For instance:

<?xml version="1.0" encoding="utf-8"?>
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
   <xhtml:head>
     ...
   </xhtml:head>
   <xhtml:body>
     ...
   </xhtml:body>
</xhtml:html>

In this XML document, the document element is the one with
the qualified name (QName) xhtml:html.

You might want to refer to some good XML literature for
further information. Deep understanding of XML is helpful,
if not even essential if you want to leverage Cocoon and
Lenya.


> So for example in the code below, what do I use for "myroottag"?:
> 
> <map:action name="sourcetype" 
> src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
>   <sourcetype name="mydoctype">
>     <document-element local-name="myroottag"/>
>     <!-- this matches the root tag -->
>   </sourcetype>
> </map:action>

See above.

> Also, do I invoke the "mydoctype" doctype by calling a new "page", "mydoctype".

You have to customize the menu entry accordingly.

-- Andreas


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