Sorting sheet sets XML files

 I am attempting to sort a sheet set (created by the SHEET SET command, Not from within the Publish dialog box.) There does not seem to be a way to do this, except for manually dragging sheets, one-by-one.

Here is some more explanation of my situation; 

My sheet set will incorporate layouts from 3 different drawings, for a total of 55 layouts. The actual order of the layouts to be printed, is interwoven between the drawings. When I import the layouts from a drawing, those layout are added to the end of the first group.


Note that I already have the layouts named so that their page number is first. Our numbering scheme starts with two letters, then some numbers. E.g. RA3.1.2. I can manually drag the layouts, one at a time, to where they should be sequentially. 

Ideally I would like to just sort all of the layouts from the various drawings alphabetically. Is that possible?


I tried looking at a Sheet Set, exported as an XML file, to see if I could somehow sort it. But I can't figure out a way to sort the entries.


Any ideas?  Thanks for any advice.

Comments

  •  The difficulty of sorting long sheet sets continues to be a problem for me.   This is made worse when I need to re-create a list if there are a number of layout additions, which is typical as a project progresses.  I really am hoping to find a way to sort the XML file.

    I have tried the following;

    1) Notepad ++ seems to have some features to work with XML files.  It opens the page set and tabs the markers by hierarchy.  But, I can't figure out how to sort the proper portions by the layout tab name.

    2) Excel can open a XML file,and it too, seems to have features to deal with XML files, and I was hoping the layout name would just be in a single column, so that I could sort using that.  But, no such luck.

    I really have no prior experience with XML, so that is part of the problem.  Perhaps someone here has some experience with those types of files and can suggest other programs that might be used to sort the layout list in a sheet set.

    -Joe
  •  Hi Joe,
    One option is xslt and will work in the browser. You can google "sort xml with xslt" and you'll find a considerable number of hits; though you will probably have to combine the information provided over several sites to complete your query. If you attach a sample file here I will attempt a solution when i get a chance.
    Regards,
    Daniel
  •  Thank you very much for the offer.  I did just try "sort xml with xslt", but I am confused about what it is.  Almost all the hits are at Stackoverflow.com, and sxlt seems to be a command used in a program, rather than the name of a utility program itself.  Is that correct?

    Attached is a sheet set saved as a XML file.

    -Joe

    Problem Numbering Page Sets.xml

  •  Xslt is another type of xml file which includes instructions to transform xml into an alternate file structure. You combine the two files within a browser or other program and they produce the desired result. I'll include instructions so you can reproduce it yourself. Bedtime now though so I'll have a look tomorrow.
  • Hi again, I haven't got a lot of time to go into detail but try the following out.  It worked on your example file as far as I can tell.  Open your sheet set xml file and copy all the contents to the clipboard; then go to the following web address http://www.freeformatter.com/xsl-transformer.html and paste your clipboard into the input field.  Next copy and paste the following XSL  into the XSL input field (this is the bit that does the magic).

    [code]
     
     

     
         
           
         
     

     
     
       
       
         
       
     
     
    [/code]

    Then hit the transform XML button and give it a few seconds.  The output should appear in the transformed xml field.  Copy this data into a new xml file and import into bricscad.  You will now have all the layouts in the right order but the numbers will be wrong.  To fix this, right click on the Sheet set name in the left hand tree view and select renumber.  The result should be correct numerically and alphabetically.  I have included the output from my run for your information (though I obviously haven't done the renumbering step).

    Regards,

    Daniel


    SheetSetOutput.xml

  •  Here is the missing XSL.  I dont know why the forum ate it.

     
     

     
         
           
         
     

     
     
       
       
         
       
     
     
  •  Sorry, it ate that too!  See the attached file.

    SheetSetReorder.xsl

  • I just attempted your solution, but the web site returned the following error;
    ===============
    This page contains the following errors:
    error on line 1 at column 1: Document is empty
    ===================

    Of course, thank you very much for the help you are providing.

    -Joe
  • Hi Joe,
    Try the attached xsl.  You will have to save the link somewhere on your computer as most browsers try to open it automatically.  I did not check the previous version after the Bricsys forum kept eating the xml and missed a bit of duplication in the file which would have caused issues.  I have tried the current version in Chrome and IE without any issues.  Let me know if that fixes the problem.  The output from the website includes the line ?xml version="1.0" encoding="UTF-8"? at the beginning; you will need to remove this before importing into Bricscad.

    Let me know how you go.

    SheetSetReorder.xsl

  •  Still no success. When I treid it in Maxthon, my normal browser, it has the same error as before.  So, I tried it in MicroSoft's I.E. It generated the following error,
    ======
    The XML page cannot be displayed Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later. Invalid at the top level of the document. Error processing resource 'http://www.freeformatter.com/xsl-transformer.html'. L... Unable to perform XSL transformation on your XML. null ^
    =======

     To detail my efforts, here are the steps I use.

    1. Open the page setup.xml in Notepad.
    2. Copy All
    3. Go to the web page you linked to earlier.
    4. Past the page setup.xml text.
    5. Open the SheetSetReorder.xsl code in Notepad.
    6. Copy All
    7. Past theSheetSetReorder.xsl code into the lower window on that web page.
    8. Click the Transform XML file button

    -Joe


  • Is "page setup.xml" any different to your original sheet set or is it identical. If it's different can you include that here? Also can you try the xml you included earlier to see if that works for you?
  •  I just downloaded the orginal XML file I uploaded, just to make sure it is exactly the same.  I used the Maxthon browser.  If I have the output forced into a new window, I get the error,
    =====

    This page contains the following errors:

    error on line 1 at column 1: Document is empty

    Below is a rendering of the page up to the first error.

    ======

    But, if I don't check that box, the error message is,
    ======
    Unable to perform XSL transformation on your XML file. The entity name must immediately follow the '&' in the entity reference.
    ======

    -Joe
  •  Hi Joe,

    I haven't been able to reproduce any of your errors though I can confirm that you cant just copy and paste out of the browser as it stuffs up the line endings.  However the method you have outlined is exactly what I have been doing.  My testing has been on Win8-64Bit and Win7-32Bit both without issue.  I'll see if I can make any other recommendations but at the moment I am stumped as it works fine here.

    Regards,

    Daniel
  •  What web browser are you using?

    -Joe
  • I've tried it with chrome and IE and both work without issue.
  • Here is another website that does the same as the first one.  Maybe it will provide better results for you.  All other options out of the box are going to cost you money or require some programming.  http://xslttest.appspot.com/.  If this doesn't work there is obviously something else going on with your system.
  •  Thanks for sticking with me on this.  I tried the new web page, http://xslttest.appspot.com/, with both Maxthon and Microsoft's Internet Explorer.  Both generate the same errors;
    ===============
    Enter your XSLT or it's URL:
    XSLT Error: The entity name must immediately follow the '&' in the entity reference.
    ===============
    I also tried by entering the URL where you uploaded the XSL file on this forum.  But, I obtained the exact same results.

    Something has to be different. I ran these tests on I.E. version 11. Are you opening the files in Notepad and copying them to the clipboard, as I did? 

    Since the forum would not permit you to post your XSL code directly, is it also possible that your XSL code upload was modified by the forum software? 

    -Joe

    p.s. I did just note that when I was doing my tests today, that the Sheet Set.XML file was actually a copy of my XSL code. So, somehow I overwrote one with the other at some point.  But, regardless, I fixed that, and have the error above with the XSL file.
  •  Hi Joe, could you be putting the sheet set data in the xslt field because there is no "&" in this text, where as there is in the sheet set xml? I will upload a video when I get a chance if you don't nut it out sooner.
  •  The version of the XSL file I have does have && on line #22.  I have attached it, to make sure we are both looking at the same file.

    Also, since the web page refers to a XSLT file, am I correct in guessing it is the same as a XSL file?

    -Joe

    SheetSetReorder.xsl

  •  Hi Joe,
    The text in that link is nothing like that which I originally posted.  Try the attached text file instead. I will also try to display the XML below.  Note the forum may eat the text up again as it tries to interpret the XML itself.

    <![CDATA[ </div>
     
     

     
         
           
         
     

     
     
       
       
         
       
     
     
    ]]>
  •  Sorry that didn't work either.  Incidentally, there are only 19 lines in the file. I will try to get the data to you later in the day.
  •  Sorry that didn't work either.  Incidentally, there are only 19 lines in the file. I will try to get the data to you later in the day.

    Perhaps try attaching as a .ZIP?

    @Joe
    If you haven't already done so, suggest you raise a support request on adding sheet set sorting as a feature to BricsCAD.

    Regards,

    Jason Bourhill

    CAD Concepts
  • Joe: Are logged in when you download the .xsl file? Your version is the html of the Bricsys login page...
  • Good pick up Roy, I didn't put the clues together to realise it was due to not being logged in as I am always logged in myself.

    Joe, I have attached a copy of all files zipped up as per Jason's suggestion.  Let me know if this fixes the problem.

    As an aside, does anyone know how to post XML data to the forum?  I tried enclosing it in CDATA tags but the result is still blank?

    Problem Numbering Page Sets.zip

  •  Success!  I will mention that when you are not logged-in and then right-click on a file to download it, and select "Save target as", normally this would save the file. On some boards, this causes you to go to the log-on page.  But, on this forum, it will save the file with the same name as the original, but it will not be the file.  I will put in a support request pointing out the problem.

    I also made a new discovery.  If you have a Sheet Set created directly with the Sheet Set command, then publish, the layout names don't necessarily have the file-name prefix. This is in contrast to a sheet set created within the publish command which does not offer the option to omit the file name prefix.  In the publish window you can reorder a list by clicking the heading. So, all the prior discussion about sorting an XML is no longer needed.

    Of course, the whole Sheet Set thing has been quite confusing, and not well documented.  I will submit all the above to BricsCAD. 

    Thank you all for sticking with me thorough this.

    -Joe
  • Sadly the forum software is not that sophisticated. All texts inside 'pointy brackets' are handled as HTML tags (even if you use the 'Insert code' button).
    For a solution look at post #8 in this topic:
    https://forum.bricsys.com/discussion/19080
  •  just a quick update.  I found that you can drag a contiguous series of pages upward in the publish list, just not downward.  Downward seems to have a bug active in it and behaves oddly.

    -Joe
This discussion has been closed.