StartElement is called each time there is a new start Element so there is already a loop.
Do not forget to do the same with the endElement method.


Lionel

At 14:11 29/01/2004 +0100, you wrote:
Hello

I just implemented a simple transformer with the start method below:

public void startElement(String namespaceURI, String localName, String
qualifiedName, Attributes attributes)
throws SAXException {


                String newLocalName = localName;
                String newQualifiedName = qualifiedName;

//System.out.println(localName);

                if (localName.equals(ELEMENT_ADDRESS)) {
                        newLocalName = "nickname";
                        String[] parts = qualifiedName.split(":");

if (parts.length == 2) {
newQualifiedName = parts[0] + ":" + newLocalName;
}
else
{
newQualifiedName = newLocalName;
}


}

super.startElement(namespaceURI, newLocalName, newQualifiedName,
attributes);
}


The transformer changes the local name "firstname" into "nickname". I would
like to extend this transformer: it should be able to rename all xml tags. do
i have to program a loop? do i have to implement multiple
startElement()-methodes ?

Thx for you help

Han J. Theus-Student




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

Lionel CRINE Ingénieur Systèmes documentaires Société : 4DConcept 22 rue Etienne de Jouy 78353 JOUY EN JOSAS Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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



Reply via email to