You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Oleg Barmin <Ol...@bridge-quest.com> on 2009/09/17 20:24:16 UTC

Problem with inserting form into document

Hi,

I created a new XHTML document and tried to insert a form into this document using editors. I opened the page in "One Form" editor and placed there following content:

<html>
    <head>
        <title>New XHTML document</title>
    </head>
    <body>
        <h1>Send Report</h1>
        <p>Here comes the text of your new document...</p>
        <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
        <form method="post" action="/some/action">
        </form>
    </body>
</html>

But I got an error on save document:
error: unfinished element

What's wrong with this document? I see no errors there.

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


Re: Problem with inserting form into document

Posted by Andreas Hartmann <an...@apache.org>.
Andrey Volkov schrieb:
> There is plenty of .rng files in \src\modules\xhtml\resources\schemas\ 
> directory and deeper. AFAIK, they define xhtml validation rules. So, if 
> you change them, you change validation rules. I'm sure, it is possible 
> to configure them not to have mandatory <p> or <div> in forms and even 
> just empty forms without any subelement.

Though it's possible, I would strongly discourage changing the schemas. 
The whole point of the schemas is to ensure that all documents are 
conforming to standards. Sticking to the open standards, e.g. XHTML like 
it's defined by the W3C, makes your life much easier when it comes to 
processing (rendering, transformation, content migration etc.), since 
you can use existing tools (XSLTs etc.) out of the box.

-- Andreas


> 
> -- 
> With best regards,
> Andrey Volkov
> 
> On Sat, Sep 19, 2009 at 10:03 AM, Oleg Barmin 
> <Oleg.Barmin@bridge-quest.com <ma...@bridge-quest.com>> wrote:
> 
>     Thanks, Richard. Now it works.
>     ________________________________________
>     From: Richard Frovarp [rfrovarp@apache.org <ma...@apache.org>]
>     Sent: Friday, September 18, 2009 3:20 PM
>     To: user@lenya.apache.org <ma...@lenya.apache.org>
>     Subject: Re: Problem with inserting form into document
> 
>     Oleg Barmin wrote:
>      > I've tried to add input:
>      >
>      > <html>
>      >     <head>
>      >         <title>New XHTML document</title>
>      >     </head>
>      >     <body>
>      >         <h1>Send Report</h1>
>      >         <p>Here comes the text of your new document...</p>
>      >         <p>To add real content, use one of the editors listed in
>     the <strong>Edit</strong> menu.</p>
>      >         <form method="post" action="/some/action">
>      >           <input type="submit" />
>      >         </form>
>      >     </body>
>      > </html>
>      >
>      > But I've only got more errors:
>      >
>      >     * error: element "input" from namespace
>     "http://www.w3.org/1999/xhtml" not allowed in this context
>      >     * error: unfinished element
> 
>     Matt was close. You can't have empty form's, and form elements have to
>     be in the right containers, which needs to be something more than a
>     form. Wrap your input in either a p or a div and it should work.
> 
>     Richard
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>     <ma...@lenya.apache.org>
>     For additional commands, e-mail: user-help@lenya.apache.org
>     <ma...@lenya.apache.org>
> 
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>     <ma...@lenya.apache.org>
>     For additional commands, e-mail: user-help@lenya.apache.org
>     <ma...@lenya.apache.org>
> 


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


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


Re: Problem with inserting form into document

Posted by Andrey Volkov <an...@gmail.com>.
Oleg,

There is plenty of .rng files in
\src\modules\xhtml\resources\schemas\directory and deeper. AFAIK, they
define xhtml validation rules. So, if you
change them, you change validation rules. I'm sure, it is possible to
configure them not to have mandatory <p> or <div> in forms and even just
empty forms without any subelement.

-- 
With best regards,
Andrey Volkov

On Sat, Sep 19, 2009 at 10:03 AM, Oleg Barmin
<Ol...@bridge-quest.com>wrote:

> Thanks, Richard. Now it works.
> ________________________________________
> From: Richard Frovarp [rfrovarp@apache.org]
> Sent: Friday, September 18, 2009 3:20 PM
> To: user@lenya.apache.org
> Subject: Re: Problem with inserting form into document
>
> Oleg Barmin wrote:
> > I've tried to add input:
> >
> > <html>
> >     <head>
> >         <title>New XHTML document</title>
> >     </head>
> >     <body>
> >         <h1>Send Report</h1>
> >         <p>Here comes the text of your new document...</p>
> >         <p>To add real content, use one of the editors listed in the
> <strong>Edit</strong> menu.</p>
> >         <form method="post" action="/some/action">
> >           <input type="submit" />
> >         </form>
> >     </body>
> > </html>
> >
> > But I've only got more errors:
> >
> >     * error: element "input" from namespace "
> http://www.w3.org/1999/xhtml" not allowed in this context
> >     * error: unfinished element
>
> Matt was close. You can't have empty form's, and form elements have to
> be in the right containers, which needs to be something more than a
> form. Wrap your input in either a p or a div and it should work.
>
> Richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>

