cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alain Tixier" <alain.tix...@laposte.net>
Subject Re: appendChild
Date Wed, 17 May 2000 06:31:25 GMT
At 17:38 16/05/00 +0100, you wrote:
>Okay, a logicsheet. But I think I need to see a sample source XML file as 
>well.

This is the XML file:


<?xml version="1.0" encoding="ISO-8859-1"?>

<?cocoon-process type="xslt"?>
<?xml-stylesheet href="flv03i_XSP.xsl" type="text/xsl"?>

<page>
   <request-data/>
</page>


>"Alain Tixier" <alain.tixier@laposte.net> wrote:
>>At 13:13 16/05/00 +0100, you wrote:
>>
>>>If not, that's bizarre. Could you post your XSP page?
>>
>>This is a part of my XSP page (some lines have been deleted to get a
>>shorter list):
>>
>><?xml version="1.0" encoding="UTF-8"?>
>>
>><xsl:stylesheet version="1.0"
>>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>                 xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>>
>><xsl:template match="page">
>>   <xsl:processing-instruction
>>name="cocoon-process">type="xsp"</xsl:processing-instruction>
>>   <xsl:processing-instruction
>>name="cocoon-process">type="xslt"</xsl:processing-instruction>
>>   <xsl:processing-instruction name="xml-stylesheet">href="flv03i.xsl"
>>type="text/xsl"</xsl:processing-instruction>
>>
>>   <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>>     <xsp:structure>
>>       <xsp:include>StringTokenizerStrict</xsp:include>
>>       <xsp:include>socketClient</xsp:include>
>>     </xsp:structure>
>>
>>     <xsp:logic><![CDATA[
>>       String value;
>>       String rep;
>>       String op;
>>       private static final String
>>dummySpaces="
>>                   ";
>>      private static final String delim=";";
>>       int j=1;
>>       StringTokenizerStrict parser;
>>       DocumentFragment fragment;
>>
>>       void createField(Document page, String field) {
>>         Element result = page.createElement("fld");
>>         result.setAttribute("value",field);
>>         result.appendChild(page.createTextNode("\n"));
>>         fragment.appendChild(result);
>>       }
>>
>>   void processLine2(Document page, String l) {
>>     createField(page,l.substring(0,6));
>>     createField(page,l.substring(9,13));
>>     createField(page,l.substring(13,17));
>>     createField(page,l.substring(19,29));
>>     createField(page,l.substring(30,38));
>>     createField(page,l.substring(38,39));
>>     createField(page,l.substring(41,73));
>>   }
>>
>>   // **********************************
>>   // processLine3() to ProcessLine11() deleted
>>   // --> similar as before
>>   // **********************************
>>
>>   protected DocumentFragment doCase(Document page, String value, int j) {
>>     fragment = page.createDocumentFragment();
>>
>>     if (j<11) {
>>       Element result = page.createElement("fld");
>>       result.setAttribute("value",value);
>>       result.appendChild(page.createTextNode("\n"));
>>       fragment.appendChild(result);
>>     }
>>     else {
>>       value=value+dummySpaces;
>>
>>       switch(j) {
>>         case 11:
>>           processLine2(page,value);
>>           break;
>>         case 12:
>>           processLine3(page,value);
>>           break;
>>         // *************************
>>         // case 13 to case 20 deleted
>>         // --> similar as before
>>         // *************************
>>         default: /* Ignore this line */
>>           break;
>>       }
>>     }
>>     return fragment;
>>   }
>>     ]]></xsp:logic>
>>
>>     <xsl:copy>
>>       <xsl:apply-templates/>
>>     </xsl:copy>
>>
>>   </xsp:page>
>></xsl:template>
>>
>><xsl:template match="request-data">
>>   <xsp:logic>
>>     op = request.getParameter("op");
>>     rep = new socketClient().callService(op);
>>     parser = new StringTokenizerStrict(rep,delim,false);
>>     j=1;
>>     while (parser.hasMoreTokens()) {
>>       value=parser.nextToken();
>>       <xsp:content>
>>         <xsp:expr>
>>           this.doCase(document,value,j)
>>         </xsp:expr>
>>       </xsp:content>
>>       j++;
>>     }
>>   </xsp:logic>
>></xsl:template>
>>
>></xsl:stylesheet>
>>
>>
>>
>>>"Alain Tixier" <alain.tixier@laposte.net> wrote:
>>>>I'm trying to migrate from cocoon 1.7.2 to 1.7.3. Everything is OK except
>>>>for one document where I get the following error message whith 
>>>>Xerces.1.0.3:
>>>>
>>>>org.apache.xerces.dom.DOMExceptionImpl: DOM005 Wrong document
>>>>         at java.lang.Throwable.fillInStackTrace(Native Method)
>>>>         at java.lang.Throwable.fillInStackTrace(Compiled Code)
>>>>         at java.lang.Throwable.(Compiled Code)
>>>>         at java.lang.Exception.(Compiled Code)
>>>>         at java.lang.RuntimeException.(RuntimeException.java:47)
>>>>         at org.w3c.dom.DOMException.(DOMException.java:33)
>>>>         at org.apache.xerces.domx.DOMException.(DOMException.java:83)
>>>>         at
>>>>org.apache.xerces.dom.DOMExceptionImpl.(DOMExceptionImpl.java:119)
>>>>         at
>>>>org.apache.xerces.dom.NodeContainer.internalInsertBefore(Compiled Code)
>>>>         at org.apache.xerces.dom.NodeContainer.insertBefore(Compiled Code)
>>>>         at org.apache.xerces.dom.NodeContainer.appendChild(Compiled Code)
>>>>         at _app._apache._htdocs._xml._flv03i_PI.populateDocument(Compiled
>>>>Code)
>>>>         at
>>>>org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
>>>>         at org.apache.cocoon.processor.xsp.XSPProcessor.process(Compiled
>>>>Code)
>>>>         at org.apache.cocoon.Engine.handle(Compiled Code)
>>>>         at org.apache.cocoon.Cocoon.service(Cocoon.java:166)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>>>>         at
>>>>org.apache.jserv.JServConnection.processRequest(JServConnection.java:314)
>>>>         at org.apache.jserv.JServConnection.run(Compiled Code)
>>>>         at java.lang.Thread.run(Compiled Code)
>>>>
>>>>with Xerces.1.0.4, the message is only:
>>>>
>>>>java.lang.NullPointerException
>>>>         at
>>>>org.apache.xerces.dom.ChildAndParentNode.internalInsertBefore(Compiled 
>>>>Code)
>>>>         at org.apache.xerces.dom.ChildAndParentNode.insertBefore(Compiled
>>>>Code)
>>>>         at org.apache.xerces.dom.NodeImpl.appendChild(Compiled Code)
>>>>         at _app._apache._htdocs._xml._flv03i_PI.populateDocument(Compiled
>>>>Code)
>>>>         at
>>>>org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
>>>>         at org.apache.cocoon.processor.xsp.XSPProcessor.process(Compiled
>>>>Code)
>>>>         at org.apache.cocoon.Engine.handle(Compiled Code)
>>>>         at org.apache.cocoon.Cocoon.service(Cocoon.java:166)
>>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>>>>         at org.apache.jserv.JServConnection.processRequest(Compiled Code)
>>>>         at org.apache.jserv.JServConnection.run(Compiled Code)
>>>>         at java.lang.Thread.run(Compiled Code)
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org

Alain Tixier
alain.tixier@laposte.net

Mime
View raw message