Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 15608 invoked by uid 500); 3 Dec 2002 02:35:13 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 15590 invoked from network); 3 Dec 2002 02:35:13 -0000 X-Envelope-Sender-Is: Lars.Kirchhoff@wincor-nixdorf.com (at relayer david-wn.wincor-nixdorf.com) Message-ID: From: "Kirchhoff, Lars" To: "'cocoon-users@xml.apache.org'" Subject: AW: XMLForm and Table output Date: Tue, 3 Dec 2002 10:35:06 +0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N maybe I was a bit unprecise. I already could see that the xml output is correct.=20 the only thing I'm still not sure is how to reference the dom in the = xml page.=20 I tried the following: =20 and Usernames: =09 and several others ... (but this seemed to be the most logical ones after reading the xmlform specs from w3c) but it's not working. Now my guess is that probably the data is not=20 return probaply to the xml page or better the pipeline. In the action java file I have this getForm().getModel(); statement and am now=20 wondering if this returns all Data, not only the bean data? maybe you can help finding the light out of this... ciao Lars > -----Urspr=FCngliche Nachricht----- > Von: Ivelin Ivanov [mailto:ivelin@apache.org] > Gesendet: Dienstag, 3. Dezember 2002 10:00 > An: cocoon-users@xml.apache.org > Betreff: Re: XMLForm and Table output >=20 >=20 > I am not sure what exactly the problem is, > but I guess you might be actually looking for a file reader instead = of > generator. >=20 > I have not really used Cocoon for printing. >=20 > Ivelin >=20 >=20 > ----- Original Message ----- > From: "Kirchhoff, Lars" > To: > Sent: Monday, December 02, 2002 12:15 AM > Subject: AW: XMLForm and Table output >=20 >=20 > thanks Ivelin, >=20 > but now I'm right in front of a new problem, how to print out=20 > the document > using > cocoon? I couldn't find a generator that gets the input right=20 > from a stream? > Do I have to write my own generator? If yes, can you point me to some > documentation > about this, because I couldn't found it. >=20 > thanks Lars >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Ivelin Ivanov [mailto:ivelin@apache.org] > > Gesendet: Sonntag, 1. Dezember 2002 00:03 > > An: cocoon-users@xml.apache.org > > Betreff: Re: XMLForm and Table output > > > > > > Yes. You are on the right track. > > Why don't you print the XML document once it is created to=20 > see what it > > actually contains. > > I suspect this might be a simple mistake due to misuse of the > > API. It is not > > very convenient. > > Actually if you plan writing a lot of DOM code, you may want > > to look at JDOM > > or some of the O/R mapping frameworks. > > > > > > Ivelin > > > > > > > > ----- Original Message ----- > > From: "Kirchhoff, Lars" > > To: "Cocoon-Users (E-Mail)" > > Sent: Thursday, November 28, 2002 4:49 AM > > Subject: XMLForm and Table output > > > > > > > Hi, > > > > > > it's me again and I hope I'm still getting answers and not > > starting to > > > bother you all > > > with all my questions. > > > I've tried to create an application which simple should get > > some user data > > > from a > > > database, by simply enter the name. So my first form is > > just a text field > > > where the name > > > can be inserted. If the name is found all data will be > > shown. so far so > > > good. But now > > > I would like to built something more. Because I do not look > > at the exact > > > name in the > > > database it could be possible to get more then one entry. I > > now want to > > > create a page, > > > where all possible names are shown and some more additional > > information > > > about them. > > > So what I would like to have should be looking like this: > > > ---------------------------------------------- > > > | name | address | city | zip | > > > ---------------------------------------------- > > > | name1 | address1 | city1 | zip1 | > > > | name2 | address2 | city2 | zip2 | > > > | name3 | address3 | city3 | zip3 | > > > | ... | ... | ... | ... | > > > > > > where the user has the possibility to click on the a name > > to get the full > > > detail. > > > So what I thought is to write a method which get me the > > data from the > > > database and > > > put this in a DOM Nodes. I thought this would enable me to > > use them in the > > > > > > statement, but unfortunately it didn't worked out so far. > > > > > > Here is the code I used to create the DOM Nodes: > > > > > -------------------------------------------------------------- > > ------------ > > -- > > > --------------- > > > // = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > > // Use DOM nodes to store values > > > // = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > > DOMImplementation impl; > > > > > > try { > > > DocumentBuilderFactory factory =3D > > > DocumentBuilderFactory.newInstance(); > > > factory.setNamespaceAware( false ); > > > factory.setValidating( false ); > > > DocumentBuilder builder =3D factory.newDocumentBuilder(); > > > impl =3D builder.getDOMImplementation(); > > > } > > > catch ( Exception e ) { > > > throw new RuntimeException( "Failed to initialize DOM=20 > factory. Root > > > cause: \n" + e ); > > > } > > > > > > // = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > > // Use DOM nodes to store values > > > // = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > > Document doc =3D impl.createDocument( null, "Users", null ); > > > Node root =3D doc.getDocumentElement(); > > > Node custname =3D null; > > > Node address =3D null; > > > Node zip =3D null; > > > Node city =3D null; > > > Node user =3D null; > > > Text text; > > > > > > try { > > > Class.forName( "org.postgresql.Driver" ); > > > Connection con =3D > > > DriverManager.getConnection( DB_URL, DB_USER, DB_PASS ); > > > Statement stmt =3D con.createStatement(); > > > String update =3D "select custname, busname, > > > address, city, state, zip, pobox, pocode from customer > > where custname like > > > '%" + name + "%'"; > > > ResultSet rs =3D stmt.executeQuery( update > > > ); > > > > > > while ( rs.next() ) { > > > user =3D doc.createElement( "user" ); > > > root.appendChild( user ); > > > > > > custname =3D doc.createElement( "custname" ); > > > > > > text =3D doc.createTextNode( rs.getString( > > > "custname" ) ); > > > custname.appendChild( text ); > > > user.appendChild( custname ); > > > > > > address =3D doc.createElement( "address" ); > > > > > > text =3D doc.createTextNode( rs.getString( > > > "address" ) ); > > > address.appendChild( text ); > > > user.appendChild( address ); > > > > > > zip =3D doc.createElement( "zip" ); > > > > > > text =3D doc.createTextNode( rs.getString( "zip" ) > > > ); > > > zip.appendChild( text ); > > > user.appendChild( zip ); > > > > > > city =3D doc.createElement( "city" ); > > > > > > text =3D doc.createTextNode( rs.getString( "city" ) > > > ); > > > city.appendChild( text ); > > > user.appendChild( city ); > > > > > > system =3D root; > > > } > > > } > > > catch( Exception e ) { } > > > > > -------------------------------------------------------------- > > ------------ > > -- > > > --------------- > > > > > > I expected to create the following structure with it: > > > > > > > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > >
> > > > > > So what I'm now wondering is, if I'm on the right track and > > just doing > > some > > > beginner mistakes > > > or if this won't work at all. > > > > > > Thanks in advance that you read up to here. > > > > > > ciao Lars > > > > > > > >=20 > --------------------------------------------------------------------- > > > Please check that your question has not already been > > answered in the > > > FAQ before posting. > > > > > > > > To unsubscribe, e-mail: > > > > > For additional commands, e-mail: > > > > > > > > > > >=20 > --------------------------------------------------------------------- > > Please check that your question has not already been=20 > answered in the > > FAQ before posting. =20 > > > > > To unsubscribe, e-mail: =20 > > > For additional commands, e-mail: =20 > > > >=20 > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. >=20 > To unsubscribe, e-mail: > For additional commands, e-mail: >=20 >=20 >=20 > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. >=20 > To unsubscribe, e-mail: > For additional commands, e-mail: >=20 --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: