[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Unrequested stdout output

Subject: Re: Unrequested stdout output
From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Dec 2016 14:38:50 -0000
Re:  Unrequested stdout output
Hi Mark,

you can either declare the principal output as text:
<xsl:output method="text"/>

Or you can divert standard output into //./NUL at batch file level by appending
> //./NUL
to your java command line.


Gerrit

On 21.12.2016 15:14, Mark Wilson mark@xxxxxxxxxxxx wrote:
I build one of my websites (www.cpslib.org) using a Windows batch file
that has 45 distinct steps (I have never learned XProc and am 77 years
old so maybe never will). Even though I am using <xsl:result-document>
in the style sheet, the characters
    <?xml version="1.0" encoding="UTF-8"?>
 appear at stdout.  The document itself is written to file as specified
in result-document.

I have greatly simplified the batch file, XML document, and the
stylesheet, but the stdout output still appears when I run the batch
file. I have several other stylesheets in the batch file that use
result-document. Some exhibit this behavior, some do not.

I am unsure if this is an artifact of Saxon 97, the batch file process
,or my code.  Any help?
Mark

Batch file:
set SAXON_HOME=C:\saxon97
set SAXON_JAR=%SAXON_HOME%\saxon9he.jar
java -jar c:\saxon97\saxon9he.jar   work\text.xml xslt\071a-get-words.xsl

XML document (text.xml)
<?xml version="1.0" encoding="UTF-8"?>
<List>
   <Set lang="latin">
      <Text data="Lynx lynx" pofis-number="817" latin-original="Lynx lynx"
            text-location="coupon"
            domain="cr"
            year="2014"/>
   </Set>
</List>

XSLT stylesheet
<?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 indent="yes"/>

  <xsl:template match="List">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="Set">
    <xsl:if test="@lang eq 'latin'">
      <xsl:result-document href="work/latin-words.xml">
        <List>
          <xsl:apply-templates/>
        </List>
      </xsl:result-document>
    </xsl:if>

</xsl:template>

  <xsl:template match="Text">
    <xsl:variable name="data" select="@data"/>
    <xsl:variable name="eng" select="@eng-original"/>
    <xsl:variable name="czech" select="@czech-original"/>
    <xsl:variable name="latin" select="@latin-original"/>
    <!-- Is the text on the stamp or elsewhere? -->
    <xsl:variable name="type" select="if(@text-location) then
@text-location else 'stamp'"/>
    <xsl:variable name="domain" select="@domain"/>
    <xsl:variable name="year" select="@year"/>
    <xsl:variable name="pofis-prefix" select="@pofis-prefix"/>
    <xsl:variable name="pofis-number" select="@pofis-number"/>
    <xsl:variable name="pofis-suffix" select="@pofis-suffix"/>

    <!--walk over each distinct value setting that value as the current
node-->
    <xsl:choose>

      <!-- Latin word list  -->
      <xsl:when test="parent::Set/@lang eq 'latin'">
        <xsl:for-each
select="distinct-values(tokenize(lower-case(@data), '\s+'))">
          <xsl:variable name="initial-letter"
select="upper-case(substring(., 1, 1))"/>
          <xsl:variable name="sort-word"
            select="concat($initial-letter, substring(., 2,
string-length(.) -1))"/>
          <xsl:choose>
            <!-- Discard numbers -->
            <xsl:when test="number(substring-before(., '.'))"/>
            <xsl:otherwise>
              <Word word="{.}" sort-word="{$sort-word}" latin="{$latin}"
domain="{$domain}"
                year="{$year}" pofis-prefix="{$pofis-prefix}"
pofis-number="{$pofis-number}"
                pofis-suffix="{$pofis-suffix}" type="{$type}"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:for-each>
      </xsl:when>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>




-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard VC6ckler

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.