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

Re: writing new values to an extra document

Subject: Re: writing new values to an extra document
From: dvint@xxxxxxxxx
Date: Fri, 7 Nov 2008 08:27:38 -0500 (EST)
Re:  writing new values to an extra document
I had a problem similar to this where I needed to write the XML stream
out, but I also needed this sort of log as well. In my case I was trying
to make a list of all the graphics and create a batch file that would copy
the files from a common area (lots of unused graphics here) and move the
files I needed to an area I would use for delivery.

I used the <xsl:message> to write these to stdout, I sent that to a file
by piping the output, or just cut and pasted the messages into another
file.

Now this makes it hard to write debugging statements, but it saved me from
creating another stylesheet for just this purpose.

It would have been nice to just have the ability to write to a file as
needed from within the stylesheet; that would have been a cleaner
approach, but this satisfied my needs at the moment.

..dan

> Hi,
>
> I have a quite tricky one for you.
>
> I4m transforming files that have an element called 'gerichte'. Every week
> i get new files, and there is the possibility that there are new values
> for  'gerichte' that i didn4t know before. if that is the case i want to
> write the new and only the new ones into an extra file.
>
> Little more explanation:
>
> Let4s say i know the following values for 'gerichte': BSG, USG, OGH. Those
> are the ones that i did consider in my stylesheets.
> Now i get a delivery with new gerichte lets say: USK, VFGH, IAK. What i
> want now is that those are added to the extra file that already exists,
> and contains all known values for gerichte.
>
> <gerichte>
> <gericht>BSG</gericht>
> <gericht>USG</gericht>
> <gericht>OGH</gericht>
> <gericht>USK</gericht>
> <gericht>VFGH</gericht>
> <gericht>IAK</gericht>
> </gerichte>
>
> The problem now is that I have no clue how to switch between the two
> different result trees...
> I tried it with <xsl:result-document> but Saxon is giving me the error
> message
>
> Error at xsl:result-document on line 183 of transform.xsl:
>   XTDE1490: Cannot write more than one result document to the same URI:
>   file:/W:/technik/dev/xsl_dev/gerichte.xml
> ...
>
> Because I'm always writing to the same destination URI.
>
> Idea someone ?!
>
> Here4s what i have right now:
>
> ....
> <xsl:variable name="gerichtsDokument"
> select="document('../gerichte.xml')"/>
> <xsl:variable name="gerichtsWert" select="gericht"/>
>
>      <xsl:result-document href="../gerichte.xml">
>                 <gericht>
>                     <xsl:attribute name="date"
> select="format-date(current-date(), [D]-[M]-[Y]')"/>
>                     <xsl:value-of select="gericht"/>
>                 </gericht>
>       </xsl:result-document>
> ....
>
> cheers
>
> Patrick Szabo
> EPD / XSLT Konvertierung
> Tel.: +43-1-534 52-1573
> Fax.: +43-1-534 52-1573
> patrick.szabo@xxxxxxxxxxxxx
>
> LexisNexis Verlag ARD Orac GmbH & Co KG
> Marxergasse 25, 1030 Wien
> FN 8333f, Handelsgericht Wien
> www.lexisnexis.at <http://www.lexisnexis.at/>

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.