Jump to content

HyperPin XML Editor


tonycrew

Recommended Posts

Ok i re written the code for this that now uses Full XML Editing Capabilities.

The code has been reduced for better compatability and uses only the bare minimum resources.

UPDATE ART Ok this feature will now RENAME your ART FILES just type in the New Name and it will update your artwork and your XML to match. (I've tried to put Error Catching in but don't rely on it you all know what PC's are like)

Features:-

Ok i just added an Artwork Check it will check if there is a problem with the artwork.. i.e. Missing art or if it is named incorrectly it will say "No Image Available" . It now also checks for Instruction Cards and Flyers. Works on Both Visual Pinball and Future Pinball XML Files.

Paste Code from these forums and it will insert and AUTO SORT into ALPHABETICAL ORDER.

AUTO Sorts NEW XML Loaded.

Formats XML Correctly.

Add New Table, Update Existing Table.

Fix XML option for XML that won't load.

2 Download options Any CPU should work on all Versions of Windows XP and Vista, But if you have a 64Bit OS and it won't work try the X64 Version. (Not tested as i don't have 64Bit OS)

Please report any bugs you may find...

Any CPU Version Download

http://files.filefront.com/Hyperpin+Editor32BitCrar/;13897233;/fileinfo.html

64Bit CPU Only Download

http://files.filefront.com/Hyperpin+Editor64BitCrar/;13897234;/fileinfo.html

Also Available on the FTP for those who can access...

hyperpin6.jpg

hyperpin3.jpg

hyperpin2.jpg

Edited by tonycrew
Link to comment
Share on other sites

One thing that I can tell right away that would be convenient, is this...

I usually put a block of text in the table announcement for the user to copy into the xml.

Maybe it would be cool to add a little square textfield block in your program that they can paste the block into. Then it will automatically add it in to the database in the proper spot.

Link to comment
Share on other sites

One thing that I can tell right away that would be convenient, is this...

I usually put a block of text in the table announcement for the user to copy into the xml.

Maybe it would be cool to add a little square textfield block in your program that they can paste the block into. Then it will automatically add it in to the database in the proper spot.

Oh yeh i noticed you do that in your posts... i will add this later.

Link to comment
Share on other sites

Guest rossicomputers

Can not Load give me a error:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.Xml.XmlException: An error occurred while parsing EntityName. Line 476, position 26.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)

at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)

at System.Xml.XmlTextReaderImpl.Throw(String res)

at System.Xml.XmlTextReaderImpl.ParseEntityName()

at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)

at System.Xml.XmlTextReaderImpl.ParseAttributes()

at System.Xml.XmlTextReaderImpl.ParseElement()

at System.Xml.XmlTextReaderImpl.ParseElementContent()

at System.Xml.XmlTextReaderImpl.Read()

at System.Xml.XmlTextReader.Read()

at System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader reader)

at System.Xml.XmlDocument.ReadNode(XmlReader reader)

at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)

at System.Data.DataSet.ReadXml(String fileName)

at Hyperpin_XML_Editor.Form1.OpenFileDialog1_FileOk(Object sender, CancelEventArgs e)

at System.Windows.Forms.FileDialog.OnFileOk(CancelEventArgs e)

at System.Windows.Forms.FileDialog.HandleVistaFileOk(IFileDialog dialog)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3074 (QFE.050727-3000)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

Hyperpin Editor

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/HyperPin/Hyperpin%20Editor2/Hyperpin%20Editor.exe

----------------------------------------

Microsoft.VisualBasic

Assembly Version: 8.0.0.0

Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System.Runtime.Remoting

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

----------------------------------------

System.Data

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll

----------------------------------------

System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3074 (QFE.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

Link to comment
Share on other sites

Can not Load give me a error:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.Xml.XmlException: An error occurred while parsing EntityName. Line 476, position 26.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)

at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)

at System.Xml.XmlTextReaderImpl.Throw(String res)

at System.Xml.XmlTextReaderImpl.ParseEntityName()

at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)

at System.Xml.XmlTextReaderImpl.ParseAttributes()

at System.Xml.XmlTextReaderImpl.ParseElement()

at System.Xml.XmlTextReaderImpl.ParseElementContent()

at System.Xml.XmlTextReaderImpl.Read()

