XML/HTML comparison

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mzel
    Expert
    • Mar 2008
    • 88

    XML/HTML comparison

    Can you compare actual tags for equivalence rather than plain string to string? Ignoring whitespacie, including the newline would be good too.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    We have XML Tidied and HTML Tidied which can be used to normalize the whitespace and line breaks. At this point, grammars can be defined to mark either just the nodes as Important, or specific other text as Unimportant.
    The different XML and HTML Tidied variants can be found in the "Alternatives" section here:
    http://www.scootersoftware.com/downl...kb_moreformats

    Once installed, the topmost format in the File Formats dialog is the format used automatically when opening. The others can be selected manually after opening the files.


    A guide for defining Unimportant text can be found here. To mark a grammar as Important, simply leave that one item checked, and uncheck all other items.
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment

    • mzel
      Expert
      • Mar 2008
      • 88

      #3
      The download and import worked, but now, that I have XML sorted a simple double click gices me conversion error. This is on the the side which I access via SFTP. Local PC works fine.
      Switching to "XML" or "XML tidied.
      But here another question comes up: How do I make my format selection stick?
      And second right up: Is there a way to apply format selection to both sides in one click?
      Thanks in advance.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15997

        #4
        Hello,

        For part 1, if the Sorted conversion has any issues with the syntax of the file, it will throw an error. If you download that file locally, then try to reopen, does it work?

        For 2, the format is picked based on the File Formats dialog. The topmost that matches the file mask is the one used automatically when you launch a new session and open files. If you load a previously saved session, then that format used in that specific saved session would be used.

        For 3, the Format's are listed as words/titles in each Text pane (allowing you to change one or the other). Above that are the toolbar buttons, the format button lets you edit the current format, and has a dropdown arrow next to it. If you use the Dropdown arrow, you can then switch to that format for both panes.
        Aaron P Scooter Software

        Comment

        • mzel
          Expert
          • Mar 2008
          • 88

          #5
          1) Local copy works. Over SFTP it does not. Regular XML, though, does work over SFTP.
          I do not see any error trace at the bottom of the file list view. In the file view it just says Error with the red bullet at the bottom.
          2) After I switch to, say, Xml tidied and close the file view it opens as Xml Sorted next time again.
          3) Ok, thanks that works. I used to switch it by the dropdown right above the text pane.

          Comment

          • mzel
            Expert
            • Mar 2008
            • 88

            #6
            2) moving rules in the session setup up and down worked too

            Comment

            • Aaron
              Team Scooter
              • Oct 2007
              • 15997

              #7
              Actually, BC4 now includes built-in XML Sorting or XML Tidying. Let's give these a try. You can find them in the Conversion tab, in the dropdown with built in conversions. If you alter your current XML format (or create a new one) that uses one of the internal methods, does this help?
              Aaron P Scooter Software

              Comment

              • mzel
                Expert
                • Mar 2008
                • 88

                #8
                I tried this. I see no effect of choosing XML sort or XML tidy in that drop down whatsoever. It looks exactly the same as plain XML

                Comment

                • Aaron
                  Team Scooter
                  • Oct 2007
                  • 15997

                  #9
                  Hello,

                  Could you verify this continues to be an issue with the built-in formats in the release from yesterday? If so, could you email in to [email protected] with:
                  - a link back to this forum thread for our reference
                  - Your BCSupport.zip from the Help menu -> Support; Export
                  - a pair of sample XML files
                  - a full screen screenshot showing the current comparison.
                  Aaron P Scooter Software

                  Comment

                  • mzel
                    Expert
                    • Mar 2008
                    • 88

                    #10
                    Aaron hi,
                    No luck here. Sent you the email with those attachments

                    Comment

                    • mzel
                      Expert
                      • Mar 2008
                      • 88

                      #11
                      BTW the variant with the external helper still does not work for me over SFTP

                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 15997

                        #12
                        Thanks for the files. I'm actually able to repeat some of this behavior without the SFTP. I'll make a tracker entry to investigate. It looks like there might be a parsing error with your files, but we aren't presenting it in the interface.
                        Aaron P Scooter Software

                        Comment

                        • mzel
                          Expert
                          • Mar 2008
                          • 88

                          #13
                          Should I moonlight as a QA?

                          Comment

                          • Chris
                            Team Scooter
                            • Oct 2007
                            • 5538

                            #14
                            Discussed this with one of our developers.

                            The XML Tidy format internal to Beyond Compare expects an XML tag at the beginning of the file. It also doesn't support the DOCTYPE tag. If you make those two changes manually, the files should load correctly with the format.
                            Chris K Scooter Software

                            Comment

                            • mzel
                              Expert
                              • Mar 2008
                              • 88

                              #15
                              OK, that worked. Is there a workaround for this? 98% of my files are like that. And external Tidy helper treats this just fine. And I guess you at least should trace an error. Silent treatment is killing me.

                              Comment

                              Working...