You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Donald Ball <ba...@webslingerZ.com> on 2001/04/30 14:51:24 UTC

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

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>