XML Server Getting Started
sw.write( );
sw.write(attrs.item(i).getNodeName());
sw.write("=\"");
sw.write( attrs.item(i).getNodeValue());
sw.write( " );
}
}
sw.write( > );
NodeList children = node.getChildNodes();
if ( children != null ) {
int len = children.getLength();
for ( int i = 0; i < len; i++ ) {
getNodeXML(children.item(i), sw);
}
}
break;
}
// handle entity reference nodes
case Node.ENTITY_REFERENCE_NODE: {
sw.write( & );
sw.write(node.getNodeName());
sw.write( ; );
break;
}
// print cdata sections
case Node.CDATA_SECTION_NODE: {
sw.write("
sw.write(node.getNodeValue());
sw.write("]]>");
break;
}
// print text
case Node.TEXT_NODE: {
sw.write( node.getNodeValue());
break;
}
// print processing instruction
case Node.PROCESSING_INSTRUCTION_NODE: {
sw.write("");
sw.write(node.getNodeName());
String data = node.getNodeValue();
if ( data != null && data.length() > 0 ) {
sw.write( );
sw.write(data);
2000 2002 Computer Technology Inc. All rights reserved.
Page 62
J2EE Web Hosting Tundra XML Server Pages J2EE Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |