Skip to main content

Hi, 

I’m using XSDDrivenXMLWriter to write very dynamic XML to a file. There is one part of the xml with a lot of features that is very static and contains always the same data like origin and publisher… I don’t want to create all the 30 features with the XSDDrivenXMLWriter for this static part and thought I could use the _XML_FRAGMENT_ feature and 3 attributes like xml_fragment, xml_document_append_path and xml_document_append_as to tell the XSDDrivenXMLWriter to add my static xml to the output. 

But somehow I can’t get it working.

Can you please provide me an example workspace? Unfortunately I cannot provide my workspace because it is restricted by the customer.

Many thanks. 

Hi ​@hasant1973 , thanks for posting! Are you currently sending the attributes directly to the writer, or using the append parameters within the XSD-Driven XML Writer to do this? Using the append parameters should let you add a fragment to the output that isn’t defined in the XSD (see article: Composing XML Documents using the XML Appender Parameters in the XSD-Driven XML Writer). However, if these static features are defined in the XSD, the writer should take care of this for you.

Another idea might be to FeatureWrite the XSD-Driven XML document, then FeatureRead it and use an XMLAppender transformer to add what you need. This should work similarly to the append parameters on the XSD-Driven XML Writer.

If none of these suggestions do the trick, I’d encourage you to submit a support case. That way, you can share your workspace, data, and a sample of the output or structure you’re working towards. Happy to help, Kailin.


Hi ​@hasant1973 , thanks for posting! Are you currently sending the attributes directly to the writer, or using the append parameters within the XSD-Driven XML Writer to do this? Using the append parameters should let you add a fragment to the output that isn’t defined in the XSD (see article: Composing XML Documents using the XML Appender Parameters in the XSD-Driven XML Writer). However, if these static features are defined in the XSD, the writer should take care of this for you.

Another idea might be to FeatureWrite the XSD-Driven XML document, then FeatureRead it and use an XMLAppender transformer to add what you need. This should work similarly to the append parameters on the XSD-Driven XML Writer.

If none of these suggestions do the trick, I’d encourage you to submit a support case. That way, you can share your workspace, data, and a sample of the output or structure you’re working towards. Happy to help, Kailin.

Are you saying that the problem is that the part I want to write is described in the XSD? If it would not be there it would write the XML into the main XML but since it is mentioned in the XSD it does not?


Reply