[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: Somewhat offtopic: xsl question
On Thu, May 27, 2004 at 03:03:14PM -0400, G. Ken Holman wrote:
> Hmmmmm ... not quite.
>
> You say you are writing a stylesheet ... if it is an XSLT stylesheet then
> its input is the UBL XML and its output is HTML, XML, text or some custom
> set of extension output semantics supported by a given processor.
>
> Your stylesheet name implies the output will (eventually) be an EDIFACT
> message in some assumedly normative syntax ... but how are you getting the
> result in that syntax?
>
> If your stylesheet output is XML, then perhaps you have a postprocess that
> reads an instance of an XML vocabulary reflecting the EDIFACT semantics
> and outputs normative EDIFACT syntax (perhaps written using a SAX process).
>
> If your stylesheet output is EDIFACT syntax,then perhaps you are using a
> custom extension available in a processor (you could even use the SAX
> process described above).
>
> If your stylesheet technology isn't XSLT, then I'd be curious which
> technology is supporting the EDIFACT semantics to produce the EDIFACT
> syntax.
>
> Many choices, which is why I was curious what your choice was (even if
> "none of the above").
Ken, I think you are far too ahead from me :)
I'm even a bit shamed to say that my solution is as simple as :
<xsl:template match="/in:Invoice">
<!-- Cabecalho -->
<xsl:call-template name="Header"/>
</xsl:template>
<xsl:template name="Header">
<!-- Unique identifyer -->
<xsl:text>UNH+</xsl:text>
<xsl:value-of select="in:ID" />
<xsl:text>+INVOIC:D:93A:UN:EAN007' </xsl:text>
<!-- Number -->
<xsl:text>BGM+380+</xsl:text>
<xsl:value-of select="in:ID" />
<xsl:text>' </xsl:text>
<!-- Date -->
<xsl:text>DTM+137:</xsl:text>
<xsl:value-of select="translate(cbc:IssueDate,'-','')" />
<xsl:text>:102' </xsl:text>
..... etc
If there are better ways to do this I really would like to learn them.
I have very little experience in XSLT.
Pedro Alves
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]