Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 2nd, 2007, 02:11 PM
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Modifiying XML File using XSLT

Ok guys, I have an XML file that needs slight customizations done to it. I was planning on using XSLT to preform the modifications to the file based off a XSL sheet. I am running into difficulty preforming the "merge" of changes to the orginal... Here is an example of what I am talking about.

File 1:

Code:
<local:MainPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:GSAppPOS" xmlns:src="clr-namespace:GSAppPOS" mc:Ignorable="d" x:Class="GSAppPOS.SignOn" x:Uid="Page_1" Loaded="OnLoaded" KeyUp="OnKeyUp" Width="1024" Height="646" Background="#FFFFFFFF">
  <local:MainPage.Resources>
    <Style x:Key="ButtonEnterStyle" x:Uid="Style_4" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_7" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_4" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_4">
              <Image x:Uid="Image_4" Source="Enter.jpg" Stretch="Fill" />
              <ContentPresenter x:Uid="ContentPresenter_4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger x:Uid="Trigger_19" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_20" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_21" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_22" Property="IsPressed" Value="True" />
              <Trigger x:Uid="Trigger_23" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="BigButton" x:Uid="Style_7" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_12" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_7" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_7">
              <Image x:Uid="Image_7" Source="button_up.png" Stretch="Fill" x:Name="image" />
              <ContentPresenter x:Uid="ContentPresenter_7" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Left" RecognizesAccessKey="True" Margin="49,24.454,0,0" VerticalAlignment="Top" Width="125.247" Height="21.4" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_36" Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_37" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_38" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_39" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_40" Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="button_down.png" />
              </Trigger>
              <Trigger x:Uid="Trigger_41" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Focusable" Value="False" />
    </Style>
    <Style x:Key="HelpButton" x:Uid="Style_9" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_15" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_9" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_9">
              <Image x:Uid="Image_9" Source="help_up.png" Stretch="Fill" x:Name="image" />
              <ContentPresenter x:Uid="ContentPresenter_9" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_47" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_48" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_49" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_50" Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="help_down.png" />
              </Trigger>
              <Trigger x:Uid="Trigger_51" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Focusable" Value="False" />
    </Style>
    <Style x:Key="ButtonBigEnter" x:Uid="Style_10" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_16" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_10" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_10">
              <Viewbox x:Uid="Viewbox_1" Stretch="Fill">
                <Grid x:Uid="Grid_11" Width="144.459" Height="115.342">
                  <Image x:Uid="Image_10" HorizontalAlignment="Left" Width="47.159" Source="BigEnterLeft.png" Stretch="Fill" />
                  <Image x:Uid="Image_11" Margin="46.159,0,0,0" Source="BigEnterRight.png" Stretch="Fill" />
                </Grid>
              </Viewbox>
              <ContentPresenter x:Uid="ContentPresenter_10" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="112.367" Height="116.714" RecognizesAccessKey="True" RenderTransformOrigin="0.5,0.5">
                <ContentPresenter.RenderTransform>
                  <TransformGroup x:Uid="TransformGroup_2">
                    <ScaleTransform x:Uid="ScaleTransform_2" ScaleX="1" ScaleY="1" />
                    <SkewTransform x:Uid="SkewTransform_2" AngleX="-0.483" AngleY="0" />
                    <RotateTransform x:Uid="RotateTransform_2" Angle="0" />
                    <TranslateTransform x:Uid="TranslateTransform_2" X="0.492" Y="0" />
                  </TransformGroup>
                </ContentPresenter.RenderTransform>
              </ContentPresenter>
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger x:Uid="Trigger_52" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_53" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_54" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_55" Property="IsPressed" Value="True" />
              <Trigger x:Uid="Trigger_56" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="ControlStyle1" x:Uid="Style_11" TargetType="{x:Type Control}" />
    <Style x:Key="mail" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image Cursor="Hand" x:Name="image" Source="mail_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="mail_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="desk" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="desk_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="desk_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="giftCard" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="giftCard_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="giftCard_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="creditCard" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="creditCard_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="creditCard_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </local:MainPage.Resources>
  <Grid x:Uid="Grid_13" x:Name="LayoutRoot" Width="1024" Height="646">
    <Grid Margin="1,1.269,0,0" x:Name="Main_Grid" Width="1024" Height="646">
      <Image x:Uid="Image_16" x:Name="imgWhiteBg" Source="background_area.png" Stretch="Fill" HorizontalAlignment="Left" Margin="0,-6,0,0" VerticalAlignment="Top" Width="Auto" Height="603.138" />
      <Rectangle x:Uid="Rectangle_3" Fill="#FF393C4B" Stroke="{x:Null}" RadiusX="12.324" RadiusY="12.324" x:Name="rectKeyboardBg" Margin="34.708,283.152,33,78.279" />
      <StackPanel Orientation="Horizontal" x:Name="Keyboard_StackPanel" Height="Auto" Panel.ZIndex="0" Margin="52,283.152,31.884,78.279">
        <local:KeyboardControl />
        <Label FontFamily="Arial" FontSize="18" Content=" " />
        <local:NumberPadControl />
      </StackPanel>
      <StackPanel Margin="40,22,8,0" x:Name="LoginDetails_StackPanel" VerticalAlignment="Top" Height="Auto" Orientation="Horizontal">
        <Grid x:Name="Ad_Grid" Width="279.9" Height="247.412">
          <Image x:Uid="Image_25" x:Name="imgAd" Stretch="Fill" Source="Ad.png" />
        </Grid>
        <Grid Margin="10,0,10,0" x:Name="MainLogin_Grid" Width="471.471" Height="252.022">
          <Grid Margin="0.471,98.87,0.011,0" x:Name="LoginDetails_Grid">
            <Image x:Uid="Image_21" x:Name="imgOuterTextBar" Source="imgOuterTextBar.png" Stretch="Fill" />
            <Image x:Uid="Image_22" x:Name="imgOperatorID" Source="imgOperatorID.png" Stretch="Fill" Margin="180.845,26.378,8.823,0" VerticalAlignment="Top" Height="47.623" />
            <Image x:Uid="Image_23" x:Name="imgPassword" Height="47.623" Source="imgPassword.png" Stretch="Fill" Margin="180.845,0,7.823,21.761" VerticalAlignment="Bottom" />
            <TextBox x:Uid="TextBox_2" x:Name="ST_SIGNON_OperatorID" Height="24.665" BorderThickness="0,0,0,0" Text="" TextWrapping="Wrap" FontSize="14" RenderTransformOrigin="0.5,0.5" Margin="193.846,39.658,26.528,0" VerticalAlignment="Top">
              <TextBox.RenderTransform>
                <TransformGroup>
                  <ScaleTransform ScaleX="1" ScaleY="1" />
                  <SkewTransform AngleX="0" AngleY="0" />
                  <RotateTransform Angle="0" />
                  <TranslateTransform X="0" Y="1" />
                </TransformGroup>
              </TextBox.RenderTransform>
            </TextBox>
            <PasswordBox x:Uid="PasswordBox_1" Height="20.779" Background="{x:Null}" BorderThickness="0,0,0,0" FontSize="14" x:Name="ST_SIGNON_Password" Margin="197.846,0,26.528,33.421" VerticalAlignment="Bottom" />
            <Label x:Uid="Label_2" Height="28.665" Content="Password" FontFamily="Arial" FontSize="18" FontWeight="Bold" RenderTransformOrigin="0.489,0.557" x:Name="lblPassword" HorizontalAlignment="Left" Margin="11.297,0,0,33.421" VerticalAlignment="Bottom" Width="120.001" />
            <Label x:Uid="Label_3" x:Name="lblOperatorID" Height="28.665" Content="Operator ID" FontFamily="Arial" FontSize="18" FontWeight="Bold" HorizontalAlignment="Left" Margin="11.297,33.658,0,0" VerticalAlignment="Top" Width="120.001" />
          </Grid>
          <Grid x:Name="MessageDetails_Grid" VerticalAlignment="Top" Height="92.892">
            <Image x:Uid="Image_24" x:Name="imgUpperBar" Source="imgUpperBar.png" Stretch="Fill" />
            <Label x:Name="lblInstructionMessage" Content="" Margin="12.292,12.125,15.179,11.767" FontFamily="Arial" FontSize="16" />
          </Grid>
        </Grid>
        <Grid x:Name="Buttons_Grid" Width="178.563" Height="Auto" HorizontalAlignment="Right">
          <Button x:Uid="Button_1" OpacityMask="{x:Null}" x:Name="btnClockIn" Style="{DynamicResource BigButton}" Height="59.308" Content="(F3) Clock In" BorderBrush="#FF000000" FontFamily="Arial" FontSize="16" FontWeight="Normal" Foreground="#FFFFFFFF" Tag="ClockIn" Margin="0.219,63.857,1,0" VerticalAlignment="Top" />
          <Image x:Uid="Image_17" x:Name="imgClock" Width="39.993" Height="31.693" Source="clock_in.png" Stretch="Fill" RenderTransformOrigin="0.45,0.442" HorizontalAlignment="Left" Margin="7.219,78.856,0,0" VerticalAlignment="Top" />
          <Button x:Uid="Button_2" x:Name="btnClockOut" Style="{DynamicResource BigButton}" Height="60.99" Content="(F4) Clock Out" FontFamily="Arial" FontSize="16" Foreground="#FFFFFFFF" Click="OnClick" Tag="PriceCheck" Margin="0,0,0,64.162" VerticalAlignment="Bottom" />
          <Button x:Uid="Button_3" x:Name="btnPriceCheck" Style="{DynamicResource BigButton}" Height="61.333" Content="(F5) Price Check" FontFamily="Arial" FontSize="16" Foreground="#FFFFFFFF" Click="OnClick" Tag="Admin" Margin="0.219,0,1,0" VerticalAlignment="Bottom" />
          <Button x:Uid="Button_4" Style="{DynamicResource BigButton}" Height="59.521" Content="(F2) Log In" Background="#FFFFFFFF" BorderBrush="#00FFFFFF" FontFamily="Arial" FontSize="16" Foreground="#FFFFFFFF" x:Name="btnLogIn" Click="OnClick" Tag="EnterKey" Margin="0,0,1,0" VerticalAlignment="Top" />
          <Image x:Uid="Image_20" x:Name="imgLock" Width="20.531" Height="24.779" Source="lock.png" Stretch="Fill" HorizontalAlignment="Left" Margin="10.003,17.742,0,0" VerticalAlignment="Top" />
          <Image x:Uid="Image_18" x:Name="imgPriceCheck" Width="30.064" Height="29.438" Source="price_check.png" Stretch="Fill" HorizontalAlignment="Left" Margin="9.219,0,0,13.714" VerticalAlignment="Bottom" />
          <Image x:Uid="Image_17" x:Name="imgClockOut" Width="39.993" Source="clock_in.png" Stretch="Fill" RenderTransformOrigin="0.45,0.442" HorizontalAlignment="Left" Margin="7,139,0,0" VerticalAlignment="Top" Height="31.693" />
        </Grid>
      </StackPanel>
      <Image x:Uid="Image_14" x:Name="imgMsgBar" Source="messageBox.png" Stretch="Fill" Margin="0,0,0.109,0" VerticalAlignment="Bottom" Height="47.593" />
      <TextBox x:Uid="TextBox_1" BorderThickness="0,0,0,0" FontFamily="Arial" FontSize="18" FontWeight="Normal" Text="" TextWrapping="Wrap" x:Name="txtBottomMessage" Focusable="False" Margin="22,0,33,9.593" VerticalAlignment="Bottom" Height="24" />
    </Grid>
  </Grid>
  <Grid>
    <Grid>
      <StackPanel>
        <Grid>
          <Image x:Uid="Image_25" x:Name="imgAd" Stretch="Fill" Source="Ad2.png" />
        </Grid>
      </StackPanel>
    </Grid>
  </Grid>
