You can also go in the other direction. Input:

<?xml version="1.0" encoding="UTF-8"?>
<ScpiCommand ClassName="IPAddress"
             ClassLongName="IP Address"
             Overlapping="false"
             Lockable="false"
             Type="Query">
   <String>:SYSTem:COMMunicate:TCP:IP:ADDRess</String>
   <ClassDescription>Outputs the IP address of the Ethernet
interface.</ClassDescription>
</ScpiCommand>

XSLT stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:xs="http://www.w3.org/2001/XMLSchema";
    xmlns:math="http://www.w3.org/2005/xpath-functions/math";
    exclude-result-prefixes="xs math"
    version="3.0" expand-text="yes">
    
    <xsl:output indent="yes"/>
    
    <xsl:template match="/ScpiCommand">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:attribute name="String" select="String"/>
            <xsl:attribute name="ClassDescription"
select="ClassDescription"/>
        </xsl:copy>
    </xsl:template>
    
</xsl:stylesheet>

Output (same as your original input):

<?xml version="1.0" encoding="UTF-8"?>
<ScpiCommand ClassName="IPAddress"
             ClassLongName="IP Address"
             Overlapping="false"
             Lockable="false"
             Type="Query"
             String=":SYSTem:COMMunicate:TCP:IP:ADDRess"
             ClassDescription="Outputs the IP address of the Ethernet
interface."/>


_______________________________________________

This message is from the Framers mailing list

Send messages to [email protected]
Visit the list's homepage at  http://www.frameusers.com
Archives located at http://www.mail-archive.com/framers%40lists.frameusers.com/
Subscribe and unsubscribe at 
http://lists.frameusers.com/listinfo.cgi/framers-frameusers.com
Send administrative questions to [email protected]

Reply via email to