The problem of <c:dump/> tag in jet2 [message #42585] |
Mon, 03 March 2008 01:07  |
Eclipse User |
|
|
|
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?
|
|
|
Re: The problem of <c:dump/> tag in jet2 [message #42799 is a reply to message #42585] |
Wed, 05 March 2008 11:44   |
Eclipse User |
|
|
|
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?
>
|
|
|
Re: The problem of <c:dump/> tag in jet2 [message #42829 is a reply to message #42799] |
Fri, 07 March 2008 01:32  |
Eclipse User |
|
|
|
Thanks for your explanation Paul,
Our case is generating a html file to describe specific xml file, one of
the requirment is generating all the xml source code into the html file,
so, all the content of the xml file (include the <![CDATA[...]]>, and the
format of the xml) should be remained in the result html.
As you said, I guess the existing model loaders may not fit our
requirement, right?
|
|
|
Powered by
FUDForum. Page generated in 0.03520 seconds