You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Oskar Werewka <ow...@poczta.onet.pl> on 2001/04/30 21:01:05 UTC

Re: Simple question: Building XML elements in XSP code two ways or only one way?

Could you explain me more?
Because I do not get why I should not mess with xsp variables?
Where is the problem? Concurrency or what?

>On Mon, 30 Apr 2001, Oskar Werewka wrote:
>
> > So the question is: Do I have to build elements using
> > code like that:
> >
> >      xspParentNode = xspCurrentNode;
> >      xspNodeStack.push(xspParentNode);
> >      xspCurrentNode =
> >        document.createElement("label");
> >      xspParentNode.appendChild(xspCurrentNode);
> >
> >      ((Element) xspCurrentNode).setAttribute(
> >        "id",
> >        "200"
> >      );
> >      xspCurrentNode.appendChild(
> >        document.createTextNode("My label value")
> >      );
>
>just a quick heads up - if you're creating xml directly in your xsp page,
>you shouldn't mess with the xsp internal variables directly, you should
>just create a literal result element:
>
><label id="200">My label value</label>
>
>- donald
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>



-- 
 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Simple question: Building XML elements in XSP code two ways or only one way?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 1 May 2001, giacomo wrote:

> > Could you explain me more?
> > Because I do not get why I should not mess with xsp variables?
> > Where is the problem? Concurrency or what?
>
> Portability.

not to mention the fact that this is what xsp is all about! it's much
easier to write:

<xsp:logic>
  // stuff
  <label id="200">My label value</label>
  // other stuff
</xsp:logic>

than to write:

<xsp:logic>
  // stuff
  xspParentNode = xspCurrentNode;
  xspNodeStack.push(xspParentNode);
  xspCurrentNode =
    document.createElement("label");
  xspParentNode.appendChild(xspCurrentNode);
  ... etc ...
  // other stuff
</xsp:logic>

that's largely the raison d'etre for xsp. that and logicsheets.

- donald


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Simple question: Building XML elements in XSP code two ways or only one way?

Posted by giacomo <gi...@apache.org>.

On Mon, 30 Apr 2001, Oskar Werewka wrote:

>
> Could you explain me more?
> Because I do not get why I should not mess with xsp variables?
> Where is the problem? Concurrency or what?

Portability.

Giacomo

>
> >On Mon, 30 Apr 2001, Oskar Werewka wrote:
> >
> > > So the question is: Do I have to build elements using
> > > code like that:
> > >
> > >      xspParentNode = xspCurrentNode;
> > >      xspNodeStack.push(xspParentNode);
> > >      xspCurrentNode =
> > >        document.createElement("label");
> > >      xspParentNode.appendChild(xspCurrentNode);
> > >
> > >      ((Element) xspCurrentNode).setAttribute(
> > >        "id",
> > >        "200"
> > >      );
> > >      xspCurrentNode.appendChild(
> > >        document.createTextNode("My label value")
> > >      );
> >
> >just a quick heads up - if you're creating xml directly in your xsp page,
> >you shouldn't mess with the xsp internal variables directly, you should
> >just create a literal result element:
> >
> ><label id="200">My label value</label>
> >
> >- donald
> >
> >
> >---------------------------------------------------------------------
> >Please check that your question has not already been answered in the
> >FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> >To unsubscribe, e-mail: <co...@xml.apache.org>
> >For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
> --
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>