Wednesday 15 July 2015

dtd - XML PCDATA and encoding -


I have to write some Java code in the XML file which will be automatically prompted.

This is the third party so I can not modify it. The announcement of the tag tag looks like this.

I want to type the code that looks like Java: list & lt; String & gt; ValueList = New Arrestist & lt; & Gt; ();

I have tried some of the following things: List & amp; # 60; String & amp; # 62; ValueList = new Arraylight & lt; & Gt; ();

List & amp; Lt; String & amp; Gt; ValueList = new ArrayList & lt; & Gt; ();

But I'm getting: org.xml.sax.SAXParseException; Content of the elements should be well described character data or markup.

Any ideas that I am doing wrong

I have to type Java code in XML, there is no alternative solution for this. If nothing does not work then I have to use generics.

Any suggestions?

In your example, you have previously escaped the left angle bracket (and first right angle bracket, which is good And symmetric but not necessary). But you have not escaped the other string

  list & amp; # 60; String & amp; # 62; ValueList = New Arrestist & lt; & Gt; ();   

is not allowed as a PCDATA content, because it has an undisclosed left angle bracket. Try

  List & amp; # 60; String & amp; # 62; ValueList = new arreelist & amp; # 60; & Amp; # 62; ();    

No comments:

Post a Comment