Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Multiple output types and embedded documentation

From: Warren Hedley <w.hedley@-------------->
To:
Date: 7/3/2000 7:06:00 AM
Obviously I needed more exclamation marks in my subject !!!! It took
so long for anyone to respond, I thought it must have been deleted
somewhere and I'd have to repost.

"Pawson, David" wrote:
> 
> Presumably, using this format, you would swap out the namespace
> of either out_1 or out_2 and replace it with the xsl namespace, to
> select the actual output wanted?

Precisely.

> 1. How do you 'disable' output from the undesired namespaces
>     when not in use.
> 2. I don't understand the 'intermediate step' idea above.

David Carlisle has already posted one answer to these questions, but
I think it should be possible to have a more general solution, where
the user can use whatever namespaces they like, and command line
parameters are given to the "intermediate step" stylesheet, to extract
the correct outputs.

This intermediate stylesheet might contain code like this (not tested):

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                >

<!--
  Default values are unlikely namespaces.
  We'd need "output_ns" to possibly be a list of namespaces,
  (I use [ns_1][ns_2] kind of strings, and split the string
  up in the XSL), so that you could output HTML and DEBUG.
-->
<xsl:param name="logic_ns"    select="'***'" />
<xsl:param name="output_ns"   select="'***'" />

<xsl:variable name="xsl_ns"
    select="'http://www.w3.org/1999/XSL/Transform'" />

<xsl:template match="*[namespace-uri(.) = $logic_ns]">
  <!-- probably not the right way to do the following -->
  <xsl:element name="local-name(.)" namespace="{$xsl_ns}">
    <xsl:copy-of select="@*" />
    <xsl:apply-templates />
  </xsl:element>
</xsl:template>

<xsl:template match="*[namespace-uri(.) = $output_ns]">
  <!-- strip namespace -->
  <xsl:element name="local-name(.)">
    <xsl:copy-of select="@*" />
    <xsl:apply-templates />
  </xsl:element>
</xsl:template>

</xsl:stylesheet>

A command line might look like this (where I've come up with a new
suffix) :

xslt-processor   template_stylesheet.txsl \        # in
  intermediate_stylesheet.xsl \     # transform
  logic_ns='org.hedley.xsl_logic' \ # the logical choice!
  output_ns='[org.hedley.html][org.hedley.xsl_trace]' \ # html + debug
  > html_debug_processor.xsl        # output

-- 
Warren Hedley


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent