W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > March 2007

in-scope namespaces & inline documents

From: Alex Milowski <alex@milowski.org>
Date: Tue, 13 Mar 2007 15:10:10 -0700
Message-ID: <28d56ece0703131510r49908bf1p1ea300e1d7ca7188@mail.gmail.com>
To: public-xml-processing-model-wg <public-xml-processing-model-wg@w3.org>
If we have something like the following pipeline:

<p:pipeline name="toric-gröbner" xmlns:p='http://www.w3.org/2007/03/xproc'
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:monos="
http://www.milowski.com/Vocabulary/Math/Monos/Steps/2005/1/0"
            xmlns:m="http://www.milowski.com/Vocabulary/Math/Monos/2005/1/0
">
   <p:input port="pipe-input"/>
   <p:output port="pipe-output">
      <p:pipe step="translate-input" port="result"/>
   </p:output>

   <p:xslt name="translate-input">
      <p:input port="transform">
         <p:inline>
            <xsl:transform version="1.0">
               <xsl:template match="/m:matrix">
                  <m:compute-toric-ideal monomial-order="wgrevlex"
output="matrix-compact">
                     <xsl:copy-of select="*"/>
                     <xsl:if test="not(m:row-space-vector)">
                        <m:compute-row-space-vector>
                        <xsl:copy-of select="m:matrix"/>
                        </m:compute-row-space-vector>
                     </xsl:if>
                  </m:compute-toric-ideal>
               </xsl:template>
               <xsl:template match="*">
                  <xsl:copy-of select="."/>
               </xsl:template>
            </xsl:transform>
         </p:inline>
      </p:input>
      <p:input port="document"><p:pipe step="toric-gröbner"
port="pipe-input"/></p:input>
   </p:xslt>

</p:pipeline>

The inline XSLT transformation won't compile unless the in-scope namespaces
are
copied to the document element supplied as part of the input to the
'transform'
port of the XSLT step.

In the above pipeline, I declare all the prefixes on the document element of
the
pipeline.  This is what users typically do.  If they do that and we *DO NOT*
copy
the in-scope namespaces to the generated document element for inline
documents, the user will get an error and be very confused.

On the other hand, if we don't, a pipeline with a single identity step using
an
inline would generate output with more namespace declarations than specified
on the inline.  This seems like the lesser evil.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics
Received on Tuesday, 13 March 2007 22:10:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:50 GMT