0

I save following XML code as XML file.

<Z>
  <F>{"attributes":{"type":"form"}}</F>
  <M><%@ taglib prefix="zf" uri="http://www.zcore.org/tags/form" %></M>
</Z>

now when I want to load with JQuery I get this error :

Timestamp: 5/5/2013 7:05:13 PM Error: not well-formed

and this for the <%@ ... %> syntax that I put in the XML file.

How can I read this file as XML file without error?

Thanks to All.

Amit
  • 15,217
  • 8
  • 46
  • 68
AKZ
  • 856
  • 2
  • 12
  • 30

2 Answers2

1

You need to wrap your values in CDATA blocks so that the XML parser ignores the inner text. See below:

<Z>
  <F><![CDATA[{"attributes":{"type":"form"}}]]></F>
  <M><![CDATA[<%@ taglib prefix="zf" uri="http://www.zcore.org/tags/form" %>]]></M>
</Z>
QFDev
  • 8,668
  • 14
  • 58
  • 85
1

Correct your XML to be well formed. Check it using an online validator http://www.xmlvalidation.com/. It says:

The content of elements must consist of well-formed character data or markup

in other words you have to encode the <%@ ... > value as &lt; and &gt;

JJJ
  • 32,902
  • 20
  • 89
  • 102
Luca Rocchi
  • 6,272
  • 1
  • 23
  • 23