I am using Rmcobol v12 for Linux and we just purchased the xml extensions so I can work with XML files. I am trying to create an xml file with the attributes inside the main tags, so I am assuming I need to use a external stylesheet on my XML EXPORT statement. When I do it only prints the first line, and my attributes are blank. If I don't use the stylesheet then it creates the whole xml file with my data, but the attributes are not in the proper format. My stylesheet was generated on a website that converts an XML file to XSLT. If anyone has any ideas, I would very much appreciate it. I am new to using xml extensions.
xml file generated: (only get the first line)
<?xml version="1.0" encoding="UTF-8"?>
<asap:AccountServicesTransmission xmlns:asap="urn:us:gov:treas:fms:Payment:AccountAuthorization:2.1" CycleDate="" FileNumber="" TestIndicator="" TransmissionTimestamp=""/>
Stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:asap="urn:us:gov:treas:fms:Payment:AccountAuthorization:2.1" xmlns:xsl="">www.w3.org/.../Transform">
<xsl:template match="/">
<asap:AccountServicesTransmission>
<xsl:variable name="cycleDate" select="/asap:AccountServicesTransmission/@CycleDate"/>
<!-- The variable cycleDate can be used for further processing. -->
<xsl:attribute name="CycleDate"><xsl:value-of select="$cycleDate"/></xsl:attribute>
<xsl:attribute name="FileNumber"><xsl:value-of select="/asap:AccountServicesTransmission/@FileNumber"/></xsl:attribute>
<xsl:attribute name="TestIndicator"><xsl:value-of select="/asap:AccountServicesTransmission/@TestIndicator"/></xsl:attribute>
<xsl:attribute name="TransmissionTimestamp"><xsl:value-of select="/asap:AccountServicesTransmission/@TransmissionTimestamp"/></xsl:attribute>
<asap:CreateAuthorizationRequest>
<xsl:variable name="effectiveDate" select="/asap:AccountServicesTransmission/asap:CreateAuthorizationRequest/@EffectiveDate"/>
<!-- The variable effectiveDate can be used for further processing. -->
<xsl:attribute name="EffectiveDate"><xsl:value-of select="$effectiveDate"/></xsl:attribute>
<xsl:for-each select="/asap:AccountServicesTransmission/asap:CreateAuthorizationRequest/asap:AuthorizationRequest">
<asap:AuthorizationRequest>
<xsl:variable name="accountIdentifier" select="./@AccountIdentifier"/>
<!-- The variable accountIdentifier can be used for further processing. -->
<xsl:attribute name="AccountIdentifier"><xsl:value-of select="$accountIdentifier"/></xsl:attribute>
<xsl:attribute name="Amount"><xsl:value-of select="./@Amount"/></xsl:attribute>
<xsl:attribute name="IncreaseIndicator"><xsl:value-of select="./@IncreaseIndicator"/></xsl:attribute>
<asap:AgencyIdentifier>
<xsl:for-each select="./asap:AgencyIdentifier/asap:PrimaryAgencyIdentifier">
<asap:PrimaryAgencyIdentifier>
<xsl:value-of select="."/>
<xsl:variable name="agencyLocationCode" select="./@AgencyLocationCode"/>
<!-- The variable agencyLocationCode can be used for further processing. -->
<xsl:attribute name="AgencyLocationCode"><xsl:value-of select="$agencyLocationCode"/></xsl:attribute>
</asap:PrimaryAgencyIdentifier>
</xsl:for-each>
</asap:AgencyIdentifier>
<asap:RecipientIdentifier>
<xsl:value-of select="./asap:RecipientIdentifier"/>
<xsl:variable name="recipientIdentifier" select="./asap:RecipientIdentifier/@RecipientIdentifier"/>
<!-- The variable recipientIdentifier can be used for further processing. -->
<xsl:attribute name="RecipientIdentifier"><xsl:value-of select="$recipientIdentifier"/></xsl:attribute>
</asap:RecipientIdentifier>
</asap:AuthorizationRequest>
</xsl:for-each>
</asap:CreateAuthorizationRequest>
</asap:AccountServicesTransmission>
</xsl:template>
</xsl:stylesheet>