Hi,
Are you planning to do this by means of an XSLT transformation?
You seem to be calling everything a "tag", but some are attributes or attribute values. A tag usually refers to an element.
You have to learn a bit of the XML technology and its terminology before starting to use it. Without the terminology it is difficult to understand the means you plan to use and the desired result. I did get part of what is the desired result, but that is just a piece of the result that you are describing. Provide a broader input and output (desired result), not just a single entry.
This is the programmer's approach to XSLT (via xsl:for-each):
Code: Select all
<xsl:template match="/">
<outroot>
<xsl:for-each select="//App_Data[@Name = 'Episode_Number']">
<input Episode_Number="{@Value}" Provider_ID="epix.com">
<Season_Number>
<xsl:value-of select="substring(@Value, 1, 1)"/>
</Season_Number>
</input>
</xsl:for-each>
</outroot>
</xsl:template>
This code assumes you have multiple "App_Data" elements and each useful one has the attribute
Name = 'Episode_Number'. Assuming the output is still XML, you need a single root element. So, this code adds an "outroot" root element/tag for the output that surrounds all the "input" elements.
This outputs something like this:
Code: Select all
<outroot>
<input Episode_Number="303" Provider_ID="epix.com">
<Season_Number>3</Season_Number>
</input>
<input Episode_Number="405" Provider_ID="epix.com">
<Season_Number>4</Season_Number>
</input>
...
</outroot>
Regards,
Adrian