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 7962079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:13:54+00:00 2026-06-04T05:13:54+00:00

I have an XML like below: <TRANSFORMATION DESCRIPTION = NAME =RTR_LRC_RF_REFL_Unproc OBJECTVERSION =1 REUSABLE

  • 0

I have an XML like below:

    <TRANSFORMATION DESCRIPTION ="" NAME ="RTR_LRC_RF_REFL_Unproc" OBJECTVERSION ="1" REUSABLE ="NO" TYPE ="Router" VERSIONNUMBER ="1">
              <GROUP DESCRIPTION ="" NAME ="INPUT" ORDER ="1" TYPE ="INPUT"/>
              <GROUP DESCRIPTION ="" EXPRESSION ="EXP 1" NAME ="Good" ORDER ="2" TYPE ="OUTPUT"/>
              <GROUP DESCRIPTION ="Path for the data when none of the group conditions are satisfied." NAME ="DEFAULT1" ORDER ="3" TYPE ="OUTPUT/DEFAULT"/>
              <TRANSFORMFIELD DATATYPE ="integer" DEFAULTVALUE ="" DESCRIPTION ="" GROUP ="INPUT" NAME ="OWNER_HEORG_REFNO" PICTURETEXT ="" PORTTYPE ="INPUT" PRECISION ="10" SCALE ="0"/>
              <TRANSFORMFIELD DATATYPE ="integer" DEFAULTVALUE ="" DESCRIPTION ="" GROUP ="INPUT" NAME ="PATNT_REFNO" PICTURETEXT ="" PORTTYPE ="INPUT" PRECISION ="10" SCALE ="0"/>
              <TRANSFORMFIELD DATATYPE ="integer" DEFAULTVALUE ="" DESCRIPTION ="" GROUP ="INPUT" NAME ="REFRL_REFNO" PICTURETEXT ="" PORTTYPE ="INPUT" PRECISION ="10" SCALE ="0"/>
==============================================================================================
<GROUP DESCRIPTION ="" EXPRESSION ="(Valid_Record_Flag = &apos;Y&apos; 
<GROUP DESCRIPTION ="Path for the data when none of the group condition
<GROUP DESCRIPTION ="" EXPRESSION ="EXP2" .../> 
<GROUP DESCRIPTION ="" EXPRESSION ="EXP3" .../> 
<GROUP DESCRIPTION ="" EXPRESSION ="EXP4" .../> 

I use C# (LINQ to XML) to get some info from the abocve XML.

In the above XML, you can see the node under . You can also see that the EXPRESSION attribute for GROUP node occuring only once. I also have other sets of nodes, where they also contain nodes, but they have multiple EXPRESSION attributes (the nodes below the ===== divider).

My requirement is, I want to extract some info from GROUP Nodes having EXPRESSION attribute occuring only once.

I currently use the following C# code to extract the info:

 var q = from c in xmlDoc.Descendants("TRANSFORMATION")
                    where c.HasAttributes &&
                    c.Attribute("TYPE") != null && !String.IsNullOrEmpty(c.Attribute("TYPE").Value) &&
                    c.Attribute("TYPE").Value.ToUpper().Equals("ROUTER")

                    select c.Descendants("TRANSFORMFIELD");

But this gives all TRANSFORMFIELD nodes including GROUP nodes having EXPRESSION attribute occuring only once.

How do I get TRANSFORMFIELD nodes where GROUP nodes having EXPRESSION attribute occuring more than once?

Many thanks!

  • 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-06-04T05:13:56+00:00Added an answer on June 4, 2026 at 5:13 am

    I’m not 100% sure I understand your requirements but I think you only want to get all TRANSFORMFIELD of the TRANSFORMATION that contains more than one GROUP element that has an EXPRESSION defined. You could do this:

    var query =
        from transform in doc.Descendants("TRANSFORMATION")
        where String.Equals((string)transform.Attribute("TYPE"), "router",
                            StringComparison.OrdinalIgnoreCase)
        // GROUP elements that have more than one EXPRESSIONs defined
        where transform.Elements("GROUP")
                       .Where(e => e.Attribute("EXPRESSION") != null)
                       .Skip(1).Any() // more than one
        select transform.Elements("TRANSFORMFIELD");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML snippet like below: <Type> <name>content1</name> <priority></priority> <schedule>30 0/1 * *
I have a simple file XML like below: <brandName type=http://example.com/codes/bmw# abbrev=BMW value=BMW />BMW</brandName> <maxspeed>
I have a XML file like the below: <clients> <client> <id>YYYY</id> <name>XXXX</name> <desc>ZZZZ</desc> <trade_info>
HI Can i have a xml defination like below <add key=FirstName ServerType=FirstName Mandatory=Yes length=3
I have a xml that looks like below <xsl:template match=//xml> <xsl:for-each select=//z:row> <ul class
I have the following XML loaded in an XMLElement like below: <related_id> <Item> <classification>Component</classification>
I have an XML file which has many section like the one below: <Operations>
I have xml like this: <configurationData> <path name='b'> <path name='a'> <setting name='s1'> ![CDATA[XXXX]] </setting>
I have an xml like below: <?xml version=1.0 encoding=utf-8?> <GetSavedReportResponse> <ResponseType>Success</ResponseType> <FileModifiedDateTime>2012-01-03T17:05:04</FileModifiedDateTime> <FileSizeBytes>7816</FileSizeBytes> <FileDataFormat>XML</FileDataFormat>
I have an XML file like below , using xpath and xnavigator how can

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.