[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Naming a new XML file from XSL


Subject: Re: [xsl] Naming a new XML file from XSL
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Fri, 28 Apr 2006 16:36:40 -0500

On 4/28/06, Gary E. Daniels <gdaniels@xxxxxxxxxxx> wrote:
Hi.  How do I code an XSL Stylesheet to insert an XML file name with
beginning and end tags into the resulting transform to an XML file?


I'm not entirely clear what you're doing here, but the general problem sounds like it could be solved with parameters. How you pass in the parameter is processor-dependent. Searching through the archives should get you where you need to go.

I need to have XSL-A insert <XML-B> and </XML-B> tags properly into XML-B
for its file name.  The file name for XML-B will always be the same (i.e.
results, output, etc.).

This is a little confusing. I'm not sure why you would have this information in the tag of the element. Rather odd use of XML.


Currently, I am inserting the tags manually into XML-B. I then use a 2nd XSL stylesheet (XSL-B) to do a transform of XML-B. XSL-B is coded with <xsl:template match="XML-B">, so if XSL-A can be coded to automatically insert the name tags when it transforms XML-A to XML-B, I can immediately transform XML-B with XSL-B without having to manually insert the name tags into XML-B. Thanks in advance.
This is also a little confusing.  So you manually add the tags to the
result file, but then run yet another stylesheet on that?

Still, like before, just do params.

in xsltproc something like:

xsltproc XSLA.xsl XMLA.xml --param name XMLB.xml > XMLB.xml

and do a global param

<xsl:param name="name" select="defaultFileName" />

and in the appropriate template
<xsl:element name="$name">
....do some stuff
</xsl:element>


Although I'd say again this all sounds rather strange.


Jon Gorman


Current Thread
Keywords