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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote: >> >> >>>Can you use the "insert" tag? >>> >>>On Thu, 26 Sep 2002 02:17:56 -0700 (PDT) >>>Alex Romayev <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> >>> >>> --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>