#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    16
    Rep Power
    0

    How do i make my called template traverse the param passed in?


    My xml has mixed notation and I am trying to work around that and I am trying several things. what I am trying to do here is pass a paramater which should have a complete xml segment, if my other part works right, and I want this template to traverse the passed in param.

    My called template:

    Code:
    <xsl:template name="getXMLData">
    	<xsl:param name="newxml"/>
    	<xsl:for-each select="ns5:MessageResponse">
    		<xsl:for-each select="ncic:Message/cjis:HeaderSection">
    		<xsl:for-each select="cjis:TransactionHeaderText">
    		<xsl:apply-templates/>
    	</xsl:for-each>
    	<xsl:for-each select="cjis:TransactionOrganization/jxdm:OrganizationORIID/jxdm:ID">
    		<xsl:call-template name="nl_print"/>
    	</xsl:for-each>
    </xsl:for-each>
    </xsl:for-each>
    </xsl:template>
    The call to the template:
    Code:
    <xsl:when test="ns3:ResponseFormat='XML'">
    	<xsl:variable name="betterxml">
    		<xsl:value-of select ="ns5:MessageResponse" disable-output-escaping="yes"/>
    	</xsl:variable>
    	<xsl:call-template name="getXMLData">
    		<xsl:with-param name="newxml" select="$betterxml"/>
    	</xsl:call-template>
    </xsl:when>
    Last edited by requinix; June 12th, 2013 at 12:19 PM. Reason: formatting xml
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,185
    Rep Power
    9398
    When you post code, please copy/paste it into the text area, select it, and then hit the # button: the popup dialog will strip out newlines and the result is unreadable.


    1. "Mixed notation"? You mean the assorted namespaces?
    2. There's some extra </for-each>s in the template.
    3. What's the question?

IMN logo majestic logo threadwatch logo seochat tools logo