Monday 15 March 2010

java - DTD Element Type to accept '<' -


I have an XML file that can look like this:

  & lt; Unclassified & gt; Woman Finishes Up # 30,000 Teenager Needs ARM & lt; & Lt; / Unclassified & gt;  

.dtd Announcement:

   
  [fatal error] arm1sub.sgml: 14: 46: of elements Content should contain well described character data or markup org.xml.sax.SAXParseException; SystemId: File: /home/sfalk/workspace/project/target/classes/meter_coppus/PA/annotated/courts/12.07.99/arm/arm1sub.sgml; Line number: 14; Column number: 46; Content of the elements should be well described character data or markup at com.sun.org.apache.xerces.internal.parsers com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (DOMParser.java : 257) (DocumentBuilderImpl.java348) at Javax.xml.parsers.DocumentBuilder.parse (DocumentBuilder.java205)  

How can I do this? I hope this is possible in some way without tampering my .xml files.

Nothing can be changed to DTD to solve this problem. "XML" documents themselves should be replaced. (Technically, your document is not actually XML.)

DTDs (and XSD) scope is validation , but a condition for XML is for its validity Well formed . (In fact, one condition for a document XML is that it is well formed ).

For a complete explanation of the differences, read XML for your special problem, XML & amp; Lt; Change .


No comments:

Post a Comment