Within XML there exits elements and attributes. There is a special attribute called xsi:type
. Can I declare an xsi:tpye
value within the same namespace as the element in which it occurs? Example using Dublin Core.
Element Example
<dcterms:dateCopyrighted>2022</dcterms:dateCopyrighted>
Question: Is the following Valid?
<dcterms:dateCopyrighted xsi:type:="dcterms:W3CDTF">2012-11-11</dcterms:dateCopyrighted>
Please help me better understand what is happening in the questioned code. Is the whole declaration of the dcterms:dateCopyrighted
being replaced by dcterms:W3CDTF
and therefore impacting the type of the element's value, so the processing follows the rules for dcterms:W3CDTF
or is only the only the type value of the data being being changed (rather than the actual element)? For example, lets imagine the expected value for dcterms:dateCopyrighted
is a literal, while the type of dcterms:W3CDTF
is a non-literal (to be clear this is not the case with these Dublin Core elements). So, in this case would the element be replaced and then the value type changed, or would the element stay the same and simply the value's type changed?
I found the type chart here helpful. In my specific case I am dealing with two different complexTypes.