Hi just had the same idea, and it works (of course).

here my solution.

org.w3c.dom.DocumentFragment fragment = <xsl:copy-of select="node()"/>;
                        StringBuffer name = new StringBuffer();
                        for(int i = 0; i&lt; fragment.getChildNodes().getLength(); 
i++){
                                
name.append(fragment.getChildNodes().item(i).getNodeValue());                   
                        }                       
                        BlockerHelper.getInstance().setEditorName(name.toString());

Thanks a lot for your support,

However I think that this is rather a bug than a feature.

Have fun with Cocoon in the future,

Regards,

Stephanie

> 
> 
> 
> 
> Too bad.  I guess you'll have to construct the String manually by itera
> ting
> over the child nodes of the DocumentFragment yourself.  Check out the A
> PI
> at
> http://java.sun.com/j2se/1.4.1/docs/api/org/w3c/dom/Node.html
> 
> -Christopher
> 
> 
> 
> |---------+---------------------------->
> |         |           "Stephanie       |
> |         |           Zohner"          |
> |         |           <stephanie.zohner|
> |         |           @gmx.at>         |
> |         |                            |
> |         |           12/10/2003 10:19 |
> |         |           AM               |
> |         |           Please respond to|
> |         |           users            |
> |         |                            |
> |---------+---------------------------->
>   >--------------------------------------------------------------------
> ------------------------------------------|
>   |                                                                    
>                                           |
>   |       To:       [EMAIL PROTECTED]                            
>                                           |
>   |       cc:                                                          
>                                           |
>   |       Subject:  Re: How to nest logicsheet tags of different librar
> ies                                       |
>   >--------------------------------------------------------------------
> ------------------------------------------|
> 
> 
> 
> 
> Hi,
> 
> >
> >
> >
> >
> > seems like it maybe should be using getNodeValue() instead of
> > getFirstChild().getNodeValue(), but I'm not familiar with the
> > xsp-session-fw stuff (I'm not on C2.1 yet).
> >
> > The obvious workaround would seem to be
> >
> > org.w3c.dom.DocumentFragment fragment =
> >       <xsp-session-fw:getxml as="object" context="authentication"
> 
> > path="/authentication/data/name"/>;
> > <blocker:set>fragment.getNodeValue()</blocker:set>
> 
> This causes the String to be "null", because getNodevalue() returns nul
> l.
> :-(
> 
> >
> > I also wonder what would happen if you did
> >
> > <blocker:set>
> >       <xsp:expr>
> >             <xsp-session-fw:getxml as="object" context="authentic
> ation"
> > path="/authentication/data/name"/>
> >       </xsp:expr>
> > </blocker:set>
> 
> This has the same effect as 'as=string' without the <xsp:expr> tag ar
> ound.
> :-(
> 
> >
> > which would wrap a String.valueOf() around the DocumentFragment.
> >
> > -Christopher
> >
> >
> >
> > |---------+---------------------------->
> > |         |           "Stephanie       |
> > |         |           Zohner"          |
> > |         |           <stephanie.zohner|
> > |         |           @gmx.at>         |
> > |         |                            |
> > |         |           12/10/2003 04:45 |
> > |         |           AM               |
> > |         |           Please respond to|
> > |         |           users            |
> > |         |                            |
> > |---------+---------------------------->
> >
> >
> >----------------------------------------------------------------------
> ----------------------------------------|
> 
> >   |
> 
> >                                       |
> >   |       To:       [EMAIL PROTECTED]
> 
> >                                       |
> >   |       cc:
> 
> >                                       |
> >   |       Subject:  Re: How to nest logicsheet tags of different
> libraries
> >                                       |
> >
> >
> >----------------------------------------------------------------------
> ----------------------------------------|
> 
> >
> >
> >
> >
> > Thanks a lot, that was the solution, however now I have another probl
> em.
> >
> > <xsp-session-fw:getxml as="string" context="authentication"
> > path="/authentication/data/name"/>
> >
> > returns not the whole string, I put in the authentication context, bu
> t
> > only
> > the first 7 chars, or so .
> > For example, when I put "Stephanie Zohner" in the context, only "Step
> han"
> > is
> > returned.
> >
> > I looked into the generated Java Code. This is the code fragment, tha
> t is
> > generated out of the <xsp-session-fw:getxml> Tag.
> >
> > XSPSessionFwHelper.getXML(this.manager,
> >                 String.valueOf("authentication"),
> >
> >
> String.valueOf("/authentication/data/name"))).getFirstChild().getNodeVa
> lue())
> 
> >
> >       );
> >
> > It takes only the first child node of the returned XML Fragment. Howe
> ver
> > "Stephanie Zohner" is shared among 3 child nodes.Taking only the firs
> t
> > node
> > results in extracting only the first of three parts of my name.
> >
> > This happens when I use the "as= 'string'". If I use "as= 'object
> '" I
> > would
> > get the entire string, but then again I get an eeption (as you have
> > predicted), because a String is expected by the my method and not an
> > DocumentFragment.
> >
> > Is it a bug, that only the first node is taken when using the attribu
> te
> > ''as
> > = 'string''?
> >
> > Are there any work arounds?
> >
> >
> > Thanks in advance,
> >
> > Stephanie
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> +++ GMX - die erste Adresse f�r Mail, Message, More +++
> Neu: Preissenkung f�r MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
+++ GMX - die erste Adresse f�r Mail, Message, More +++
Neu: Preissenkung f�r MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to