Chris Morgan wrote:

All to say that the server-side option is a pretty complicated way to do
something that should be simple.  Having gone through this, I recommend some
form of client solution.  Flash is the most ubiquitous and less obtrusive
client options, but there are others (I think there are DHTML options)
that'd work too.

I understood him to mean that he was sending a string with xml data to be parsed - in which case the only option is server side, and it's as easy as:


<util:include-expr><util:expr><xsp-request:get-parameter name="test" /></util:expr></util:include-expr>

in an xsp page where the namespace for util is defined as:
xmlns:util="http://apache.org/xsp/util/2.0";

That snippet in an xsp page called with ?test=<foo>bar</foo>

will produce xml sax events for an element "foo" in the default namespace with a nested character event of "bar".

Now, the fact that this does come up so frequently means there probably should be better documentation and/or a sample - any volunteers?

Geoff

-----Original Message-----
From: Geoff Howard [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 3:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Content Updating


Look through the archives - unless I misunderstand you this has been discussed ad nauseum. In your case, there is an xsp tag to cause the value of your parameter to be parsed as xml and passed down the line of SAX events.

Keep in mind, a cocoon pipeline is not a text stream of xml,
but a sax event chain.  inserting new text into a character
event at one point does not create a new startElement,
etc. unless explicitly instructed to do so.  This saves us
from continually reparsinng the xml as it moves through.

Geoff

Brent L Johnson wrote:

Yeah this is quite annoying because as soon as I do an
<xsl:value-of value="$myrequestparam"/>

That produces an encoded string value that gets passed
all the way to the actual writing of the file.. so it
gets overwritten with &lt; and &gt;

- Brent



I've run into this as well.  We looked at a couple of
different options:

1. server side decoders that basically replace your &lt; or
other unicode with their appropriate symbols before
committing to storage.  This is a good solution for very
simple markup with little variation.

2. Change client to applets, ActiveX or Flash.  We chose to
build a flash component based on the following
http://www.flashcomponents.net/component.cfm?nav=2&id=131.
Macromedia has a
pretty decent API for sending and receiving XML.
Performance isn't
great though.  We use it as a dumb-client and do all XML
processing on the server.

Hope this helps,

Chris

-----Original Message-----
From: Brent L Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2003 11:08 AM
To: [EMAIL PROTECTED]
Subject: Content Updating


Im creating a basic content management system to allow users to change the content in some of the XML documents.

I'm reading the content and putting it into a textarea and
doing a form post.  To print a preview of the page I have an
XSP file that uses xsp-request to use the data that was
posted instead of the static content in the XML document.

But after being posted the data is being encoded so it comes out as:

&lt;img&gt;

How can I use the posted data as XML without being encoded?

Thanks,

- Brent



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to