Hash Fellow robcat2075 Posted February 8, 2019 Hash Fellow Posted February 8, 2019 I've tried several free XML editors and haven't found one yet that does what i need it to do... Can load an A:M text file Display the various levels of XML data object hierarchy in a properly indented tree Enables me to easily change both the opening and closing tags of a data object in one step, without having to manually count through levels Can save back out without creating an "invalid file" for A:M For example, in an A:M file the data for a bone is contained between <SEGMENT>... </SEGMENT> tags If i want to change a Bone to Null I could change those to <NULLOBJECT>... </NULLOBJECT> However, if that bone has children the closing tag is hard to match up with its opening tag in a regular text editor. Can anyone find an XML editor that simplifies this task? Quote
serg2 Posted February 9, 2019 Posted February 9, 2019 https://www.internet-technologies.ru/articles/10-luchshih-xml-redaktorov.html Quote
serg2 Posted February 9, 2019 Posted February 9, 2019 https://notepad-plus-plus.org/download/v7.6.3.html Quote
Hash Fellow robcat2075 Posted February 9, 2019 Author Hash Fellow Posted February 9, 2019 7 hours ago, serg2 said: https://notepad-plus-plus.org/download/v7.6.3.html Thanks, Serg. This does at least highlight matching tags, but is there a way to edit the two tags together? If I edit the opening tag, the highlighting of the closing tag is lost and I'm back to trying to find it manually, possibly many hundreds of lines away. 🙁 It also doesn't seem to do a tree view with indents, which would make finding the closing tag easier. Quote
serg2 Posted February 10, 2019 Posted February 10, 2019 I tried XML Notepad 2007 (https://www.microsoft.com/en-us/download/confirmation.aspx?id=7973) But I had to rename the file to load and delete some expressions. Quote
nemyax Posted February 14, 2019 Posted February 14, 2019 On 2/9/2019 at 12:46 AM, robcat2075 said: Can load an A:M text file Can save back out without creating an "invalid file" for A:M That's a tall order, because A:M markup isn't real XML. Quote
Admin Rodney Posted February 14, 2019 Admin Posted February 14, 2019 I'm a fan of notepad++ for such purposes. The "one step" change/removal is the most difficult part but that can be done by creating a macro for that purpose. What you might want to do is introduce an interim step that adds a temporary 'tag' to the text to be changed. This will help in flagging the other end of the container. In short, you pre-format the A:M xml file with useful tags and then remove those at the end of the process. Nemyax's comment on the A:M files not being fully formatted XML is a valid one and so the pre-formatting can assist in that as well. A bit far afield but depending on what your goal is you might consider what it will take to create a empty default A:M file and then automate that aspect of file creation in a way that emplaces the require xml prior to and after the targeted content. Then it becomes mostly a matter of appending the three sections together. But... To resolve the issue with editing both tags my suggestion would be to replace the targeted tag with a working tag for purpose of editing and then restore the tag to whatever desired as the final process. This ensures that you can always reach out and grab the text, or formatting you want to include End of Line, carriage returns etc. Quote
Hash Fellow robcat2075 Posted February 14, 2019 Author Hash Fellow Posted February 14, 2019 53 minutes ago, Rodney said: I'm a fan of notepad++ for such purposes. The "one step" change/removal is the most difficult part but that can be done by creating a macro for that purpose. I like the idea of a macro. Can you show that macro idea working for this? I don't want to change all the SEGMENT tags, just the pair for a particular bone. Quote
nemyax Posted February 14, 2019 Posted February 14, 2019 robcat2075 Looks like it's a matter of batch-replacing "SEGMENT>" by "NULLOBJECT>" in your selection of lines. And I think Notepad++ supports Python too. Quote
Hash Fellow robcat2075 Posted February 14, 2019 Author Hash Fellow Posted February 14, 2019 Selecting the lines is the problem. The <SEGMENT>... </SEGMENT> pair I want to change may be hundreds of lines apart and may have many other nested <SEGMENT>... </SEGMENT> pairs between them. It is easy to get it wrong when trying to identify them manually. Quote
Admin Rodney Posted February 14, 2019 Admin Posted February 14, 2019 The nested <segment> sections are problematic. I don't have A:M on the laptop I have at the moment and and quite a distance away from my desktop. If you can share an example file with target content to be changed that will be appreciated. I've used a few Search and Replace utilities/programs that use RegEx (Regular Expressions) and those can be quite powerful. The one I like the most I got via Shareware on Sale but that was only free during the promotion period. I'll investigate that. Notepad++ can likely do everything these apps can do but those processes aren't built in. Other random thoughts... - If you can isolate the Bone sequence from the rest of the file you could then use an approach such as only editing the first and last lines of that portion rather than parsing through the nested containers. You could even just remove the first and last lines and replace them with proper container. - We are right on the edge of where it would likely be more advantageous to program a utility that uses A:M's SDK to get the job done. - I have not really considered whether or not there might be a way to do this inside of A:M. For example, if A:M's filter capability could flag/isolate the 'segments'. Rationale: As a rule the best program to edit A:M files is going to be A:M. Quote
Hash Fellow robcat2075 Posted February 15, 2019 Author Hash Fellow Posted February 15, 2019 2 hours ago, Rodney said: If you can share an example file with target content to be changed that will be appreciated. Here is a sample PRJ with a model in it TSMArmsAndLegsBenders01.prj it has four Bones that I would want to change to nulls with text editing... 1 right lowerArmBenderNull 1 right upperArmBenderNull 1 right lowerLegBenderNull 1 right upperLegBenderNull Quote
Recommended Posts
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.