cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John L. Webber" <John.Web...@jentro.com>
Subject Re: xsp : create xml from Array
Date Tue, 11 May 2004 11:09:22 GMT
If you just want to have an xml element "labels" generated by the xsp 
for use in the pipeline, you don't need to assign it to any variable at 
all. Simply:
<labels>
  <label1/>
  <label2/>
</labels>


The specific error you got was due to the failure to "import" 
DocumentFragment via xsp:include. You need to have a block like this as 
a top-level element within xsp:page:

<xsp:structure>
 <xsp:include>org.w3c.dom.DocumentFragment</xsp:include>
</xsp:structure>

John

julien bloit wrote:

>Hi,
>I guess this is a very simple question, but I somehow can't get it working :
>
>I need to create a very simple xml tree from an Array object :
>
><xsp:logic>
>       String labels = <esql:get-string column="Type"/>;
>       int i = labels.indexOf('(');
>       int f = labels.indexOf(')');
>       labels = labels.substring(i+1,f);
>       labels = labels.replaceAll("'","");
>       String[] labelTab = labels.split(",");
>       int longueur = labelTab.length;
>
>        <!-- this doesn't seem to work : -->
>       DocumentFragment myLabels = <xsp:element name="labels"/>;
>        ...
></xsp:logic>
>...
>
>Basically, I just need to create a container element which I can manipulate
>later with DOM API to add childs etc...
>
>Here's the error :
>org.apache.cocoon.ProcessingException: Language Exception:
>org.apache.cocoon.components.language.LanguageException: Error compiling
>show_enum_xsp: ERROR 1
>(org\apache\cocoon\www\dvdcarte\tests\show_enum_xsp.java): ... labels =
>labels.replaceAll("'",""); String[] labelTab = labels.split(","); String un
>= labelTab[0]; int longueur = labelTab.length; // start error (lines
>426-426) "DocumentFragment cannot be resolved or is not a type"
>DocumentFragment myLabels = // end error this.contentHandler.startElement(
>"", "labels", ... Line 426, column 0: DocumentFragment cannot be resolved or
>is not a type
>
>
>
>
>
>Thanks for your help!
>
>Julien
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>

-- 
---------------------------------------------------------
 Jentro Technologies GmbH
 John L. Webber, Software Development
---------------------------------------------------------
 Rosenheimer Str. 145e	    81671 M√ľnchen
 Tel. +49 89 189 169 80     mailto:John.Webber@jentro.com 
 Fax  +49 89 189 169 99     http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may otherwise be legally
privileged. It is intended for the named recipient only. If you have received it in error,
please notify us immediately by reply or by calling the telephone number above and delete
this message and all its attachments without any use or further distribution of its contents.
Please note that any unauthorised review, copying, disclosing or otherwise making use of the
information is strictly prohibited. Thank you. 
---------------------------------------------------------


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


Mime
View raw message