Link to home
Start Free TrialLog in
Avatar of SANbuddies
SANbuddiesFlag 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
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

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
Avatar of 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
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
OK, will see that later
cheers
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
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