Skip to main content
Question

How do I set a xml element to xsi:nil=true in a XSD Driven XML Writer?


hasant1973
Contributor
Forum|alt.badge.img+3

How do I set a xml element to xsi:nil=true in a XSD Driven XML Writer?

I tried to set with "name.nil" xml_boolean. No luck. 

I changed the type from xml_boolean to xml_char. No luck.

I created a feature_type for <name> element and set the attribute via a "nil" attribute. No luck. 

The output shall look like this: 

<aixm:name xsi:nil="true" nilReason="inapplicable"/>

nilReason works without problems. 

6 replies

trentatsafe
Safer
Forum|alt.badge.img+6

Hello @hasant1973​ 

I was able to set the xsi:nil=true element via setting the attribute name.nil = true. The writer had the attribute picked up as a xml_boolean.

I've included the small sample workspace I had set up to test this with sample data.

 


hasant1973
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • June 13, 2023

Do you know if there is any documentation about these special fields in FME. I cannot find any. The XSD driven XML Writer is really very powerful when it comes to complicated XML structures. But the tutorials and the documentation is extremely poor. The only way to find things like this is reverse engineering. Create a XML with what you want and read it with a XSD driven XML Reader and look at attributes.


trentatsafe
Safer
Forum|alt.badge.img+6

Hi @hasant1973​ 

 

For the time being, the XSD-Driven XML Writer User Attributes section does have some documentation surrounding the data types that you may find useful.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/xsd_driven_xml/user-attributes.htm

 

Secondly, Are you able to share your workspace that you were working with?(including the app schema's you used for the Writer)? We think we may have an idea for an enhancement that may hopefully address the xsi:nil not being present.


hasant1973
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • July 4, 2023
trentatsafe wrote:

Hi @hasant1973​ 

 

For the time being, the XSD-Driven XML Writer User Attributes section does have some documentation surrounding the data types that you may find useful.

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-ReadersWriters/xsd_driven_xml/user-attributes.htm

 

Secondly, Are you able to share your workspace that you were working with?(including the app schema's you used for the Writer)? We think we may have an idea for an enhancement that may hopefully address the xsi:nil not being present.

Thank you but I get a 404 when I click on your link.


trentatsafe
Safer
Forum|alt.badge.img+6
hasant1973 wrote:

Thank you but I get a 404 when I click on your link.

@hasant1973​ 

Try using the above link again I fixed it, should work now.


hasant1973
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • July 5, 2023
hasant1973 wrote:

Thank you but I get a 404 when I click on your link.

There is no section in this document about the xsi:nil. Only the data types are mentioned there.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings