[Framers] Another Simple Structured App

rick at rickquatro.com rick at rickquatro.com
Thu Apr 7 14:11:04 PDT 2022


Here is an example. Input:

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

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="@* except @String except
@ClassDescription"/>
            <String>{@String}</String>
            <ClassDescription>{@ClassDescription}</ClassDescription>
        </xsl:copy>
    </xsl:template>
    
</xsl:stylesheet>

Output:

<?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>

-----Original Message-----
From: Framers <framers-bounces+rick=rickquatro.com at lists.frameusers.com> On
Behalf Of cuc tu
Sent: Thursday, April 7, 2022 3:12 PM
To: framers at lists.frameusers.com
Subject: Re: [Framers] Another Simple Structured App

Hi All, I'm not sure how to share the file contents wit the group here.

Simple question is how to break attribute values out into separate
paragraphs?

The XML element:

<ScpiCommand ClassName = "IPAddress" ClassLongName = "IP Address"
    ClassDescription = "Outputs the IP address of the Ethernet interface."
    String = ":SYSTem:COMMunicate:TCP:IP:ADDRess" Overlapping = "false"
    Lockable = "false" Type = "Query">

My EDD for the element:

Element (Container):  ScpiCommand
General rule:
Suffixes*&CommandParameters*&QueryResultParameters*&QueryParameters*&Example
s
Attribute list
Name: ClassName String Optional
Name: ClassLongName String Optional
Name: ClassDescription String Optional
Name: String String Optional
Name: Overlapping String Optional
Name: Lockable String Optional
Name: Type String Optional
Format rules for first paragraph in element In all contexts.
Use paragraph format: SCPICommand
Text format rules
In all contexts.
Use paragraph format: Indented
Format rules for last paragraph in element In all contexts.
Use paragraph format: Indented
Prefix rules
In all contexts.
Prefix: <$attribute[String]> <$attribute[ClassDescription]>


The result comes out as a run-together paragraph using the SCPICommand
paraformat. I am just wanting to print the String and ClassDescription
attribute values.

Thanks C2

_______________________________________________

This message is from the Framers mailing list

Send messages to framers at lists.frameusers.com 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 listadmin at frameusers.com



More information about the Framers mailing list