Hi, Christopher,
Thanks for your detailed reply. I made a mistake in model1.xml. It
should not have the String: "<hello>". Yet the bug still exist.
Did you try customizing actor document with "<anystring>" ? I
think it will throw exception when you save and reopen it. If you
customize actor document with "<anystring>", it can not be saved. They
happens in Kepler. Because the moml paser will throw exeption when it
found <anystring> but didn't found </anystring>.
We did not intend to change moml file manually. :) The bug
originated from one of our new kepler actor which has document with "<>"
string. We have transform them to <> character when it is added.
It works when it is saved for the first time. But throws exception when
we reopen and save as an another file. It is because the file is saved
as "<anystring>" for the first time but as "<anystring>" for the
second time.
I will report it in kepler bugzilla for record.
Best wishes
Sincerely yours
Jianwu Wang
[EMAIL PROTECTED]
Post-Doctor
Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center
University of California, San Diego
San Diego, U.S.A.
Christopher Brooks wrote:
Hi Jianwu,
This seems to be an issue with Kepler's documentation system. The
custom documentation system in Ptolemy works fine.
The difference between the two .xml files you attached is below:
[EMAIL PROTECTED] 34% diff model1.xml model2.xml
4c4
< <entity name="model3" class="ptolemy.actor.TypedCompositeActor">
---
<entity name="model4" class="ptolemy.actor.TypedCompositeActor">
26c26
< <property name="userLevelDocumentation"
class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p><hello>The StringConstant actor
outputs a string specified via the actor's value parameter.</p>
---
<property name="userLevelDocumentation"
class="ptolemy.kernel.util.ConfigurableAttribute"><configure><p><hello>The StringConstant
actor outputs a string specified via the actor's value parameter.</p>
[EMAIL PROTECTED] 35%
If, under Ptolemy II 7.1.devel, I do this:
1) Start up, create a blank model
2) Drag a StringConst in
3) Right click, select Documentation | Customize Documentation
4) In the description field, enter
This is a <b>test</b> of > in a description
5) View the documentation, it looks fine:
This is a test of > in a description
6) Saving and reloading the file seems to work fine as well.
In step 2 of your example, you edit the xml by hand, right? One
solution is to not do that :-)
The issue here is that <configure> is defined to have PCDATA,
not CDATA.
The MoML DTD says:
<!ELEMENT configure (#PCDATA)>
<!ATTLIST configure source CDATA #IMPLIED>
http://www.w3schools.com/dtd/dtd_building.asp
described PCDATA and CDATA
--start--
PCDATA
PCDATA means parsed character data.
Think of character data as the text found between the start tag and
the end tag of an XML element.
PCDATA is text that WILL be parsed by a parser. The text will be
examined by the parser for entities and markup.
Tags inside the text will be treated as markup and entities will be
expanded.
However, parsed character data should not contain any &, <, or >
characters; these need to be represented by the & < and >
entities, respectively.
CDATA
CDATA means character data.
CDATA is text that will NOT be parsed by a parser. Tags inside the
text will NOT be treated as markup and entities will not be expanded.
--end--
So, if you use <configure>, then the contents get parsed and thus
should be well formed xml.
Now, it might be possible to something with <configure source="Foo.xml">
but I'm not sure.
I think there is a bug here in that if the inside of <configure> is
>hello>
then somehow that should be preserved. However, I'm not sure how to
do that.
_Christopher
--------
Hi guys:
We met an exception on escaped character parsing of moml file. You
can recur the exception by the following steps:
1, get one moml file (as model1.xml in attachement)
2, edit the moml file by adding "<hello>" in a certain <configure>
(as model2.xml in attachement)
3, open the edited moml file (model2.xml)
There will be an exception when you "save as" the edited moml file
(model2.xml) or "save" and "open" it. It is because "<hello>" is
changed to "<hello>" when you save the file.
Any ideas? Thanks.
--
Best wishes
Sincerely yours
Jianwu Wang
[EMAIL PROTECTED]
Post-Doctor
Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center
University of California, San Diego
San Diego, U.S.A.