Re: [xsl] Process one document, but change another

Subject: Re: [xsl] Process one document, but change another
From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 8 Sep 2014 14:56:46 -0000
At 2014-09-08 14:05 +0000, Rick Quatro rick@xxxxxxxxxxxxxx wrote:
I have an XML document with a series of <image> elements. They have href
attributes that reference svg files. For each of these <image> elements, I
want to open the corresponding svg file and copy some information from my
source document to the svg file. So while the stylesheet is processing one
document, I want to be able to change the other documents. Is this possible
with XSLT? Any pointers would be appreciated.

In pseudo-code I would approach this as:



for-each image result-document href=new directory and name created from image/@href apply-templates mode=modify select=document(@href in old directory) with-param tunnel=yes name=info select=image information

  match=everything mode=modify
    copy
      apply-templates select=@*,node() mode=modify

  match=item-to-change-in-SVG mode=modify
    param name=info tunnel=yes
    change the item using the image information


I hope this helps and isn't too cryptic. It processes your documents from a source directory to your new target directory (since you can't overwrite a document that is being read).


. . . . . . Ken


-- Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/video.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |


--- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com

Current Thread