[Home] [By Thread] [By Date] [Recent Entries]
I'm trying to do something like this now:
<xsl:variable name="PROERPTIES">
<xsl:if test="$RUNWITH='XML'">
<xsl:value-of select="/j:map/j:map[@key='properties']"/>
</xsl:if>
<xsl:if test="$RUNWITH='JSON'">
<xsl:value-of select="json-to-xml(., map { 'escape' : true()
})/j:map/j:map[@key='properties']"/>
</xsl:if></xsl:variable> In the main XSLT I do this <xsl:param name="RUNWITH" select="JSON"/> and the included XSLT <xsl:param name="RUNWITH" select="XML"/> But this is giving me a Duplicate global variable error. I tried to use the json-to-xml() function to act as a test for the type of content being processed and that throws an error when called with an XML file. Is there some way I can determine the format of the file being processed from the commandline so I can do the right thing here? I've also tried modifying the place where I use the variable, currently like this <xsl:value-of select="$PROPERTIES/j:map[@key=$ID]/j:string[@key='displayName']"/> I tried changing this to find the content directly without the variable to this: <xsl:value-of select="ancestoer::j:map[@key='properties']/j:map[@key=$ID]/j:string[@key='displayName']"/> But I get a message about not having context and will never produce a value. ..dan On 2025-03-14 10:20, dvint@xxxxxxxxx wrote: In trying to build a small sample I have found where the problem is coming from. It looks like this might be a timing issue of when the stylesheet is read vs when the json-to-sml() file is triggered and that XML becomes available to evaluate.
|

Cart



