Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:36:43+00:00 2026-05-23T11:36:43+00:00

I have a question regarding XML translations , I have an XML that I

  • 0

I have a question regarding XML translations , I have an XML that I translate to another XML .
My xls is pretty straightforward , just taking the fields I want . What I notice though is that if for example I have 1 , 2 ,3 ,4 and in my xsl I just decide i want 1,3 that 2 will come with it as well. I believe I read about xsl going by default rules and such so:…

Do I need to create a rule for each tag, even the ones I don’t want?.
How do I handle ones I do not want ?. ( I tried a few things but it still outputs it).
Is there any tutorials or good pages on straight XML 2 XML translations?.

All insight is great, I am away to google more.

Thanks.

This is my XSL as it currently stands without the Match Filter on:

<?xml version="1.0" encoding="windows-1252"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output indent="yes" method="xml" />

    <!--FileImport-->

    <xsl:template match="FileImport">
        <FileImport>
            <xsl:apply-templates />
        </FileImport>
    </xsl:template>

    <!--Start-->
    <xsl:template match="Start">
        <Start>
            <xsl:apply-templates />
        </Start>
    </xsl:template>

    <xsl:template match="StartParam">
        <StartParam>
            <xsl:attribute name="name">
                <xsl:value-of select="@name" />
            </xsl:attribute>
            <xsl:attribute name="value">
                <xsl:value-of select="@value" />
            </xsl:attribute>
        </StartParam>
    </xsl:template>


    <!-- CLip -->
    <xsl:variable name="fields" select="'|clip|number|technical_comments|channel|'" />
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()" />
        </xsl:copy>
    </xsl:template>
    <xsl:template match="Clip">
        <xsl:copy>
            <xsl:apply-templates select=
                "*[contains($fields, concat('|', @name, '|'))]" />
        </xsl:copy>
    </xsl:template>
</xsl:stylesheet>

And a bit of my XML is

<?xml version="1.0" encoding="windows-1252" ?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>

<FileImport>
    <Global>
        <GlobalParam name="RollName" value="Scene1" />
        <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>
        <Field name="ingest_report" value="&lt;?xml version=&quot;1.0&quot;  standalone=&quot;yes&quot;?&gt;&#xD;&#xA;&lt;DataSet1 
        </Roll>
        <Clip>
            <Field name="audio_format" value="" group="Ingest" />
            <Field name="camera_id" value="" group="Ingest" />
        </Clip>

    </FileImport>

And Hopefully my output will look like

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="testFIDEF.xsl"?>

<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>

    <MasterClip>
        <Field name="clip_description" value="Interview Captain Austin Ardill re Terence O'Neill" group="Ingest" />
        <Field name="rushes_roll_number" value="BUFVC003" group="Ingest" />
        <Field name="source_image_format" value="" group="Ingest" />
        <Field name="technical_comments" value="" group="Ingest" />
    </MasterClip>
</FileImport>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:36:43+00:00Added an answer on May 23, 2026 at 11:36 am

    By default transforms will out the value of any text node if there is not a match with another template rule. You can avoid this by adding the template:

    <xsl:template match="text()|@*" />
    

    This will override the default rule for text and attributes. This does mean that you will need to explicitly select the values for text to be output using xsl:value-of.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty basic question regarding the openxml sdk. I want to process
Following on from my recent question regarding parsing XML files in Java I have
I had a quick question regarding RegEx... I have a string that looks something
I have recently started with XML and had a question regarding XML schemas. As
I have a question regarding adding restriction in my xml schema(xsd). I have a
I have a question regarding reading an xml file with php. I have a
I have a general question regarding Android's separation of layouts into layout.xml files: My
got a question regarding serializing classes that I've defined. I have some classes like
I've just begun to tinker with XML, and I have a question. XML File:
I have question regarding the SQLAlchemy. How can I add into my mapped class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.