|
Re: The problem of <c:dump/> tag in jet2 [message #42799 is a reply to message #42585] |
Wed, 05 March 2008 16:44 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Benjamin:
The <![CDATA[...]]> is lost because JET does not know it existed in the
first place. JET uses EMF to load XML documents, and EMF turns all text,
whether CDATA or not into a simple text node.
<c:dump> was intended to be an aid to debugging. At times, it completely
fails to accurately represent the input (since c:dump is trying to produce
XML, but the input can be something completely different).
Question: Is the <![CDATA[...]]> really necessary in your context? It is
just an XML construct to save you from typing a few XML entities (< comes
to mind).
To get high fidelity rendering of the XML, I think two things would have to
happen:
1) JET would have to load the original document using the XML DOM - I hope
to commit this after EclipseCon
2) A XML DOM-specific XML serialization technique would need to be used. I'd
suggest writing a custom tag that used the Xerces XMLSerilizer to do this.
Paul
"Benjamin Fu" <benjamin.fubin@gmail.com> wrote in message
news:860058074377d3d4d0d2b013fc240bc8$1@www.eclipse.org...
> Hi, guys,
> I use <c:dump/> tag to generate the content of the entire input xml file,
> but I found some content can not be generated into the output file.
> Here is the template:
> <root>
> <aggregated>
> <query language="sql">
> <![CDATA[
> // The data access script
> ]]>
> </query>
> </aggregated>
> </root>
>
> here is the dump.jet
> <?xml version="1.0" encoding="utf-8"?>
> <c:dump select="/*" format="true" entities="true"/>
>
> And, here is the result:
> <?xml version="1.0" encoding="utf-8"?>
> <root>
> <level1/>
> <aggregated>
> <query language="sql">
> // The data access script
> </query>
> </aggregated>
> </root>
> the string "<![CDATA[" and "]]>" are missing in the result file.
>
> Why the strings are filtered? Is the problem a bug?
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04913 seconds