at System.Xml.XmlTextReader.Read()

at System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader reader)

at System.Xml.XmlDocument.ReadNode(XmlReader reader)

at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)

at System.Data.DataSet.ReadXml(String fileName)

at Hyperpin_XML_Editor.Form1.OpenFileDialog1_FileOk(Object sender, CancelEventArgs e)

at System.Windows.Forms.FileDialog.OnFileOk(CancelEventArgs e)

at System.Windows.Forms.FileDialog.HandleVistaFileOk(IFileDialog dialog)

************** Loaded Assemblies **************

mscorlib

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3074 (QFE.050727-3000)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

Hyperpin Editor

Assembly Version: 1.0.0.0

Win32 Version: 1.0.0.0

CodeBase: file:///C:/HyperPin/Hyperpin%20Editor2/Hyperpin%20Editor.exe

----------------------------------------

Microsoft.VisualBasic

Assembly Version: 8.0.0.0

Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

----------------------------------------

System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

System.Runtime.Remoting

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

----------------------------------------

System.Data

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll

----------------------------------------

System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3074 (QFE.050727-3000)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

I get the same error. Are you using vista? That's the OS that I am using. This is the same error that I get with his other program. I wonder if it is a vista thing.

Link to comment
Share on other sites

Reading the debugger information, it looks more like an issue with the XML file it's trying to read (possibly the reader code used) and not the assemblies. According to that error message, it's using .NET 2.0 framework files, so at most, 2.0 should be needed.

For Tony:

I can't say for sure, but I'd take a stab and say it's the XML Reader, sounds like XMLTextReader is used (some report that using XMLDocument is a better way to go, but that all depends on the handling).

I use XMLTextReader and parse the attributes similar to such:

           XmlTextReader reader = new XmlTextReader(filename);

              while (reader.Read())
               {
                   if (reader.Name.Equals("elementstringhere"))
                   {
                       if (reader.GetAttribute("attributestring") != null)
                           arrayorsomething.Add( reader.GetAttribute("attributestring") );
                   }
                   else if (reader.Name.Equals("someotherelementstring"))
                       arrayorsomething.Add( reader.ReadElementString("someotherelementstring") );
               }

Hope that helps! I would suggest adding some Try/Catch statements to see if it fails when loading/etc and possibly have it give some kinda process message to track it down? :)

Link to comment
Share on other sites

Do you get this error when trying load an XML if so

I get this error because of the &

<menu>

<game name="Star_Wars_JP_1.1FS">

<description>Star & Wars (Data East 1992)</description>

<manufacturer>Data East</manufacturer>

<year>1992</year>

<type>SS</type>

</game>

Try using the FIX option 1st if not load it into a text editor or my RAW editor and use Find And Replace.

Find &

Replae All &

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Xml.XmlException: An error occurred while parsing EntityName. Line 3, position 28.
  at System.Xml.XmlTextReaderImpl.Throw(Exception e)
  at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
  at System.Xml.XmlTextReaderImpl.Throw(String res)
  at System.Xml.XmlTextReaderImpl.ParseEntityName()
  at System.Xml.XmlTextReaderImpl.ParseEntityReference()
  at System.Xml.XmlTextReaderImpl.Read()
  at System.Xml.XmlTextReader.Read()
  at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
  at System.Xml.XmlLoader.ReadCurrentNode(XmlDocument doc, XmlReader reader)
  at System.Xml.XmlDocument.ReadNode(XmlReader reader)
  at System.Data.DataSet.ReadXml(XmlReader reader, Boolean denyResolving)
  at System.Data.DataSet.ReadXml(String fileName)
  at Hyperpin_XML_Editor.Form1.OpenFileDialog1_FileOk(Object sender, CancelEventArgs e) in F:\Documents and Settings\tony crew\My Documents\Visual Studio 2008\Projects\Hyperpin Editor\Hyperpin Editor\Form1.vb:line 27
  at System.Windows.Forms.FileDialog.OnFileOk(CancelEventArgs e)
  at System.Windows.Forms.FileDialog.DoFileOk(IntPtr lpOFN)


