Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add (County Court) text after a string value? 1

Status
Not open for further replies.

momo2000

Programmer
Jan 2, 2015
63
0
0
US
I would like to add County Court after the string value for the court name. In my xsl I am using a variable vCourtORI to get the court name in the referring xml document. I need to add County Court after the Text on this line

XML:
<xsl:value-of select="$values[@type='CountyName']/Text"/>

How do I do this. My xslt is displaying the Court Name but I want to add County Court after the name.

Desired output

XML:
<nc:OrganizationName>Ramsey County Court</nc:OrganizationName>

Current output

XML:
<nc:OrganizationName>Ramsey</nc:OrganizationName>

sample xml document
XML:
xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67084429" xmlns="">
    <Case InternalID="1616099249" ID="10475952" xmlns:user="[URL unfurl="true"]http://tylertechnologies.com">[/URL]
        <Court>
            <CourtName>Ramsey Criminal Suburban</CourtName>
            <CourtNCIC>MN062105J</CourtNCIC>
        </Court>
</Integration>

Refering xm document for the Court name using CourtNCIC number
XML:
<EnumerationValue code="MN062105J">
    <Text>Ramsey Criminal Suburban</Text>
    <AssociatedValue type="CountyName">
      <Text>Ramsey</Text>
    </AssociatedValue>
</EnumerationValue>

xsl code
Code:
<xsl:template name="Court">
<Court>
<nc:StreetFullText>
    <xsl:variable name="vCourtORI">
        <xsl:value-of select="/Integration/Case/Court/CourtNCIC"/>
    </xsl:variable>
    <xsl:variable name="values" select="document(concat($gEnvPath,'\Schemas\CourtXML\SimpleTypes\CourtLocationTextType.xml'))/SimpleTypeCompanion/EnumerationValue[@code=$vCourtORI]/AssociatedValue"/>
        <xsl:value-of select="$values[@type='CountyName']/Text"/> 
</nc:StreetFullText>
</Court>
</xsl:template>
 
Code:
<xsl:value-of select="concat($values[@type='CountyName']/Text,' County Court')"/>

[sup]Typed, not tested.[/sup]

XPath Functions Reference

Tom Morrison
Hill Country Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top