Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using resp:response to download xml transfers name-space declarations #26

Open
siebej opened this issue Nov 15, 2022 · 0 comments
Open

Comments

@siebej
Copy link

siebej commented Nov 15, 2022

Using resp:response to download xml transfers name-space declarations.

input-xml: see input.xml in input.xml.zip
input.xml.zip

request-dispatcher.xsl template

  <xsl:template match="/req:request[req:path = '/issueMetNamespaces']">
    <pipeline:transformer name="issueMetNamespaces" xsl-path="issueMetNamespaces.xsl"/>
  </xsl:template>

issueMetNamespaces.xsl:

<?xml version='1.0'?>
<xsl:stylesheet 
	version="3.0" xmlns:xsl  ="http://www.w3.org/1999/XSL/Transform" xmlns:resp="http://www.armatiek.com/xslweb/response" exclude-result-prefixes="#all">
  <xsl:template match="/">
    <xsl:variable name="input" as="document-node()"  select="doc('input.xml')"/>

    <xsl:result-document href="file-uri2output-saxon.xml">
      <xsl:sequence select="$input"></xsl:sequence>
    </xsl:result-document>

    <resp:response status="200">
      <resp:headers>
        <resp:header name="Content-Type">application/xml</resp:header>
        <resp:header name="Content-Disposition">attachment; filename=output-response.xml</resp:header>
      </resp:headers>
      <resp:body>
        <xsl:sequence select="$input"/>
      </resp:body>
    </resp:response>
  </xsl:template>
  
</xsl:stylesheet>

The result of saxon-result-document: output-saxon.xml.zip

The result of response: output-response.xml.zip

I get that both files are valid.

But MsWord does not like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant