You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Jason Harrop <jh...@speedlegal.com> on 2004/02/26 23:59:18 UTC

Installing own schema

Hi

Sorry if this is an FAQ, but given the limited window into mailing list archives...

I would like to edit (with Bitflux)/validate documents against my own Relax NG 
schema.

I've copied the .rng file into config/doctypes/schemas/ and a sample file into 
samples/ and made an entry in doctypes.xconf, and restarted lenya, but nothing 
shows up (I'm expecting to get prompted for the doctype after choosing File > New?)

I see also that /lenya/lenya/pubs/docs-new/resources/schema/ contains the catalog.

Is any other configuration necessary?  I see there is a parameter-doctype.xmap 
file, but it doesn't look like i need to change that.

thanks,

Jason



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


Re: Installing own schema

Posted by Jason Harrop <jh...@speedlegal.com>.
Thanks giampaolo

My problem was that it was using page2xhtml.xsl, and yes, there was a namespace 
issue.

My doctype id is seminars, and that's the name of the root node in my document.

So after

         <xsl:apply-templates select="xhtml:div[@id = 'body']"/>

in page2xhtml, i put:

	<xsl:apply-templates select="*[local-name()='seminars']"/>

and it worked.

Evidently seminars2xhtml.xsl is required after you hit the create button, since 
without it, I get an XSLTProcessorException.

But its page2xhtml.xsl which has to apply-templates to the seminars document to 
actually render the content.

cheers,

Jason




Trapo wrote:
>  >and isn't followed by my content :(
> 
> perhaps, trying to guess, is perhaps a namespace problem...
> for example, i have a "note" schema taken from w3schools, my note2shtml is
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:fo="http://www.w3.org/1999/XSL/Format"  
> xmlns:w3schools="http://www.w3schools.com"    
> xmlns="http://www.w3.org/1999/xhtml" >
> 
> <xsl:template match="/w3schools:note">
>    <div id="body">
>        <xsl:apply-templates />
>    </div>
> </xsl:template>
>  
> </xsl:stylesheet>
> 
> this simple xslt outputs my own schema
> 
> hth
> 
> giampaolo
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: lenya-user-help@cocoon.apache.org
> 
> 
> 



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


Re: Installing own schema

Posted by Trapo <ne...@trapo.it>.
 >and isn't followed by my content :(

perhaps, trying to guess, is perhaps a namespace problem...
for example, i have a "note" schema taken from w3schools, my note2shtml is

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fo="http://www.w3.org/1999/XSL/Format"  
xmlns:w3schools="http://www.w3schools.com" 
    xmlns="http://www.w3.org/1999/xhtml" >

<xsl:template match="/w3schools:note">
    <div id="body">
        <xsl:apply-templates />
    </div>
</xsl:template>
   

</xsl:stylesheet>

this simple xslt outputs my own schema

hth

giampaolo



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


Re: Installing own schema

Posted by Jason Harrop <jh...@speedlegal.com>.
Andreas Hartmann wrote:
> Jason wrote:
>> I would like to edit (with Bitflux)/validate documents against my own 
>> Relax NG schema.
>>
>> I've copied the .rng file into config/doctypes/schemas/ and a sample 
>> file into samples/ and made an entry in doctypes.xconf, and restarted 
>> lenya, but nothing shows up (I'm expecting to get prompted for the 
>> doctype after choosing File > New?)
> 
> 
> No, you have to set this up by hand:
> 
> config/menus/generic.xsp

okay, i've set that up, and i now get a menu choice: "File > New Seminar Document"

when i click it, i get the metadata screen as expected.

when i hit the create button, i see the html output, but the main part of the 
document is blank (ie its not transforming my sample into xhtml).  i just get 
the menus etc.  where i expect to see my content, the xhtml contains:

<div id="main">
	<div id="breadcrumb">
	  &raquo;
	<a href="../../../s-test-1.html">seminar test 1</a>
	  &raquo;
	</div>
</div>

and isn't followed by my content :(

- it is finding xslt/seminars2xhtml.xsl, since i was getting an exception until 
i created it.
- i think it is finding my sample document, since after editing, i can see that 
a document exists eg pubs/vscl/content/authoring/s-test-1/dfjzfgzdghjz/index_en.xml

What stylesheet is it which invokes mine after i hit the create button?  (Does 
it expect a certain root element?)  Or does it work some other way specified in 
an xmap file?

thanks for any help,

Jason








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


Re: Installing own schema

Posted by Andreas Hartmann <an...@apache.org>.
Jason Harrop wrote:

> Hi
> 
> Sorry if this is an FAQ, but given the limited window into mailing list 
> archives...
> 
> I would like to edit (with Bitflux)/validate documents against my own 
> Relax NG schema.
> 
> I've copied the .rng file into config/doctypes/schemas/ and a sample 
> file into samples/ and made an entry in doctypes.xconf, and restarted 
> lenya, but nothing shows up (I'm expecting to get prompted for the 
> doctype after choosing File > New?)

No, you have to set this up by hand:

config/menus/generic.xsp

> I see also that /lenya/lenya/pubs/docs-new/resources/schema/ contains 
> the catalog.
> 
> Is any other configuration necessary?  I see there is a 
> parameter-doctype.xmap file, but it doesn't look like i need to change 
> that.

You have. It's a little complex to setup a new doctype,
we have to write more documentation about this. I think
Trapo started a wiki page:

http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType

It's not very comprehensive ATM :)

-- Andreas


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