jpaulm / drawfbp

Tool for Creating and Exploring Flow-Based Programming Diagram Hierarchies
http://www.jpaulmorrison.com/fbp/
146 stars 20 forks source link

.drw files are missing the <net> open tag #14

Closed ERnsTL closed 6 years ago

ERnsTL commented 6 years ago

While implementing an XML parser for .drw files, this error message came up trying to parse .drw files genareted by v2.12.23:

element <drawfbp_file> closed by </net>

which means that the corresponding opening tag <net> is missing, which is true:

<?xml version="1.0"?> 
 <drawfbp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd"> <desc> </desc> <complang>Java</complang> <clicktogrid>true</clicktogrid> 
<blocks><block> <x> 123 </x> <y> 54 </y> <id> 16 </id> <type>I</type> <width>187</width> <height>17</height> <description>-quiet /var/log/syslog</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet> 

The <net> opening tag needs to be inserted after <drawfbp_file [...]> like so:

<?xml version="1.0"?> 
 <drawfbp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd"><net> <desc> </desc> <complang>Java</complang> <clicktogrid>true</clicktogrid> 
<blocks><block> <x> 123 </x> <y> 54 </y> <id> 16 </id> <type>I</type> <width>187</width> <height>17</height> <description>-quiet /var/log/syslog</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet> 
[...]

Please add outputting this <net> tag when saving .drw files from DrawFBP.

jpaulm commented 6 years ago

Hi ERnsTL,

Thanks so much for your feedback - it's great to know that someone is actually using DrawFBP! I will be working on these issues over the next few days...

Regards,

Paul M.

On Thu, Aug 9, 2018 at 10:03 AM, ERnsTL notifications@github.com wrote:

While implementing an XML parser for .drw files, this error message came up trying to parse .drw files genareted by v2.12.23:

element closed by

which means that the corresponding opening tag is missing, which is true:

<?xml version="1.0"?> <drawfbp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd"> Java true

123 54 16 I 187 17 -quiet /var/log/syslog falsefalsefalse The opening tag needs to be inserted after like so: Java true 123 54 16 I 187 17 -quiet /var/log/syslog falsefalsefalse [...] Please add outputting this tag when saving .drw files from DrawFBP. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
jpaulm commented 6 years ago

Hi ERnsTL, I cannot duplicate your problem - the code includes the "net" tag, and all the saved files I have checked all show it, including one I saved a few minutes ago... I am wondering if it was deleted by one of the tools you use - or possibly it is a "reserved" symbol in XML... Can you check some of your other files, and see if they all have this problem...? Thanks in advance. Paul

ERnsTL commented 6 years ago

Greetings, the error showed up in all the .drw files used for development of the .drw parser.

I just created a new test file with just one process for testing using DrawFBP v2.13.24 - the latest available on Maven.

Output is:

<?xml version="1.0"?> 
 <drawfbp_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="https://github.com/jpaulm/drawfbp/blob/master/lib/drawfbp_file.xsd"><complang>Java</complang> <clicktogrid>true</clicktogrid> 
<blocks><block> <x> 434 </x> <y> 247 </y> <id> 1 </id> <type>B</type> <width>92</width> <height>64</height> <description>TestProcess</description> <multiplex>false</multiplex><invisible>false</invisible><issubnet>false</issubnet> 
</block> 
</blocks> <connections>
</connections> </net> </drawfbp_file>

Before the <complang> there should be the <net> opening tag, but it is missing.

Nicely formatted:

<?xml version="1.0"?> 
<drawfbp_file xmlns:xsi="[...]" xsi:noNamespaceSchemaLocation="[...]">
    <net>    <!-- this <net> opening tag is missing -->
        <complang>Java</complang>
        <clicktogrid>true</clicktogrid> 
        <blocks>
        <block>
            <x> 434 </x>
            <y> 247 </y>
            <id> 1 </id>
            <type>B</type> 
            <width>92</width> 
            <height>64</height> 
            <description>TestProcess</description> 
            <multiplex>false</multiplex>
            <invisible>false</invisible>
            <issubnet>false</issubnet> 
        </block> 
        </blocks>
        <connections>
        </connections>
    </net>    <!-- closing tag is present -->
</drawfbp_file>

I dont have any other files besides these test files. Hoping to use .drw files more for visual development!

jpaulm commented 6 years ago

Aha! Got it! Dumb error: if desc was missing, I suppressed the net tag as well. It will be fixed in v2.14.2...

Apologies!

ERnsTL commented 6 years ago

No problem; thanks for fixing!

ERnsTL commented 6 years ago

Can confirm the issue is fixed in v2.14.2 - thanks again!

jpaulm commented 6 years ago

Good news! Thanks for both notes! Onwards and upwards!