Skip to main content
Solved

XML reader adds xsi:nil="true" elements as filed names with .nil how to resolve this and have the value populated to be null

  • January 24, 2019
  • 6 replies
  • 1332 views

bhanu_v
Forum|alt.badge.img

I'm reading an XML with ticket details that has xsi:nil=true in the tag and it adds the field name with .nil

Also,there is a tag with xlmns andIm not sure if I have to use a List Exploder to further get its attributes.

I'm a novice FME user and have no prior experience with xml either

I'm looking for direction on how to resolve the field names to be the tag text and populate its values in ESRI Gdb format

Any help will be much appreciated

Best answer by itay

Hello @adi, the 

<test:PreviousTicketNumber xsi:nil="true" />

Just tells you that the PreviousTicketNumber attribute doesn't necessarily need to have a value (true), if you are only interested in the PreviousTicketNumber value you can ignore the PreviousTicketNumber.nil tag

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • January 24, 2019

Hi @adi,

It would be useful if you can share the XML input so that we can assist you.


bhanu_v
Forum|alt.badge.img
  • Author
  • January 24, 2019

Hi @adi, 

It would be useful if you can share the XML input so that we can assist you.

Hello @itay

Thankyou for taking time to look into this ,

here is a sample xml ,its ticket information that Im trying to write into SQL ,or Esri gdb

 

 

<?xml version="1.0" encoding="utf-8"?>
<test:testReferral xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:test="http://www.example.com/test"

 

="https://www.example.com/test/bydp.xsd">
  <test:Details>
    <test:MessageVersionNumber>1.0.10</test:MessageVersionNumber>
    <test:From>Before You Dig Partners</test:From>
    <test:RequestMedium>Phone</test:RequestMedium>
    <test:UtilityID>10038</test:UtilityID>
    <test:StationCode>value1            </test:StationCode>
    <test:TicketNumber>20184200087</test:TicketNumber>
    <test:PreviousTicketNumber xsi:nil="true" />
    <test:SequenceNumber>41199</test:SequenceNumber>
    <test:RequestDateTime>2018-10-19T12:02:21.295959-05:00</test:RequestDateTime>
    <test:WorkToBeginDate>2018-10-23T03:00:00-05:00</test:WorkToBeginDate>
    <test:WorkCompletionDate xsi:nil="true" />
    <test:IsEmergency>False</test:IsEmergency>
    <test:UserReference xsi:nil="true" />
    <test:StationList>
      <StationCode xmlns="test">value1             </StationCode>
      <StationCode xmlns="test">value2            </StationCode>
      <StationCode xmlns="test">value3            </StationCode>
      <StationCode xmlns="test">value4           </StationCode>
    </test:StationList>
  </test:Details>

I have tried using Feature paths for the configuratio Type and Elements to match to the node to Details .There is two entries with Previous Ticket Number and Previous Ticket Number.nil how would i handle this . which one should I keep0684Q00000ArMmvQAF.png


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • Best Answer
  • January 27, 2019

Hello @adi, the 

<test:PreviousTicketNumber xsi:nil="true" />

Just tells you that the PreviousTicketNumber attribute doesn't necessarily need to have a value (true), if you are only interested in the PreviousTicketNumber value you can ignore the PreviousTicketNumber.nil tag


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • January 27, 2019

Hello @itay

Thankyou for taking time to look into this ,

here is a sample xml ,its ticket information that Im trying to write into SQL ,or Esri gdb

 

 

<?xml version="1.0" encoding="utf-8"?>
<test:testReferral xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:test="http://www.example.com/test"

 

="https://www.example.com/test/bydp.xsd">
  <test:Details>
    <test:MessageVersionNumber>1.0.10</test:MessageVersionNumber>
    <test:From>Before You Dig Partners</test:From>
    <test:RequestMedium>Phone</test:RequestMedium>
    <test:UtilityID>10038</test:UtilityID>
    <test:StationCode>value1            </test:StationCode>
    <test:TicketNumber>20184200087</test:TicketNumber>
    <test:PreviousTicketNumber xsi:nil="true" />
    <test:SequenceNumber>41199</test:SequenceNumber>
    <test:RequestDateTime>2018-10-19T12:02:21.295959-05:00</test:RequestDateTime>
    <test:WorkToBeginDate>2018-10-23T03:00:00-05:00</test:WorkToBeginDate>
    <test:WorkCompletionDate xsi:nil="true" />
    <test:IsEmergency>False</test:IsEmergency>
    <test:UserReference xsi:nil="true" />
    <test:StationList>
      <StationCode xmlns="test">value1             </StationCode>
      <StationCode xmlns="test">value2            </StationCode>
      <StationCode xmlns="test">value3            </StationCode>
      <StationCode xmlns="test">value4           </StationCode>
    </test:StationList>
  </test:Details>

I have tried using Feature paths for the configuratio Type and Elements to match to the node to Details .There is two entries with Previous Ticket Number and Previous Ticket Number.nil how would i handle this . which one should I keep0684Q00000ArMmvQAF.png

Hello @adi, the 

<test:PreviousTicketNumber xsi:nil="true" />

Just tells you that the PreviousTicketNumber attribute doesn't necessarily need to have a value (true), if you are only interested in the PreviousTicketNumber value you can ignore the PreviousTicketNumber.nil tag


bhanu_v
Forum|alt.badge.img
  • Author
  • January 29, 2019

Hello @adi, the 

<test:PreviousTicketNumber xsi:nil="true" />

Just tells you that the PreviousTicketNumber attribute doesn't necessarily need to have a value (true), if you are only interested in the PreviousTicketNumber value you can ignore the PreviousTicketNumber.nil tag

Hello @itay,Thank you for your suggestion on this ,I removed the nil attributes from the user attribute list,but I still need to figure out xlmns tag ,I have a used a list exploder and that resulted in additional records where as opposed to only one.

 

 


bhanu_v
Forum|alt.badge.img
  • Author
  • January 29, 2019

Hello @adi, the 

<test:PreviousTicketNumber xsi:nil="true" />

Just tells you that the PreviousTicketNumber attribute doesn't necessarily need to have a value (true), if you are only interested in the PreviousTicketNumber value you can ignore the PreviousTicketNumber.nil tag

Hello @itay,I have removed the xlmns tags from the attributes and I got the expected output.Thank you