Skip to main content

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. 

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.

 


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.


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.


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.


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.


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