Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7647565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:29:41+00:00 2026-05-31T10:29:41+00:00

I am trying to modify a proprietory XML file using XSL and MSXSL. The

  • 0

I am trying to modify a proprietory XML file using XSL and MSXSL. The software in question is Blumind (blumind.org) a very pretty and fully portable mind mapping application (I have no connection with the author). It offer “progress bars” and I would like the progress at each node to reflect the sum of the progress below. It is my intention to use this as a combined project modelling and management tool.

I plan to run a batch file calling MSXML.EXE each time I load one of these file to update the progress. It is important that the structure of the file remains unchanged, only altering the value at various /map/nodes/node/widgets/widget/@value points and then corresponding /map/nodes/node/widgets/widget/@max points.

Not all nodes will have a progress bar, not all nodes with progress bars will have children with progress bars. So the logic needs to only change the progress bar to the sum of progress in the children – if the children have progress bars! Where the @value for “progress” is changed we need to make a similar change in the @max value to keep the denominator in sync with the “progress” (the widget will display the correct proportions, but will not calculate the percent – it justs adds “%” to the value!).

Sorry if this is difficult to visualise, I would recommend downloading version 1.3 portable zip file from http://blumind.org/download and loading this file (rename test.bmd) :-

Sorry I have tried so amany ways to ident this code – how should I do it?

<?xml version="1.0" encoding="utf-8"?>
<map name="test" document_type="Blumind" editor_version="1.3.21.1">
<!--Create by Blumind, you can download it free from http://www.blumind.org/download-->
    <info>
        <author>
        </author>
        <company>
        </company>
        <version>1.0</version>
    </info>
    <layout>TREE_RIGHT</layout>
    <attributes>
        <item name="editor_show_sidebar">True</item>
    </attributes>
    <style>
        <back_color>White</back_color>
        <fore_color>Black</fore_color>
        <line_color>LightSlateGray</line_color>
        <border_color>SlateGray</border_color>
        <node_back_color>LightGray</node_back_color>
        <node_fore_color>Black</node_fore_color>
        <select_color>RoyalBlue</select_color>
        <hover_color>MediumSlateBlue</hover_color>
        <link_line_color>Green</link_line_color>
    </style>
    <nodes>
        <node text="Overall Progress">
            <style>
                <back_color>Silver</back_color>
                <fore_color>Black</fore_color>
                <border_color>Black</border_color>
                <padding>12</padding>
            </style>
            <widgets>
                <widget type="PROGRESSBAR" max="1000" min="0" value="500" show_text="False" 
                color="Green" back_color="White" fore_color="Black" height="39" align="Bottom" hyperlink="" />
            </widgets>
            <nodes>
                <node text="Source Code " width="200">
                    <widgets>
                        <widget type="PROGRESSBAR" max="10" min="0" value="20" show_text="False" 
                        color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                    </widgets>
                    <nodes>
                        <node text="Primary Module" width="100">
                            <widgets>
                                <widget type="PROGRESSBAR" max="100" min="0" value="50" show_text="False" 
                                color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                            </widgets>
                        </node>
                        <node text="Legacy Import" width="100">
                            <widgets>
                                <widget type="PROGRESSBAR" max="100" min="0" value="50" show_text="False" 
                                color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                            </widgets>
                        </node>
                    </nodes>
                </node>
                <node text="Unit Testing" width="200">
                    <widgets>
                        <widget type="PROGRESSBAR" max="100" min="0" value="50" show_text="False" 
                        color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                    </widgets>
                </node>
                <node text="Acceptance Testing" width="200">
                    <widgets>
                        <widget type="PROGRESSBAR" max="100" min="0" value="20" show_text="False" 
                        color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                    </widgets>
                </node>
                <node text="Usability Testing" width="200">
                    <widgets>
                        <widget type="PROGRESSBAR" max="100" min="0" value="5" show_text="False" 
                        color="Green" back_color="White" fore_color="Black" align="Bottom" hyperlink="" />
                    </widgets>
                </node>
            </nodes>
        </node>
    </nodes>
</map>

I am very new to XSL and am struggling, would I be better in AWK? The identity script looks useful to preserve the file structure. However I am at a lost trying to write the logic to change the values for progress. Instinct tells me if the file was parsed backwards it would be much easier!

Backwards:
1. For each new branch terminal – if a progress bar is detected keep a running total for @value and @max.
2. Assign this running total to any further progress bars until two branches converge.
3. At the convergence add the two sets of totals and continue.

As each node can have more than one progress bar it would be nice to repeat the calculations separately for each separate colour of progress bar found – a challenge to the XSL wizards out there!

I would be very grateful for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:29:42+00:00Added an answer on May 31, 2026 at 10:29 am

    This should do what I describe in my comment to your question:

    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
      <xsl:template match="@* | node()">
        <xsl:copy>
          <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
      </xsl:template>
    
      <xsl:template match="widget[@type='PROGRESSBAR']">
        <xsl:variable name="color" select="@color"/>
        <xsl:variable name="childProgressBars" select="../../nodes//widget[@type='PROGRESSBAR' and @color=$color and not(../../nodes//widget)]"/>
        <xsl:variable name="value">
          <xsl:choose>
            <xsl:when test="$childProgressBars">
              <xsl:value-of select="sum($childProgressBars/@value)"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@value"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="max">
          <xsl:choose>
            <xsl:when test="$childProgressBars">
              <xsl:value-of select="sum($childProgressBars/@max)"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@max"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <widget type="PROGRESSBAR" max="{$max}" min="{@min}" value="{$value}" show_text="{@showText}"
        color="{@color}" back_color="{@back_color}" fore_color="{@fore_color}" align="{@align}" hyperlink="{@hyperLink}" />
      </xsl:template>
    
    </xsl:stylesheet>
    

    I am assuming that widget element do not have children and that they can have only the attributes that are listed in your example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to modify the contents of an MSI file using Powershell. To do
I'm trying to modify the contents of one pointer using another. I want string2
I am trying to modify a table within a database, as follows: using (SqlCeCommand
I am trying to modify a value in an array using the C programming
We are trying to modify one of the XML files in 2007 MS Excel.
I'm trying to modify a line in PHP file that deals with data that
I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but
I'm trying to modify the class of an element if an ajax call based
I am trying to modify the output stream to search/replace some XHTML tags returned
I'm currently trying to modify some HttpWebRequest functions, but I can't do it through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.