Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ERnsTL opened this issue Aug 9, 2018 · 7 comments
Closed

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

ERnsTL opened this issue Aug 9, 2018 · 7 comments

Comments

@ERnsTL
Copy link

ERnsTL commented Aug 9, 2018

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
Copy link
Owner

jpaulm commented Aug 10, 2018 via email

@jpaulm
Copy link
Owner

jpaulm commented Aug 10, 2018

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
Copy link
Author

ERnsTL commented Aug 11, 2018

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
Copy link
Owner

jpaulm commented Aug 12, 2018

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
Copy link
Author

ERnsTL commented Aug 12, 2018

No problem; thanks for fixing!

@ERnsTL
Copy link
Author

ERnsTL commented Aug 16, 2018

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

@jpaulm
Copy link
Owner

jpaulm commented Aug 17, 2018

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

@jpaulm jpaulm closed this as completed Aug 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants