You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2002/07/29 22:58:47 UTC

Whitespace from parameters? [AVALON Frameworks issue?]

In MailetConfigImpl.getInitParameter(String name) we have:

  final Configuration[] values = configuration.getChildren( name );

as best I can see, there is no call within James to trim whitespace from
around parameters, so that must be happening in Avalon Frameworks, right?

How can we stripping whitespace in the case where it would be desirable for
the admin to be able to place whitespace, e.g., in a prefix string?  Is
there some attribute we could put on the tag so that Avalon Frameworks
didn't trim the whitespace, e.g.,

<subject allow-whitespace> Whitespace intact:   </subject>

Other thoughts?

	--- Noel


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


Re: Whitespace from parameters? [AVALON Frameworks issue?]

Posted by Peter Royal <pr...@apache.org>.
On Tuesday 30 July 2002 11:37 am, Noel J. Bergman wrote:
> Yes, xml:space="preserve" should work, and I'll give it a whirl.  The
> xml:space attribute may be used to indicate explicitly that white space is
> significant, which will apply to that element and any subelements that
> don't reset xml:space.
>
> However, my understanding is that white space is supposed to be significant
> by default in mixed content
> (http://www.w3.org/TR/REC-xml#sec-mixed-content) and insignificant in
> element content
> (http://www.w3.org/TR/REC-xml#sec-element-content), so why isn't it being
> preserved now?  Is it because there is no DTD?

The code that creates a Configuration object from an XML document 
(org.apache.avalon.framework.configuration.SAXConfigurationHandler) treats it 
as element content. There's really no way of knowing w/o a DTD.

If there is a way to determine if an element should be treated as mixed or 
element when processing the document via SAX2, that would also be a solution 
in cases where a DTD was present.
-pete

-- 
peter royal -> proyal@apache.org

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


RE: Whitespace from parameters? [AVALON Frameworks issue?]

Posted by "Noel J. Bergman" <no...@devtech.com>.
Peter,

Yes, xml:space="preserve" should work, and I'll give it a whirl.  The
xml:space attribute may be used to indicate explicitly that white space is
significant, which will apply to that element and any subelements that don't
reset xml:space.

However, my understanding is that white space is supposed to be significant
by default in mixed content (http://www.w3.org/TR/REC-xml#sec-mixed-content)
and insignificant in element content
(http://www.w3.org/TR/REC-xml#sec-element-content), so why isn't it being
preserved now?  Is it because there is no DTD?

	--- Noel

-----Original Message-----
From: Peter Royal [mailto:proyal@apache.org]
Sent: Monday, July 29, 2002 17:07
To: James Developers List
Subject: Re: Whitespace from parameters? [AVALON Frameworks issue?]


On Monday 29 July 2002 04:58 pm, Noel J. Bergman wrote:
> In MailetConfigImpl.getInitParameter(String name) we have:
>
>   final Configuration[] values = configuration.getChildren( name );
>
> as best I can see, there is no call within James to trim whitespace from
> around parameters, so that must be happening in Avalon Frameworks, right?
>
> How can we stripping whitespace in the case where it would be desirable
for
> the admin to be able to place whitespace, e.g., in a prefix string?  Is
> there some attribute we could put on the tag so that Avalon Frameworks
> didn't trim the whitespace, e.g.,

xml:space="preserve" should do the trick.
-pete

--
peter royal -> proyal@apache.org

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


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


Re: Whitespace from parameters? [AVALON Frameworks issue?]

Posted by Peter Royal <pr...@apache.org>.
On Monday 29 July 2002 04:58 pm, Noel J. Bergman wrote:
> In MailetConfigImpl.getInitParameter(String name) we have:
>
>   final Configuration[] values = configuration.getChildren( name );
>
> as best I can see, there is no call within James to trim whitespace from
> around parameters, so that must be happening in Avalon Frameworks, right?
>
> How can we stripping whitespace in the case where it would be desirable for
> the admin to be able to place whitespace, e.g., in a prefix string?  Is
> there some attribute we could put on the tag so that Avalon Frameworks
> didn't trim the whitespace, e.g.,

xml:space="preserve" should do the trick.
-pete

-- 
peter royal -> proyal@apache.org

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