UNPKG

enketo-transformer

Version:

Library that transforms ODK-compliant XForms into a format that Enketo can consume

1 lines 2.46 kB
{"version":3,"file":"openrosa2xmlmodel.xsl.cjs","sources":["../../../src/xsl/openrosa2xmlmodel.xsl?raw"],"sourcesContent":["export default \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\\n<!--\\n*****************************************************************************************************\\nXSLT Stylesheet that transforms OpenRosa style (X)Forms instance to an xml instance that can be used\\ninside Enketo Smart Paper.\\n*****************************************************************************************************\\n-->\\n\\n<!-- \\nThese namespace-declarations have been carefully crafted to produce a fairly clean output. \\nThis includes the duplicate default namespace and xf: prefixed namespace. \\nEdit with care!\\n-->\\n<xsl:stylesheet xmlns:xsl=\\\"http://www.w3.org/1999/XSL/Transform\\\" \\n xmlns:xf=\\\"http://www.w3.org/2002/xforms\\\" \\n xmlns:h=\\\"http://www.w3.org/1999/xhtml\\\" \\n xmlns:ev=\\\"http://www.w3.org/2001/xml-events\\\" \\n xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" \\n xmlns=\\\"http://www.w3.org/2002/xforms\\\" version=\\\"1.0\\\">\\n <xsl:output method=\\\"xml\\\" indent=\\\"yes\\\" omit-xml-declaration=\\\"yes\\\" version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" />\\n\\n <xsl:template match=\\\"/\\\">\\n <root>\\n <model>\\n <xsl:apply-templates select=\\\"//xf:model/@*\\\" mode=\\\"include-namespace-declarations\\\"/>\\n <xsl:apply-templates select=\\\"//xf:model/xf:instance\\\" />\\n </model>\\n </root>\\n </xsl:template>\\n\\n <xsl:template match=\\\"xf:instance\\\">\\n <instance>\\n <xsl:apply-templates select=\\\"@*\\\"/>\\n <!-- \\n This forces namespace declarations on the child of instance, which makes it easier to\\n serialize that child for a submission without duplications of namespace declarations.\\n -->\\n <xsl:copy-of select=\\\"node()\\\" />\\n </instance>\\n </xsl:template>\\n\\n <xsl:template match=\\\"@*\\\">\\n <xsl:attribute name=\\\"{name()}\\\">\\n <xsl:value-of select=\\\".\\\" />\\n </xsl:attribute>\\n </xsl:template>\\n\\n <xsl:template match=\\\"@*\\\" mode=\\\"include-namespace-declarations\\\">\\n <xsl:copy-of select=\\\".\\\"/>\\n </xsl:template>\\n\\n</xsl:stylesheet>\\n\""],"names":[],"mappings":";;AAAA,MAAe,WAAA;;"}