************** Loaded Assemblies **************
mscorlib
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
   CodeBase: file:///f:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Hyperpin Editor
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///F:/Documents%20and%20Settings/tony%20crew/My%20Documents/Visual%20Studio%202008/Projects/Hyperpin%20Editor/Hyperpin%20Editor/bin/Release/Hyperpin%20Editor.exe
----------------------------------------
Microsoft.VisualBasic
   Assembly Version: 8.0.0.0
   Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
   Assembly Version: 2.0.0.0
   Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
   CodeBase: file:///F:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

If not i will try something else.

Edited by tonycrew
Link to comment
Share on other sites

Looking at my code... (i am new to this, as my son didn't do this one lol) but what i do is VERY VERY SIMPLE i create a dataset and read the XML to the dataset and also read all the xml to a textbox and pass the description to a listbox.

I also reset the Dataset just before passing the XML to it, so that the dataset is totaly clean everytime.

Dim ds1 As New DataSet
ds1.reset()
ds1.ReadXml(OpenFileDialog1.FileName)
       TextBox9.Text = My.Computer.FileSystem.ReadAllText(OpenFileDialog1.FileName)

then pass it to a listbox

[/code] With ListBox2

.DisplayMember = "description"

.DataSource = ds1.Tables("game")

End With[/code]

then create the display members from the datasource

Comboboxes are hidden.

With ComboBox1
           .DisplayMember = "name"
           .DataSource = ds1.Tables("game")
       End With
       With ComboBox2
           .DisplayMember = "description"
           .DataSource = ds1.Tables("game")
       End With
       With ComboBox3
           .DisplayMember = "manufacturer"
           .DataSource = ds1.Tables("game")
       End With
       With ComboBox4
           .DisplayMember = "year"
           .DataSource = ds1.Tables("game")
       End With
       With ComboBox5
           .DisplayMember = "type"
           .DataSource = ds1.Tables("game")
       End With
       TextBox2.Text = "Total Ammount of Games: " & ComboBox1.Items.Count.ToString
       TextBox12.Text = OpenFileDialog1.FileName

Textbox 12 just holds the file path

Textbox 9 holds the <menu> tabs for me. (i know you may look and wonder why some stuff is in there... it's because when doing the hyperspin editor there were alot of problems with peoples xml's not being the same, ie no tabs or proper layout.

Edited by tonycrew
Link to comment
Share on other sites

Tony: Just an FYI, when reading in XML, tabs should not matter. When writing XML with .NET, you can set the formatting of the output to auto-tab based upon how each element node is written.

I'm not an expert on VB.NET which it appears what yours is done in, but I at least know C / C#, and I currently use ArrayList<string>'s (not list boxes) to store my data temporarily (not the best way of doing it, but it works).

This is going to change very shortly as I rewrite my code to intertwine with Hyperion a lot more, however.

Link to comment
Share on other sites

Thanks... i know my coding is a bit... caveman like (hehe) i do seem to do thing a bit longwinded sometimes.... But i always try to keep it a basic as possible. I know we used string arrays on the last one at certain points.

I'm gonna put some new code in to try to get the & fixed before passing it to the dataset.

Link to comment
Share on other sites

We know that but some people asked about an XML editor for this so i made one.

Thanks Tonycrew. Notepad is an option but I thought some people my have issues with managing their databases and in some cases using a database editor is much quicker. I say put it out there and let the user decide. At least it's available. Good work!

Link to comment
Share on other sites

Nice, now that part is actually a time saving feature. I hate finding where to insert a game, I know its easy but it annoys me. Inserting the code into that part saves me time by not having to locate the right spot for the game and not having to add in the formatting either. When I paste the text into notepad it loses the formating also, since the forum post loses formatting. Thanks toneycrew.

Link to comment
Share on other sites

Nice, now that part is actually a time saving feature. I hate finding where to insert a game, I know its easy but it annoys me. Inserting the code into that part saves me time by not having to locate the right spot for the game and not having to add in the formatting either. When I paste the text into notepad it loses the formating also, since the forum post loses formatting. Thanks toneycrew.

No Worries.. please remeber i am still working on this.. so it's a work in progress and things may need to be altered in the code. As people use this program and sometimes get different results.... And i only been doin VB for a couple of weeks as before it was my son... so i am still learning myself.

What i am doing at the moment is coding a formating part that makes sure everyting is correct as you load your XML cause some people mess theirs up abit.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 4 weeks later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...