Jump to content
Clubplanet Nightlife Community

attn: programmers


Recommended Posts

Originally posted by dialectics

normally i don't beg for help but does anyone have a utility to compare two XML files? i'm tired and i can't get mine to work right. XML::SemanticDiff is utterly useless.

thanks in advance....

rob

XML sucks. machine language is where its at.

Link to comment
Share on other sites

fuck i can't get anything right tonight. i am going to lose my job.

and just 2 months before i quit.... this sucks.

yeah xml is so lame. i work with artificial intelligence dammit, i shouldn't have to demean myself doing this shitty work. this is such a stupid deliverable that the fact that its giving me problems is making it suck even more. dammit.

peaz,

rob

Link to comment
Share on other sites

How did you do it? I was going to suggest using an XML parser to simultaneously parse through each node, comparing the contents as you go. Tedious and probably very slow, but if all else fails...

Link to comment
Share on other sites

Originally posted by hoke

How did you do it? I was going to suggest using an XML parser to simultaneously parse through each node, comparing the contents as you go. Tedious and probably very slow, but if all else fails...

i did it recursively... used xml parser XML::Simple, which gives you a hash of arrays of hashes of arrays of hashes of...., and then compared each node like a postorder traversal of a tree (remember cs 102?)

comparing nodes wasn't just comparing values, but potential multiple copies of the same tag, so within your traversal you have to exhaustively compare those options. other then that it is routine.

the trouble is with when to actually output an error if its found - errors always propogate up the tree so once you do your forward stage of error detection, you have to do another forward stage of output. this was the part i was having trouble with because object oriented perl is such a pain in the ass, so i had to jerry-rig my data structure to support marking where the tags matched/didn't match. that part sucked.

thanks for the advice!

peaz,

rob

Link to comment
Share on other sites

Originally posted by tottallyoff

use windiff.exe

will that structurally compare xml files? or just check to see if the files are textually different? the problem is that tags can come in any order. i tried using a module that lexically sorts the tags and then performs a unix 'diff' on the two files, but the trouble is when you have a double occurance of the same tag, and they just so happen to not be sorted the same way in both files, then i'm fucked. and not in the good way :)

peaz,

rob

Link to comment
Share on other sites

Originally posted by tottallyoff

2. Cant you write a C or a java proggie to do that. If you want, I can do that for you very fast.

hehe that's what i just did - only i wrote it in perl. i am just lazy and when i couldn't get it to work right i wanted to see if anyone did it already :)

it produces a ton of output though (200 pages for 150 file comparisons), since it propogates errors up the parse tree, so i'm trying to reduce that so people can actually locate errors without sorting through all sorts of crap.

thanks for the offer though, much appreciated.

Rob

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...