Question
When outputting data in an XML type schema, after declaring a namespace in one element, I tried to declare the same namespace under that element, but the element under it failed to output the namespace value.
What is the cause and how can I fix it?
Answer
Explanation of the specification
When a namespace is declared for an element, the namespace is applied to the entire contents of that element.
In other words, if a namespace is declared for an element, it is also applied to the subordinate elements. For this reason, if the same namespace is declared for a subordinate element, the value is omitted because it has already been applied.
Solution
The above behavior conforms to the XML namespace specification.
Therefore, it is not possible to output the value of the same name declaration as an element to the subordinate elements of the element.
Workaround
Please consider using a different value from the already declared name, and then convert the value using another connector in a subsequent process.
For example, output the value as an XML file once, read it with the CSV connector and convert it, then write it back to the file.
Supplement (note on workaround)
Please note that multiple declarations of the same namespace within the same content may not be read.
For example, in the case of XML connector, if an element and its subordinate elements declare the same namespace, the namespace of the subordinate element will not be read.
Comments
0 comments
Article is closed for comments.