Escape a forward slash in attribute name of XML

Viewed 3617

I am converting the XML String to Document before I operate on it. I receive the XML from a third party API.

This is my XML

<Student full/part="part" name="Some Name" dob="2000-08-01" totalMarks="565" science="9" maths="8" registration="987654"  class="distinction" />

This is the exception I get

org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String to the required type: org.w3c.dom.Document with value  due org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 64; Attribute name "full" associated with an element type "Student" must be followed by the ' = ' character.

Now I don't have definition and I just retrieve attribute values from this XMLs. ie tomorrow this element type might be Teacher from Student but I just put together values of attributes like registration,class and even 'full/part'.

I would like to know by which org.w3c.dom.Document tolerates this forward slash in this XML attribute name of given element type.

1 Answers
Related