cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gianugo Rabellino <gian...@apache.org>
Subject Re: SourcepropWritingTransformer
Date Wed, 27 Aug 2003 10:22:00 GMT
Guido Casper wrote:

> However concerning interface design I think if you give the following
> input to SPWT:
> 
>     <source:props>
>       <my:author xmlns:my="my">Me, Myself and I</my:author>
>     </source:props>
> 
> 
> One would expect that
> 
>       WebdavSource.getSourceProperty("my", "author").getValue();
> 
> returns:
> 
>       Me, Myself and I

Yes, I see your point. It would be easy to get the value as a string, 
but what happens if value is an XML fragment? I'm wondering if it's safe 
to assume that if you call getPropertyValueAsString you know what you're 
doing so that you know that there will be no nested XML. I'm also 
thinking about dealing separately with the two cases, so that when value 
is just element + text node return just the text node, and return the 
(String) XML representation otherwise so that

<my:author xmlns:my="my">Me, Myself and I</my:author>

returns

Me, Myself and I

and

<my:author xmlns:my="my">
	<my:firstname>Me</my:firstname>
	<my:lastname>Myself and I</my:lastname>
</my:author>

returns the untouched XML. Is that overcomplicated?

Ciao,

-- 
Gianugo Rabellino
Pro-netics s.r.l. -  http://www.pro-netics.com
Orixo, the XML business alliance - http://www.orixo.com
     (Now blogging at: http://blogs.cocoondev.org/gianugo/)


Mime
View raw message