I have a client class that it has its own names and values� attributes in a
Properties class. I need to convert this in a xml with the tags
<field><name>blabla</name><value>blabla</value></field> for each class
attribute. I get some errors and I don't know what�s up. Some
nullPointException.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS: $Id: simple.xsp,v 1.3 2002/02/09 06:21:57 vgritsenko Exp $ -->
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:log="http://apache.org/xsp/log/2.0";
xmlns:capture="http://apache.org/cocoon/capture/1.0";>
<page>
        <content>
        <registry>
                <xsp:logic><![CDATA[
                        miCliente.Cliente cliente=new miCliente.Cliente(5);
                        java.util.Properties prop=cliente.getProperties();
                        java.util.Enumeration
propNames=prop.propertyNames();
                                        
                        String propName="hola";
                        String property="hola";
                                        
                        while (propNames.hasMoreElements() ){
                                                
                                propName=(String) propNames.nextElement();
                                property=prop.getProperty(propName);
                                                
                        ]]>
                                <field>
                                        <name>
        
<xsp:expr>propName</xsp:expr>
                                        </name>
                                        <value>
        
<xsp:expr>property</xsp:expr>
                                        </value>
                                </field>
                        <![CDATA[
                        }
                       ]]>
                                        
                </xsp:logic>
        </registry>
        </content>
</page>
</xsp:page>

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

Reply via email to