Hello, I am wondering/ having a problem figuring out formatting in XSLT.
I have this XSL
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8" indent="no" />
<!-- MasterClip Vars -->
<xsl:variable name="fields" select="'|clip_description|episode_no|rushes_roll_number|source_image_format|technical_comments|broadcast_time|first_broadcast_channel|Keywords|original_transmission_date|episode_title|contributor'" />
<!--Global-->
<xsl:template match="Global">
<Global>
<xsl:apply-templates />
</Global>
</xsl:template>
<xsl:template match="GlobalParam">
<GlobalParam>
<xsl:attribute name="name">
<xsl:value-of select="@name" />
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="@value" />
</xsl:attribute>
</GlobalParam>
</xsl:template>
<!---Roll-->
<xsl:template match="Roll">
<xsl:copy/>
</xsl:template>
<!--MasterClip -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
<xsl:text>
</xsl:text>
</xsl:copy>
</xsl:template>
<xsl:template match="MasterClip">
<xsl:copy>
<xsl:apply-templates select="*[contains($fields, concat('|', @name, '|'))]" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
And it gives me the correct output , but if you can see....
Code:
<FileImport>
<Global>
<GlobalParam name="RollName" value="Scene_Around_Six_Tape_3_BUFVC003-14 10:00:00:00" />
<GlobalParam name="TapeOrg" value="10:00:00:00" />
<GlobalParam name="ReadStart" value="00:00:00:00" />
<GlobalParam name="ReadDuration" value="00:02:26:18" />
</Global>
<Roll />
<MasterClip><Field name="clip_description" value="Interview Captain Austin Ardill re Terence O'Neill" group="Ingest">
</Field><Field name="rushes_roll_number" value="" group="Ingest">
</Field><Field name="source_image_format" value="" group="Ingest">
</Field><Field name="technical_comments" value="" group="Ingest">
</Field><Field name="broadcast_time" value="18:00" group="">
</Field><Field name="first_broadcast_channel" value="" group="">
</Field><Field name="original_transmission_date" value="27/01/1969 00:00:00" group="">
</Field><Field name="episode_title" value="Scene_Around_Six_27_01_1969" group="News Archive">
</Field></MasterClip>
</FileImport>
In my output for MasterClip it starts directly with the next tag e.g <MasterClip><Field name= .... And ends " </Field></MasterClip>" On the same line , the root element end tag also gets indented , what i would like is that the MasterClip tags start and end on their own line and that the </FileImport> tag has no indentation.
I have tried a few different ways but with no success . If possible could you help me and provide an explanation , maybe common tips/tricks to keep me right. Thank you for your time.