Jump to content

Loriot

Members
  • Posts

    26
  • Joined

  • Last visited

About Loriot

  • Birthday 01/30/1969

Contact Methods

  • Website URL
    http://www.nrk.no

Profile Information

  • Location
    Norway,Oslo

Loriot's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi there,I did the same thing and it works perefctly alright without blanks. But I have packed all that in a table structure and have the pics i a row in a cell. Maybe that helps... <td><xsl:variable name="link"><xsl:for-each select="File_Filename0"/></xsl:variable><a href="{$link}"><img border="0" align="middle" src="First.bmp"/></a><a href="{$link}"><img border="0" align="middle" src="Second.bmp"/></a><a href="{$link}"><img border="0" align="middle" src="Third.bmp"/></a></td>
  2. Hi all, sorry for being such a massiv questioner right now but I got one more problem and maybe I get from you one more solution. I have a stylesheet that transforms some xml data and inserts at a certain position another xml file content. Looks like that in the place: <xsl:copy-of select="."/> <xsl:copy-of select="document('SomeName.xml')"/> Now I would like to replace the konkret filename with a variable så that i can fetch the filename from the data in the transformed main.xml I tried that way, but it didn't work out: <xsl:variable name="Somename" select="FilenameValue"/> <xsl:copy-of select="."/> <xsl:copy-of select="document('$SomeName')"/></xsl:variable>
  3. Thanx boen robot! It works. You made my day!
  4. Hi all,I got a very nice little extra template that transforms a millisecond value to hh:mm:ss. But now I found out that it failes in one special case: If I have something that is 1min 59sec and 990 msec, than I get 1:60 instead of 2 min. Somebody out there that knows how to transform that correctly?My calltemplate: <xsl:decimal-format name="european" decimal-separator=","/><xsl:template name="processLength"> <xsl:param name="milliseconds"/> <xsl:variable name="hours" select="floor($milliseconds div (1000*3600))"/> <xsl:variable name="minutes" select="floor(($milliseconds mod (1000*3600)) div (1000*60))"/> <xsl:variable name="seconds" select="($milliseconds mod (1000*60)) div 1000"/><xsl:value-of select="concat(format-number($hours, '#00'), ':',format-number($minutes, '00'), ':', format-number($seconds, '00', 'european'))"/></xsl:template> Help would be thankfully taken!
  5. Hi,I found out about it. Prosessing is done by msxml parser and this will always answer with UTF-16 np matter what you really do have. The msxml parser is not able to transform encoding mode. So I found at least another solution and feed now UTF-8 already into the parser. the funny thing is, that you definitely have to write the <?xml version="1.0" encoding="UTF-8"?> header inn by yourself. If you do not set <omit-xml-declaration="yes"> you will always get a header og UTF-16 no matter what the file really is. This is really odd!!But if anybody is hanging around in that forum who knows some scripting or so I can use to change encodings in one go with xsl-transformations I am still curious to know.Thanx so far!!
  6. Hi all, I got a little problem with encoding. I try to transform with XSL stylesheet one XML into another. From the input side I can get either UTF-16 or ANSI. On the output I must have UTF-8 But whatever I tried:The coding stays as I get it in. What's wrong?? Here is the last version I tried. <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version= "1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" media-type ="application/xml" omit-xml-declaration="yes"/> Any help is appreciated!Loriot
  7. Got a little further now. You were right, I didn't need the match/lavel3. So this is where I am now to get a proper basis:Stylesheet <?xml version="1.0" encoding="UTF-16"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates/> <xsl:copy-of select="."/> <xsl:copy-of select="document('second.xml')"/></xsl:template></xsl:stylesheet> Result: <Level1> <Level2> <Level3> </Level3> </Level2></Level1><!--up til here all from first xml--><!---from here added info from second xml--> <Level2> <Level3> <Tag1>x</Tag1> <Tag2>x</Tag2> <Tag3>x</Tag3> </Level3> </Level2> I can filter the second.xml that I just get the Level3 and Tag info.But how do I now tell the stylesheet, that I want to replace the Level3 section with the content from second.xml?Any suggestions?RegardsLoriot
  8. Hi, I have quite a similar problem right now and couldn't solv it only with the help of the topic so far. I have 2 xml files og unidentical level depthfirst: <Level1> <Level2> <Level3> </Level3> </Level2></Level1> second: <Level2> <Level3> <Tag1>x</Tag1> <Tag2>x</Tag2> <Tag3>x</Tag3> </Level3> </Level2> Now I want to keep the structure and content of the first xml file but replace level3 and add the tag contents from second xml. I don't get it. Tried this as last version: <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <Level1> <xsl:apply-templates/> <Level2> <xsl:copy-of select="."/> <Level3> <xsl:copy-of select="document('second.xml')/Level1/Level2/Level3"/> </Level3> </Level2> </Level1> </xsl:template> <xsl:template match="/Level3"> </xsl:template></xsl:stylesheet> I just get prosessed the first xml. What's wrong? Tipps appreciated!Loriot
  9. You are a genius and made my day!!! That works!Thanks aalbetski!!
  10. Hi Boen, I am using som special prosessor implementet in a microsoft based professional radio software. You won't know it. So it seems that I fail this time. Thanks anyway so far.I was thinking round my problem.Functions that could help me were-extract some substring between signsor-turn round string and substring beforor-take substring after last slash (or whatever I translate the slashes to)or-devide value in several values at slashes, then I could continue with last value afterwardsor?I am clueless on all this. But maybe one has an idea?? Maybe there is some java solution I havn't thought of, because I am no java prof.Any hint is appriciated!Loriot
  11. Hi helpful,unfortunately I came to the same point as you, taht I can't use the reverse function (no 2.x parser...). My filenames look like that:\\someplace09\ak01\AK_RASTOFF\KJHGF46927_90D8BAE4D3124E0383EC647A13403DCE.WAV or like that\\someplace15\MediaDir\somename\20061106\ABCDEF46927_80C49B8BC2D345DCB6F48F32E4D3B8AB_1H.WAVand I need to extract just the filenames:KJHGF46927_90D8BAE4D3124E0383EC647A13403DCE.WAVABCDEF46927_80C49B8BC2D345DCB6F48F32E4D3B8AB_1H.WAVI go checking out the tokenize function. Never tried that before. Maybe it helps. Thanks for this first hint.Loriot....tokenize doesn't work out for me. Could you probably give me an example?<xsl:value-of select="tokenize(File_Filename0,'\/')/> leads to an error message that tokenize is an unknown function?
  12. Hi helpful people out there. I am trying to extract the filname out of different pathes. As I don't know the length an number of slashes in the path, I tried to turn it round, take the backwards part until the first slash and turn the result one more time, but it doesn't work like that: <xsl:value-of select="reverse(substring-before(reverse(File_Filename0),'/'))"/> Maybe someone here has some better idea how I solve that???RegardsLoriot
  13. hihi, now I found out on my own. The solution is the floor function.So now I got working code with that:</xsl:template><xsl:decimal-format name="european" decimal-separator=","/><xsl:template name="processLength"> <xsl:param name="milliseconds"/> <xsl:variable name="minutes" select=" floor($milliseconds div 60000)"/> <xsl:variable name="seconds" select="($milliseconds mod (1000*60)) div 1000"/> <xsl:value-of select="concat(format-number($minutes, '00'), ':', format-number($seconds, '00', 'european'))"/></xsl:template>
  14. Hi all,I have a little wrong working transformation and would appriciate some help from you: For a value coming in Milliseconds I try to transform it to minutes:seconds.milliseconds with the following call-template: <xsl:template name="processLength"> <xsl:param name="milliseconds"/> <xsl:variable name="minutes" select=" ($milliseconds div 60000)"/> <xsl:variable name="seconds" select="($milliseconds mod (1000*60)) div 1000"/> <xsl:value-of select="concat(format-number($minutes, '00'), ':', format-number($seconds, '00', 'european'))"/></xsl:template> The transformation looks nice, just the values do not fit all the time. If I have 1min29sec it is allright. If I have 1min44sec I get 2min out here. So it seems to round up from 0,5. How can I make that work correctly?Hope to hear from you soon\Loriot
  15. Thanks a lot! That worked.
×
×
  • Create New...