</local:MainPage>
I will only paste down to the line that I want to change for this example...


Code:
<local:MainPage xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:GSAppPOS" xmlns:src="clr-namespace:GSAppPOS" mc:Ignorable="d" x:Class="GSAppPOS.SignOn" x:Uid="Page_1" Loaded="OnLoaded" KeyUp="OnKeyUp" Width="1024" Height="646" Background="#FFFFFFFF">
  <local:MainPage.Resources>
    <Style x:Key="ButtonEnterStyle" x:Uid="Style_4" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_7" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_4" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_4">
              <Image x:Uid="Image_4" Source="Enter.jpg" Stretch="Fill" />
              <ContentPresenter x:Uid="ContentPresenter_4" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger x:Uid="Trigger_19" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_20" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_21" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_22" Property="IsPressed" Value="True" />
              <Trigger x:Uid="Trigger_23" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="BigButton" x:Uid="Style_7" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_12" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_7" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_7">
              <Image x:Uid="Image_7" Source="button_up.png" Stretch="Fill" x:Name="image" />
              <ContentPresenter x:Uid="ContentPresenter_7" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Left" RecognizesAccessKey="True" Margin="49,24.454,0,0" VerticalAlignment="Top" Width="125.247" Height="21.4" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_36" Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_37" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_38" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_39" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_40" Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="button_down.png" />
              </Trigger>
              <Trigger x:Uid="Trigger_41" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Focusable" Value="False" />
    </Style>
    <Style x:Key="HelpButton" x:Uid="Style_9" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_15" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_9" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_9">
              <Image x:Uid="Image_9" Source="help_up.png" Stretch="Fill" x:Name="image" />
              <ContentPresenter x:Uid="ContentPresenter_9" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="MinWidth" Value="0" />
              <Trigger x:Uid="Trigger_47" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_48" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_49" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_50" Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="help_down.png" />
              </Trigger>
              <Trigger x:Uid="Trigger_51" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Focusable" Value="False" />
    </Style>
    <Style x:Key="ButtonBigEnter" x:Uid="Style_10" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter x:Uid="Setter_16" Property="Template">
        <Setter.Value>
          <ControlTemplate x:Uid="ControlTemplate_10" TargetType="{x:Type Button}">
            <Grid x:Uid="Grid_10">
              <Viewbox x:Uid="Viewbox_1" Stretch="Fill">
                <Grid x:Uid="Grid_11" Width="144.459" Height="115.342">
                  <Image x:Uid="Image_10" HorizontalAlignment="Left" Width="47.159" Source="BigEnterLeft.png" Stretch="Fill" />
                  <Image x:Uid="Image_11" Margin="46.159,0,0,0" Source="BigEnterRight.png" Stretch="Fill" />
                </Grid>
              </Viewbox>
              <ContentPresenter x:Uid="ContentPresenter_10" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Width="112.367" Height="116.714" RecognizesAccessKey="True" RenderTransformOrigin="0.5,0.5">
                <ContentPresenter.RenderTransform>
                  <TransformGroup x:Uid="TransformGroup_2">
                    <ScaleTransform x:Uid="ScaleTransform_2" ScaleX="1" ScaleY="1" />
                    <SkewTransform x:Uid="SkewTransform_2" AngleX="-0.483" AngleY="0" />
                    <RotateTransform x:Uid="RotateTransform_2" Angle="0" />
                    <TranslateTransform x:Uid="TranslateTransform_2" X="0.492" Y="0" />
                  </TransformGroup>
                </ContentPresenter.RenderTransform>
              </ContentPresenter>
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger x:Uid="Trigger_52" Property="IsFocused" Value="True" />
              <Trigger x:Uid="Trigger_53" Property="IsDefaulted" Value="True" />
              <Trigger x:Uid="Trigger_54" Property="IsMouseOver" Value="True" />
              <Trigger x:Uid="Trigger_55" Property="IsPressed" Value="True" />
              <Trigger x:Uid="Trigger_56" Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="ControlStyle1" x:Uid="Style_11" TargetType="{x:Type Control}" />
    <Style x:Key="mail" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image Cursor="Hand" x:Name="image" Source="mail_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="mail_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="desk" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="desk_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="desk_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="giftCard" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="giftCard_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="giftCard_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="creditCard" BasedOn="{x:Null}" TargetType="{x:Type Button}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type Button}">
            <Grid>
              <Image x:Name="image" Source="creditCard_up.png" Stretch="Fill" />
              <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" />
            </Grid>
            <ControlTemplate.Triggers>
              <Trigger Property="IsFocused" Value="True" />
              <Trigger Property="IsDefaulted" Value="True" />
              <Trigger Property="IsPressed" Value="True">
                <Setter Property="Source" TargetName="image" Value="creditCard_down.png" />
              </Trigger>
              <Trigger Property="IsPressed" Value="True" />
              <Trigger Property="IsEnabled" Value="False" />
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </local:MainPage.Resources>
  <Grid x:Uid="Grid_13" x:Name="LayoutRoot" Width="1024" Height="646">
    <Grid Margin="1,1.269,0,0" x:Name="Main_Grid" Width="1024" Height="646">
      <Image x:Uid="Image_16" x:Name="imgWhiteBg" Source="background_area.png" Stretch="Fill" HorizontalAlignment="Left" Margin="0,-6,0,0" VerticalAlignment="Top" Width="Auto" Height="603.138" />
      <Rectangle x:Uid="Rectangle_3" Fill="#FF393C4B" Stroke="{x:Null}" RadiusX="12.324" RadiusY="12.324" x:Name="rectKeyboardBg" Margin="34.708,283.152,33,78.279" />
      <StackPanel Orientation="Horizontal" x:Name="Keyboard_StackPanel" Height="Auto" Panel.ZIndex="0" Margin="52,283.152,31.884,78.279">
        <local:KeyboardControl />
        <Label FontFamily="Arial" FontSize="18" Content=" " />
        <local:NumberPadControl />
      </StackPanel>
      <StackPanel Margin="40,22,8,0" x:Name="LoginDetails_StackPanel" VerticalAlignment="Top" Height="Auto" Orientation="Horizontal">
        <Grid x:Name="Ad_Grid" Width="279.9" Height="247.412">
          <Image x:Uid="Image_25" x:Name="imgAd" Stretch="Fill" Source="Ad2.png" />


The change I want to make is the filename to the image "Source=Ad2.png". Just simply changing the filename. Is there a easy way to change this line or parameter using XSLT?

 
Old October 2nd, 2007, 03:14 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I was going to reply that no-one is going to wade through this mass of data, you need to simplify the problem. But I think I don't need to wade through the mass of data, you're just looking for the standard coding pattern where you define an identity template that matches everything:

<xsl:template match="*">
  <xsl:copy><xsl:copy-of select="@*"/><xsl:apply-templates/></xsl:copy>
</xsl:template>

and then another rule that matches the elements you want to change:

<xsl:template match="image[@Source='Ad.png]">
  <image Source="sssssss">
    <xsl:apply-templates/>
  </image>
</xsl:template>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
importing XML file in to xslt ashyabhi_hp XSLT 2 September 22nd, 2007 11:15 PM
Transforming XML data in an ASP file using XSLT hussainm Classic ASP XML 0 May 31st, 2006 03:21 PM
translate xml using xslt in a batch file? hhali XSLT 3 May 8th, 2005 12:48 PM
merge two xml file and make new xml using xslt ketan XSLT 0 September 21st, 2004 08:48 AM
Merge XML files into a xml file using xslt lxu XML 4 November 6th, 2003 06:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.