cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniele Madama" <>
Subject Problem with jxtg and sax
Date Tue, 16 Nov 2004 13:27:11 GMT
Hi to all,

I have a little problem (if it's a problem) with JXTG and Sax, I try to
resume the behaviour.

My transfomer build a Document with a structure like this:

<sm:root xmlns:sm="">
     <sm:service-id xmlns:xsi=""

this is well-formed and it's correct, but I need to validate it with a XSD
Schema, so I must add a namespace declaration for prefix "puei" in
<sm:service-id> or parent element otherwise It cannot *known* the prefix
specified in "xsi:type" attribute.
I add a namespace declaration with this code:

  Attr nameSpace =
newDoc.createAttributeNS("", "xmlns:" +
  ((Element) root).setAttributeNode(nameSpace);

where newPrefix's value is "puei" and "" for newNS.

If I serialize the document it seems ok, with namespace declared in the
right way.

The result of this transformer is taken from a flow, that call a match
with sendPage(), this match has a jxtg with a jx:out dealing with a
Document received from flow. But this generate an Exception:

DOMException: NAMESPACE_ERR: An attempt is made to create or change an
object in a way which is incorrect with regard to namespaces.

following the stacktrace it was throw when JXTG try to serialize it with

Now I don't know if I missing something when add namespace declaration (is
it the correct mode?) or if there is a problem in DOMStreamer.

Any hint?


Daniele Madama

Pro-netics s.r.l.
Via Elio Lampridio Cerva 127/c
Tel. 0651530849

View raw message