0

I want to transform an xml source into several xml output files where the filenames are based on a guid (f.e "97749654-886A-11E6-1885-09173F13E4C5.xml"). I am using xslt 2.0 and the home edition of saxon, so I can't use randomUUID(). In other posts I found the workaround with the timestamp method. But it seems that the current-dateTime() stays the same in the transformation. So the transformation errors because the guid and thus the filenames stay the same.

Is there a way to work around this?

  • 2
    Wouldn't a combination of timesamp and the id of the parent node be unique? -- P.S. When referring to a method you have found "in other posts", a link to those posts would be useful. – michael.hor257k Oct 02 '16 at 07:32
  • Have you seen and tried this example http://stackoverflow.com/a/30775426/6805256? Might be worth a try. – uL1 Oct 02 '16 at 10:14
  • @uL1 Have *you* tried it? – michael.hor257k Oct 02 '16 at 12:12
  • Yes i tried it in oxygen and i know it about a long time. Sorry, why do you ask? – uL1 Oct 02 '16 at 15:15
  • @uL1 Because the link is broken. – michael.hor257k Oct 02 '16 at 21:17
  • @michael.hor257k the link to question works for me. the link in the answer is broke, but the xslt is posted inline and works as well. – uL1 Oct 03 '16 at 05:14
  • That's the example I tried (stackoverflow.com/a/30775426/6805256). Maybe I'm doing something wrong here, but the timestamp part doesn't seem to change when you generate the next id. I added a call template .. – Heinrich1971 Oct 03 '16 at 07:41
  • That is not a problem of you. see here http://stackoverflow.com/questions/39387103/xslt-function-returns-different-results-saxon-ee-vs-saxon-he-pe. – uL1 Oct 03 '16 at 09:59
  • Just add to the UUID something that at that moment in the transformation is different -- without seeing your code it is not good to be more precise in this recommendation. For example, you can use whatever is different in the value of the `href` attribute of the `` instruction. – Dimitre Novatchev Oct 06 '16 at 03:36

0 Answers0