I was hoping I could use Saxon to post output documents directly to a content engine running on Jetty.
I am trying to skip the 'generate content to disk' step and directly upload from XSLT using <XSL:Result-Document> having noticed that Michael Kay said folks had been successfully used it with
ftp and
mailTo.
For reference, the following is the simple command I would give using a utility like
Curl to achieve an HTTP based upload:
C:\curl
http://localhost:8983/solr/update/ -F stream.file=C:\FormattedContentFromXSLT\MyUploadCo ntent.xml
My sample XSLT reads as follows:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output name="outputDefinition" method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template match="/" name="main">
<xsl:variable name="Url" select="'http://localhost:8983/solr/update'"/>
<xsl:for-each select="/document/content/section">
<xsl:result-document href="{$Url}" format="outputDefinition">
<add>
<doc>
<field name="id"
>[Document]2008-1stCentennialBancorp-CIK0001097081.html</field>
<field name="contextNumberPages">92</field>
<field name="contextTOCCount">20</field>
<field name="contextNumberSections">20</field>
<field name="contextNumberSubSections">1259</field>
<field name="contextHasPageBreaks">true</field>
</doc>
</add>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I am running this from Oxygen 11.0 and get the following error:
Engine name: Saxon-HE 9.2.0.2
Severity: fatal
Description: Failed while closing output file - 400 Bad Request for:
http://localhost:8983/solr/update
Start location: 27:0
HTTP ERROR: 400 âmissing content streamâ
Most grateful for any suggestions,