if (targetId.equalsIgnoreCase("0")) { xml = "<select><value>0</value><text>請選擇</text></select>"; }elseif (targetId.equalsIgnoreCase("1")) { xml = "<select><value>1</value><text>昌平</text></select>"; xml += "<select><value>2</value><text>豐臺</text></select>"; xml += "<select><value>3</value><text>海淀</text></select>"; xml += "<select><value>4</value><text>朝陽</text></select>"; }elseif (targetId.equalsIgnoreCase("2")) { xml = "<select><value>1</value><text>塘沽區</text></select>"; xml += "<select><value>2</value><text>漢沽區</text></select>"; xml += "<select><value>3</value><text>大港區</text></select>"; xml += "<select><value>4</value><text>東麗區</text></select>"; }else {// 若是是3,則返回下面的字符 xml = "<select><value>1</value><text>濟南</text></select>"; xml += "<select><value>2</value><text>青島</text></select>"; xml += "<select><value>3</value><text>淄博</text></select>"; xml += "<select><value>4</value><text>棗莊</text></select>"; }
String last_xml = xml_start + xml + xml_end; response.getWriter().write(last_xml);