DocumentBuilder object is not able to parse a XML String which has a nodename which contains forward slash!



Hi All,

In my code below, I do have a XML String which has NodeName made of
two words split by a Forward Slash. Here it is: Number/Subsystem.

Is there anyway to make the DocumentBuilder object to parse XML String
and the Forward Slash, successfully?
I added this like of the code but it's not working:

XMLString = XMLString.replaceAll("Number/Subsystem","Number\"/
\"Subsystem");


Here is my code below:
------------------------------------


String XMLString = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"

+"<computerPart>"
+"<Number/Subsystem>9</Number/Subsystem>"
+"</computerPart>";

XMLString = XMLString.replaceAll("Number/Subsystem","Number\"/
\"Subsystem");



DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
try {
builder = factory.newDocumentBuilder();
} catch (ParserConfigurationException ex7) {
}

Document XMLStringToDOM= null;
try {
XMLStringToDOM = builder.parse(new InputSource(new
StringReader(XMLString.toString())));
} catch (IOException ex8) {
} catch (SAXException ex8) {
}

.