I want help in getting a value from one xml into another using xsl, i have the following xml:
<metadata>
<idinfo>Node Text</idinfo>
</metadata>
and i have a general xsl to display the nodes like:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dmd="http://www.digitalmeasures.com/schema/data-metadata"
xmlns:dm="http://www.digitalmeasures.com/schema/data">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="*[(child::*)]">
<fieldset>
<legend><xsl:value-of select="local-name()"/></legend>
<xsl:apply-templates/>
</fieldset>
</xsl:template>
<xsl:template match="*[not(child::*)]">
<strong><xsl:value-of select="local-name()"/></strong>
<i><xsl:apply-templates/></i>
</xsl:template>
</xsl:stylesheet>
And the output will be:
<fieldset>
<legend>metadata</legend>
<strong>idinfo</strong><i>Node Text</i>
</fieldset>
Now what I want is replacing node names by another xml, so i want to replace idinfo by Identification Information
The xml which I ant to use is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<labels>
<element name="idinfo">
<label>Identification Information</label>
</element>
</label>
I hope that my question is clear.
first, setup your reference table like:
And then use it like:
in case it doesn’t work (and I heard reports on that), use a variable: