Avatar of SANbuddies
SANbuddies
Flag for Norway asked on

XSLT fiiltering

I am running xslt and observed that there are two occurance of the attribute but the xslt is only fetching one occurance. I am not sure on what basis the xslt is retrieving on occurance and skipping the other.
Can someone explain?

I have modified the input file so there might be some syntax erro.

input file is
<Container>
<SPXTagCable>
<IObject  Name="26 C05110" />
 <Rel>      
      <IRel DefUID="CableFromTag" />
      <IObject UID="2e56510a-f578-4dfd-a1a9-515e6e60d92b" />
      <SPXTagFireGas>
        <IObject Name="43 FABU0A-01612B"  />
        </SPXTagFireGas>
</Rel>
</SPXTagCable>

 <SPXTagFireGas>
  <Rel>
      <ISubmittedItem TerminateObjectFlag="False" SAPInsertUpdateFlag="" />
      <IRel DefUID="CableFromTag" />
      <IObject UID="2e56510a-f578-4dfd-a1a9-515e6e60d92b" />
      <SPXTagCable>
        <IObject  Name="26 C05110" />
        </SPXTagCable>                
  </Rel>
 </SPXTagFireGas>
 </Container>

for some reason xslt is retreiving the following one but skipping the other.
<SPXTagFireGas>
  <Rel>
      <ISubmittedItem TerminateObjectFlag="False" SAPInsertUpdateFlag="" />
      <IRel DefUID="CableFromTag" />
      <IObject UID="2e56510a-f578-4dfd-a1a9-515e6e60d92b" />
      <SPXTagCable>
        <IObject  Name="26 C05110" />
        </SPXTagCable>                
  </Rel>
 </SPXTagFireGas>
input.xml
xslt-code.txt
XMLWeb Languages and Standards

Avatar of undefined
Last Comment
SANbuddies

8/22/2022 - Mon
Gertone (Geert Bormans)

well, you broke the code by making up the XML

the container template has a apply templates for this
*[ITaggedItem]/Rel
none of the Rel has a sibling ITaggedItem, so in this example none will be selected

I am suspicious, maybe in your real XML, one Rel has a sibling ITaggedItem
and the other has not?
Can we see more of the original XML? Or can you check the ITaggedItem being there in the two Rel?

If you post examples, and you make up the XML, please make sure they at least reproduce the problem
SANbuddies

ASKER
Yes it was wrong I have attached the original input file.
The one which is being skipped has more than one occurrance of ITaggedItem.
you can see in the input file.
Is this the answer?
second, let suppose if in both tags the ITaggedItem item occurance is more than once than what will the result?
input.xml
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SANbuddies

ASKER
I have to send you the big input file for some reason I can't upload the xml from my office Network I will try to upload it from home later.

thanks
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Gertone (Geert Bormans)

OK, will see that later
cheers
SANbuddies

ASKER
I will post the question tomorrow, just the code and data set is here because for some reason I can't upload the file from my office network.

thanks
input-VTLJob.1602-PL-EKOL.xml-Re.xml
N-N-TagsToSPO-Operations-QL10-.txt
SANbuddies

ASKER
hi after a long long time I found the problem it was based on the filtering the select I had was  <xsl:template match="*[ITaggedItem]/Rel">
and it was filtering correctly and showing what it should.

thanks for your help
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.