cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Source Writing Transformer: Adding namespaces
Date Fri, 27 Sep 2002 17:15:12 GMT
Alex Romayev wrote:

>I'm still struggling with this problem.  Let me try to
>state it more clearly:
>
>I would like to write XML to a file.  My XML contain
>namespaces.  I declare the namespaces in the root
>element, just the way I would like it to be in the
>file and surround my XML with "source:write" tag. 
>However, SourceWritingTransformer seems to be dropping
>the namespace declarations and writing everything
>else!
>
>Is this is a bug within the transformer or is there
>another way of getting the namespace declarations
>written out?
>

Could be a bug. Try moving ns declaration into the root tag of the 
document you are writing, i.e. moving declaration inside the write tag.

Vadim



>I would appreciate any help.
>
>-Alex
>
>--- Alex Romayev <romayev@yahoo.com> wrote:
>  
>
>>Not sure how I would do that, here is an example:
>>
>>What I would like to get is:
>><news  
>> 
>>xmlns:pub="http://www.romayev.com/publication/1.0">
>>  <item id="N100AE">
>>    <pub:publication>
>>     
>><pub:published-date>2001-11-06</pub:published-date>
>>      ...
>>    </pub:publication>
>>  </item>
>></news>
>>
>>Here is the code I use for SourceWritingTransformer:
>><source:write src="content/news.xml">
>>  <news  
>>   
>>xmlns:pub="http://www.romayev.com/publication/1.0">
>>    <item id="N100AE">
>>      <pub:publication>
>>       
>><pub:published-date>2001-11-06</pub:published-date>
>>        ...
>>      </pub:publication>
>>    </item>
>>  </news>
>></source:write>
>>
>>--- funing <funing@necas.nec.co.jp> wrote:
>>    
>>
>>>Can you use the "insert" tag?
>>>
>>>On Thu, 26 Sep 2002 02:17:56 -0700 (PDT)
>>>Alex Romayev <romayev@yahoo.com> wrote:
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>I'm using Source Writing Transformer to write
>>>>        
>>>>
>>XML
>>    
>>
>>>to
>>>      
>>>
>>>>file.  I need to add namespace declarations to
>>>>        
>>>>
>>the
>>    
>>
>>>>root node, does anyone know how to do this?
>>>>
>>>>Thanks,
>>>>-Alex
>>>>        
>>>>
>>>-- 
>>>funing <funing@necas.nec.co.jp>
>>>      
>>>




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

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


Mime
View raw message