Re: DocumentBuilder object is not able to parse a XML String which has a nodename which contains forward slash!
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Wed, 01 Aug 2007 19:00:49 -0400
Ed wrote:
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");
/ is not valid in XML names - see:
http://www.w3.org/TR/REC-xml/#NT-Name
I do not understand your replace.
Do you mean:
XMLString = XMLString.replaceAll("Number/Subsystem","Number.Subsystem");
?
Arne
.
- Follow-Ups:
- References:
- Prev by Date: Re: Class.getMethod in class's static initializer block
- Next by Date: Re: DocumentBuilder object is not able to parse a XML String which has a nodename which contains forward slash!
- Previous by thread: DocumentBuilder object is not able to parse a XML String which has a nodename which contains forward slash!
- Next by thread: Re: DocumentBuilder object is not able to parse a XML String which has a nodename which contains forward slash!
- Index(es):
Relevant Pages
|