You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Morley Howell <mo...@cogeco.ca> on 2004/01/15 01:29:47 UTC

Losing XML data in the pipeline

Hi all,

I've written a DOM-based Transformer that subclasses AbstractDOMTransformer
(ADT), and a fragment of the incoming XML data is being dropped. Here's a
portion of the incoming XML:

<Request xmlns:session="http://apache.org/cocoon/session/1.0">
  ...
      <AttributeValue>users/user1/roles.xml</AttributeValue>
  ...
</Request>

The DOM document generated by the ADT is changing the value of the
AttributeValue tag above to 'users/user1/', ie. it has stripped off the
'roles.xml' part.

I did some debugging through the source, and here are the SAX events that
the ADT receives, starting at the AttributeValue tag:

startElement(): AttributeValue
characters(): users/user1/
setDocumentLocator()
characters(): roles.xml
endElement(): AttributeValue

Anyone know what's going on here? Is there some restriction around embedding
XML file names in XML? Or is there some limitation or bug involved here?

I'm running Cocoon 2.1.3, W2K, j2re 1.4.1_02, Tomcat 4.1.27.

Thanks,

Morley


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


RE: Losing XML data in the pipeline

Posted by Morley Howell <mo...@cogeco.ca>.

> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
> Sent: Wednesday January 14, 2004 8:05 PM
> To: users@cocoon.apache.org
> Subject: Re: Losing XML data in the pipeline
>
>
> On 15.01.2004 01:29, Morley Howell wrote:
>
> > Hi all,
> >
> > I've written a DOM-based Transformer that subclasses
> AbstractDOMTransformer
> > (ADT), and a fragment of the incoming XML data is being
> dropped. Here's a
> > portion of the incoming XML:
> >
> > <Request xmlns:session="http://apache.org/cocoon/session/1.0">
> >   ...
> >       <AttributeValue>users/user1/roles.xml</AttributeValue>
> >   ...
> > </Request>
> >
> > The DOM document generated by the ADT is changing the value of the
> > AttributeValue tag above to 'users/user1/', ie. it has stripped off the
> > 'roles.xml' part.
> >
> > I did some debugging through the source, and here are the SAX
> events that
> > the ADT receives, starting at the AttributeValue tag:
> >
> > startElement(): AttributeValue
> > characters(): users/user1/
> > setDocumentLocator()
> > characters(): roles.xml
> > endElement(): AttributeValue
> >
> > Anyone know what's going on here?
>
> No :)
>
> > Is there some restriction around embedding XML file names in XML?
>
> Of course not.

Ok good.

> > Or is there some limitation or bug involved here?
>
> As you can see there is a function call that should not be there
> (setDocumentLocator()). In which way the SAX events are generated?

Well my transformer is in a pipeline, and the previous step in the pipeline
uses the session transformer. The AttributeValue tag is generated in the
session transformer as follows:

  <AttributeValue><session:getxml context="request"
path="/parameter/collection"/><session:getxml context="request"
path="/parameter/document"/></AttributeValue>

So maybe the fact that I'm using two session:getxml tags to create the
AttributeValue tag is resulting in the two separate calls to characters().
That still doesn't explain the intervening setDocumentLocator() call though.
You'd also think that the ADT could handle tags with multiple calls to
characters() by just concatenating them.

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


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


Re: Losing XML data in the pipeline

Posted by Joerg Heinicke <jo...@gmx.de>.
On 15.01.2004 01:29, Morley Howell wrote:

> Hi all,
> 
> I've written a DOM-based Transformer that subclasses AbstractDOMTransformer
> (ADT), and a fragment of the incoming XML data is being dropped. Here's a
> portion of the incoming XML:
> 
> <Request xmlns:session="http://apache.org/cocoon/session/1.0">
>   ...
>       <AttributeValue>users/user1/roles.xml</AttributeValue>
>   ...
> </Request>
> 
> The DOM document generated by the ADT is changing the value of the
> AttributeValue tag above to 'users/user1/', ie. it has stripped off the
> 'roles.xml' part.
> 
> I did some debugging through the source, and here are the SAX events that
> the ADT receives, starting at the AttributeValue tag:
> 
> startElement(): AttributeValue
> characters(): users/user1/
> setDocumentLocator()
> characters(): roles.xml
> endElement(): AttributeValue
> 
> Anyone know what's going on here?

No :)

> Is there some restriction around embedding XML file names in XML?

Of course not.

> Or is there some limitation or bug involved here?

As you can see there is a function call that should not be there 
(setDocumentLocator()). In which way the SAX events are generated?

Joerg


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