Tapatalk

XML Convert to CR/LFs problem with />

XML Convert to CR/LFs problem with />

15
Basic UserBasic User
15

    Dec 13, 2011#1

    Dear,

    I am very happy with the "XML Convert to CR/LFs" function. I use it on regular basis to make XML files viewable.

    Now I have a problem with the conversion if there are "empty" XML tags like "<MyTag />"

    So, if I have the text :

    Code: Select all

    <master date="20111213"><object><code>ABDOMEN -C</code><name>CT ABDOMINAL SURVEY WITHOUT CONTRAST</name><active>true</active><bodyParts><element><dicomCode>ABDOMEN</dicomCode></element></bodyParts><modalityTypes><element><dicomCode>CT</dicomCode></element></modalityTypes><autoCreated>false</autoCreated><type>Internal</type><laterality><element><code>ND</code></element></laterality><externalProcedureCodes/></object></master>
    I paste this into my UltraEdit ( 17.30.0.1012 - fresh out today ;-) ) - choose XML highligting, and use the "XML Convert to CR/LFs" - you'll notice that the "</object>" tag is NOT un-indented. Probably because of the "<externalProcedureCodes/>" tag in front.

    Now - for one "object" this is not so bad, but when I have fifty of those it becomes little less readable :-(

    Any one an idea on how to work around this, or do I mail support ?

    Kind regards

    JoernH

    6,685587
    Grand MasterGrand Master
    6,685587

      Dec 13, 2011#2

      I copied your XML block into a new ASCII file with DOS line terminators and saved the file as Test.xml. The display for this file was

      before_xml_convert.png (818Bytes)
      Display before executing the conversion command.

      Next I executed first with UE v17.30.0.1011 and later also with v17.30.0.1012 after the update the command XML Convert to CR/LFs. In both versions of UltraEdit the result was

      after_xml_convert.png (2.41KiB)
      Display after executing the conversion command.

      So I can't reproduce your problem with my settings and default wordfile xml.uew. For verification if a setting could result in a different output, I started also UltraEdit with creating all configurations and settings completely new (= use default settings), opened again Text.xml and executed again the command. The result was again perfect, no indentation problem.

      15
      Basic UserBasic User
      15

        Dec 13, 2011#3

        Dear Mofi,

        As happy as I am for the success of your experiment - I am also baffled about my failure to get to the same result :-(
        Any chance I might "steal" your xml.uew file ?

        I attach my own for comparison. Sorry for the zip format - but uew was not allowed.

        Kind regards

        JoernH
        xml.uew.zip (5.57 KiB)   284

          Dec 13, 2011#4

          Aha - it works!

          I downloaded the file from page with user-submitted wordfiles for UltraEdit/UEStudio (this file looks really weird when the url is opened in my Chrome browser) and replaced my old xml.uew file - and TaDa - it works.

          Sorry for the fuzz ! - and a big thank you to Mofi for bothering with the complaints of an amateur :-)

          Kind regards

          JoernH

          6,685587
          Grand MasterGrand Master
          6,685587

            Dec 14, 2011#5

            xml.uew from UltraEdit website is a pretty old user contributed wordfile for XML. You should not use that wordfile.

            The wordfile I used is the standard xml.uew installed with UltraEdit. It is installed into wordfiles subdirectory of the UltraEdit program files directory. From this directory UltraEdit copies xml.uew to the user's wordfiles directory %APPDATA%\IDMComp\UltraEdit\wordfiles on new installation or when version number for the wordfiles in uedit32.exe is higher than in uedit32.ini and the user confirms the update of the wordfiles.

            Comparing your xml.uew with the standard xml.uew installed with UltraEdit showed me two differences: some additional tags in color group 4 which are all okay and

            Code: Select all

            /Indent Strings = "<"
            /Unindent Strings = "</"
            The two definitions for indent and unindent are the problem. With language marker XML_LANG in first line the special internal built-in indent/unindent feature for XML is enabled, but with your indent/unindent settings you overrule it and the result is a not correct unindent because no unindent on />. You can use your xml.uew, but have to delete these two lines for your wordfile.

            15
            Basic UserBasic User
            15

              Dec 16, 2011#6

              Hmmm

              So now I am using the original xml.uew file found with the original installation of UltraEdit.
              The "XML Convert to CR/LFs" works just fine, BUT...

              Now my indenting / un-indenting does not work very nicely :-(
              My XML file is only indented after an open xml tag ( <MyTag> )
              NOT un-indented after a closing tag ( </MyTag> or <MySecondTag /> )

              That was my reason to put in the indent / unindent tags in the uew file in the first place.

              Code: Select all

              /Indent Strings = "<"
              /Unindent Strings = "</" "/>"
              Any idea?

              Kind regards,
              JoernH

              6,685587
              Grand MasterGrand Master
              6,685587

                Dec 16, 2011#7

                I do not have really an idea why unindent does not work on your computer. It works fine on my computer. I suggest following just for verification if a setting could be the reason of the problem.
                • Close all instances of UltraEdit.
                • Copy to address bar of Windows Explorer the path %APPDATA%\IDMComp\ and press key RETURN to open this folder.
                • Rename the directory UltraEdit for example to UltraEdit_bak.
                • Start now UltraEdit which creates the directory UltraEdit new, copies the standard wordfiles into a wordfiles subdirectory also created new and creates also all uedit32.ini and the environment files.
                • Copy the XML snippet you posted here into the new file and save the file to a temporary directory with name Test.xml.
                • Run XML Convert to CR/LFs.
                Is the result now better? Is everything correct indented like on my screenshot?

                (I have used a tab stop value and indent value of 3 for *.xml files.)

                If the result is like my one, there is something on your settings now in directory UltraEdit_bak which cause wrong indent / unindent. If the result is still not correct, I have no further idea why.

                15
                Basic UserBasic User
                15

                  Dec 21, 2011#8

                  Created a support case with support and they were able to reproduce the problem.
                  Will see what that leads to ;-)

                  Kind regards

                  JoernH

                    Jan 26, 2012#9

                    Sorry for the late update on this one :-(

                    IDM acknowledged the problem 20 Dec 2011, but I still did not see any solution.
                    IDM Computer Solutions on 12/20/11 wrote:Hello Joern,

                    Thank you for your response. We are able to reproduce the problem here and have asked our developers to look further into the issue. We will notify you via email when there is an update available for this. I apologize for any inconvenience this issue may cause.