U
UpgradeMyBrain
Hi.
Does anyone know how to take an input XML file, extract just a section
of the element name and generate a new element name with part of that
name? Example:
Input file contains:
<Names>
<Name_is_John>
<DOB>11/12/1995</DOB>
<Residence>New York City</Residence>
</Name_is_John>
<Name_is_Jane_Bloggs>
<DOB>11/20/1995</DOB>
<Residence>Boston</Residence>
<Name_is_Jane_Bloggs>
</Names>
The output should look like:
<Names>
<John>
<DOB>11/12/1995</DOB>
<Residence>New York City</Residence>
</John>
<Jane_Bloggs>
<DOB>11/20/1995</DOB>
<Residence>Boston</Residence>
<Jane_Bloggs>
</Names>
To generate the correct element names, I've tried using a command like:
<xsl:element name="substring-after('.','Name_is')" />
Actually, I've not tried it with a node argument, because I'm just
trying to get the function to work with a regular ol' string. When
trying to generate output, I get an error. The idea is to take data
with arbitrary names that will all be prefixed in a precise way and
strip out that prefix. Any ideas?
Thanks!
Does anyone know how to take an input XML file, extract just a section
of the element name and generate a new element name with part of that
name? Example:
Input file contains:
<Names>
<Name_is_John>
<DOB>11/12/1995</DOB>
<Residence>New York City</Residence>
</Name_is_John>
<Name_is_Jane_Bloggs>
<DOB>11/20/1995</DOB>
<Residence>Boston</Residence>
<Name_is_Jane_Bloggs>
</Names>
The output should look like:
<Names>
<John>
<DOB>11/12/1995</DOB>
<Residence>New York City</Residence>
</John>
<Jane_Bloggs>
<DOB>11/20/1995</DOB>
<Residence>Boston</Residence>
<Jane_Bloggs>
</Names>
To generate the correct element names, I've tried using a command like:
<xsl:element name="substring-after('.','Name_is')" />
Actually, I've not tried it with a node argument, because I'm just
trying to get the function to work with a regular ol' string. When
trying to generate output, I get an error. The idea is to take data
with arbitrary names that will all be prefixed in a precise way and
strip out that prefix. Any ideas?
Thanks!