Skip to content

xslt - change multiple network parameters not working #1145

Open
@mvrk69

Description

@mvrk69

Hi,

I have xml file to make specific changes during creation of a VM:

  • Enable boot menu
  • Change network interface of type dummy-lan to ovs portgroup lan
  • Change network interface of type dummy-vlan3 to ovs portgroup vlan3

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@">
xsl:copy
<xsl:apply-templates select="node()|@
"/>
</xsl:copy>
</xsl:template>

<xsl:template match="/domain/os">
xsl:copy
<xsl:apply-templates select="node()|@*"/>
<xsl:element name ="bootmenu">
<xsl:attribute name="enable">yes</xsl:attribute>
</xsl:element>
</xsl:copy>
</xsl:template>

<xsl:template match="/domain/devices/interface[@type='network']/source[@network='dummy-lan']/@*">
<xsl:attribute name="network">
<xsl:value-of select="'ovs'"/>
</xsl:attribute>
<xsl:attribute name="portgroup">
<xsl:value-of select="'lan'"/>
</xsl:attribute>
</xsl:template>

<xsl:template match="/domain/devices/interface[@type='network']/source[@network='dummy-vlan3']/@*">
<xsl:attribute name="network">
<xsl:value-of select="'ovs'"/>
</xsl:attribute>
<xsl:attribute name="portgroup">
<xsl:value-of select="'vlan3'"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>

First 2 changes are applied but the last one is not being applied.

Anyone has any idea what might be the issue?

Anyway i can debug this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions