[Xsltforms-support] control of namespaces in submissions
Brought to you by:
alain-couthures
From: Habs <ge...@us...> - 2017-11-17 14:49:54
|
Hello xsltforms-support Question: how to control namespace exposure when submitting an instance, so that the instance arriving at the sumbission endpoint reflects exactly the original instance as in the xform ? Considering this snippet from a xform: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:my="http://thisdefaultnamespace" xmlns:another="http://anothernamespace" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" my:dummy="whyisthisneeded"> . . . <xf:instance id="thisinstance"> <root xmlns="http://thisdefaultnamespace" xmlns:another="http://anothernamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="aRootType"> <child1/> <child2/> <section xsi:type="aSectionType"> <another:child1 /> <another:child2 /> </section> </root> </xf:instance> <xf:submission id="submitinstance" method="post" replace="all" resource="echoitback.script"/> . . . </html> It would seem that the instance above is a well-formed and valid document (correct in its namespaces and their exposure etc) when checked in an accurate xml editor program (xmlspy & editix). It seems that the instance document arriving at the specified destination [submission] resource, has 'xmlns' attributes included throughout the document in relation to xmlns:another and xmlns:xsi namespace - e.g. : <root xmlns="http://thisdefaultnamespace" xmlns:another="http://anothernamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="aRootType"> <child1/> <child2/> <section xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="aSectionType"> <another:child1 xmlns:another="http://anothernamespace" /> <another:child2 xmlns:another="http://anothernamespace"/> </section> </root> These added namespace attributes are not required, therefore how is namespace exposure controlled to prevent this and indeed, is this too complicated for current xforms I wonder. Thank you for any comments, observations, corrections and so forth ? Regards Habs |