RE: Problem with inserting form into document

Posted by Oleg Barmin <Ol...@bridge-quest.com>.
Thanks, Richard. Now it works.
________________________________________
From: Richard Frovarp [rfrovarp@apache.org]
Sent: Friday, September 18, 2009 3:20 PM
To: user@lenya.apache.org
Subject: Re: Problem with inserting form into document

Oleg Barmin wrote:
> I've tried to add input:
>
> <html>
>     <head>
>         <title>New XHTML document</title>
>     </head>
>     <body>
>         <h1>Send Report</h1>
>         <p>Here comes the text of your new document...</p>
>         <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
>         <form method="post" action="/some/action">
>           <input type="submit" />
>         </form>
>     </body>
> </html>
>
> But I've only got more errors:
>
>     * error: element "input" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
>     * error: unfinished element

Matt was close. You can't have empty form's, and form elements have to
be in the right containers, which needs to be something more than a
form. Wrap your input in either a p or a div and it should work.

Richard

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


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


Re: Problem with inserting form into document

Posted by Richard Frovarp <rf...@apache.org>.
Oleg Barmin wrote:
> I've tried to add input:
> 
> <html>
>     <head>
>         <title>New XHTML document</title>
>     </head>
>     <body>
>         <h1>Send Report</h1>
>         <p>Here comes the text of your new document...</p>
>         <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
>         <form method="post" action="/some/action">
>           <input type="submit" />
>         </form>
>     </body>
> </html>
> 
> But I've only got more errors:
> 
>     * error: element "input" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
>     * error: unfinished element

Matt was close. You can't have empty form's, and form elements have to 
be in the right containers, which needs to be something more than a 
form. Wrap your input in either a p or a div and it should work.

Richard

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


RE: Problem with inserting form into document

Posted by Oleg Barmin <Ol...@bridge-quest.com>.
I've tried to add input:

<html>
    <head>
        <title>New XHTML document</title>
    </head>
    <body>
        <h1>Send Report</h1>
        <p>Here comes the text of your new document...</p>
        <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
        <form method="post" action="/some/action">
          <input type="submit" />
        </form>
    </body>
</html>

But I've only got more errors:

    * error: element "input" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context
    * error: unfinished element

________________________________________
From: Matt Whipple [matt@mattwhipple.com]
Sent: Friday, September 18, 2009 8:32 AM
To: user@lenya.apache.org
Subject: Re: Problem with inserting form into document

Oleg Barmin wrote:
> Hi,
>
> I created a new XHTML document and tried to insert a form into this document using editors. I opened the page in "One Form" editor and placed there following content:
>
> <html>
>     <head>
>         <title>New XHTML document</title>
>     </head>
>     <body>
>         <h1>Send Report</h1>
>         <p>Here comes the text of your new document...</p>
>         <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
>         <form method="post" action="/some/action">
>         </form>
>     </body>
> </html>
>
> But I got an error on save document:
> error: unfinished element
>
> What's wrong with this document? I see no errors there.
>
I would have to look at the DTD, but I'd guess the form element has
required children (one or more input elements) which would cause an
error in validation.  Try adding an <input type="submit" />
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>


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


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


Re: Problem with inserting form into document

Posted by Matt Whipple <ma...@mattwhipple.com>.
Oleg Barmin wrote:
> Hi,
>
> I created a new XHTML document and tried to insert a form into this document using editors. I opened the page in "One Form" editor and placed there following content:
>
> <html>
>     <head>
>         <title>New XHTML document</title>
>     </head>
>     <body>
>         <h1>Send Report</h1>
>         <p>Here comes the text of your new document...</p>
>         <p>To add real content, use one of the editors listed in the <strong>Edit</strong> menu.</p>
>         <form method="post" action="/some/action">
>         </form>
>     </body>
> </html>
>
> But I got an error on save document:
> error: unfinished element
>
> What's wrong with this document? I see no errors there.
>   
I would have to look at the DTD, but I'd guess the form element has 
required children (one or more input elements) which would cause an 
error in validation.  Try adding an <input type="submit" />
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>   


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